Skip to content

Instantly share code, notes, and snippets.

@wojciech-bilicki
Created April 12, 2018 07:47
Show Gist options
  • Save wojciech-bilicki/42afc40153b3e5ca56dc2f15fa6f85f3 to your computer and use it in GitHub Desktop.
Save wojciech-bilicki/42afc40153b3e5ca56dc2f15fa6f85f3 to your computer and use it in GitHub Desktop.
mandatory fields
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