Created
April 12, 2018 07:47
-
-
Save wojciech-bilicki/42afc40153b3e5ca56dc2f15fa6f85f3 to your computer and use it in GitHub Desktop.
mandatory fields
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
import {makeExecutableSchema, addMockFunctionsToSchema} from 'graphql-tools'; | |
import resolvers from './resolvers' | |
const typeDefs = ` | |
type Author { | |
id: Int, | |
age: Int | |
name: String, | |
Books: [String] | |
} | |
type Query { | |
authors: [Author] | |
author(id: Int): Author | |
} | |
type Mutation { | |
addAuthor(name: String!, age: Int!, Books: [String]!): Author | |
} | |
`; | |
const schema = makeExecutableSchema({typeDefs, resolvers}); | |
export default schema; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment