Skip to content

Instantly share code, notes, and snippets.

@helfer
Last active February 28, 2018 04:38
Show Gist options
  • Save helfer/09b7afb0a7c2e2996e40c52d23646043 to your computer and use it in GitHub Desktop.
Save helfer/09b7afb0a7c2e2996e40c52d23646043 to your computer and use it in GitHub Desktop.
The full schema for the GraphQL server tutorial
import { makeExecutableSchema } from 'graphql-tools';
const typeDefs = `
type Author {
id: Int
firstName: String
lastName: String
posts: [Post]
}
type Post {
id: Int
title: String
text: String
views: Int
author: Author
}
type Query {
author(firstName: String, lastName: String): Author
getFortuneCookie: String
}
`;
export default makeExecutableSchema({ typeDefs });
@d3vild06
Copy link

Your blog tutorial references mocking data using the casual package, yet in this gist you removed the use of the addMockFunctionsToSchema function and importing your mocks to actually be able to do just that. Just a bit confusing for the reader since this seems like an oversight or a final version of the schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment