Last active
February 28, 2018 04:38
-
-
Save helfer/09b7afb0a7c2e2996e40c52d23646043 to your computer and use it in GitHub Desktop.
The full schema for the GraphQL server tutorial
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 } 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 }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your blog tutorial references mocking data using the
casual
package, yet in this gist you removed the use of theaddMockFunctionsToSchema
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.