Skip to content

Instantly share code, notes, and snippets.

@jelorivera08
Created January 23, 2020 05:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jelorivera08/f2688be46c68e4e6e8162427fe79879e to your computer and use it in GitHub Desktop.
Save jelorivera08/f2688be46c68e4e6e8162427fe79879e to your computer and use it in GitHub Desktop.
const { GraphQLSchema, GraphQLObjectType } = require('graphql');
const { NotesQuery } = require('./query/NotesQuery');
const {
CreateNoteMutation,
UpdateNoteMutation,
DeleteNoteMutation
} = require('./mutation/NotesMutation');
const QueryType = new GraphQLObjectType({
name: 'Query',
fields: () => ({
notes: NotesQuery
})
});
const MutationType = new GraphQLObjectType({
name: 'Mutation',
fields: () => ({
createNote: CreateNoteMutation,
deleteNote: DeleteNoteMutation,
updateNote: UpdateNoteMutation
})
});
const schema = new GraphQLSchema({ query: QueryType, mutation: MutationType });
module.exports = schema;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment