Skip to content

Instantly share code, notes, and snippets.

@nikolasburk
Last active June 20, 2019 09:32
Show Gist options
  • Save nikolasburk/fbbb47a21d491ecc6ab3083230197678 to your computer and use it in GitHub Desktop.
Save nikolasburk/fbbb47a21d491ecc6ab3083230197678 to your computer and use it in GitHub Desktop.
const UserType = new GraphQLObjectType({
name: 'User',
fields: {
id: { type: GraphQLID },
name: { type: GraphQLString },
},
})
const schema = new GraphQLSchema({
query: new GraphQLObjectType({
name: 'Query',
fields: {
user: {
type: UserType,
resolve: () => ({ id: 1, name: "Alice" })
},
},
}),
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment