Created
January 23, 2020 05:23
-
-
Save jelorivera08/f2688be46c68e4e6e8162427fe79879e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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