import {API} from 'aws-amplify'
API.graphql({query: ListUsers}
const api = new GraphqlApi(this, 'User API', {
name: 'User API',
schema: Schema.fromAsset(
path.join(__dirname, 'schema.graphql')
),
authorizationConfig: {
defaultAuthorization: {
authorizationType: AuthorizationType.API_KEY,
},
},
})
type Query {
listUsers(
limit: Int,
nextToken: String): UserConnection
}
type User {
userId: ID!
firstname: String!
lastname: String!
picture: AWSURL!
}
type UserConnection {
items: [User!]
nextToken: String
}
🤝🏽