Created
June 14, 2018 21:09
-
-
Save daniele-zurico/5549040ef27e5ab7025cfdb9204739a4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { | |
| addMockFunctionsToSchema, | |
| gql, | |
| makeExecutableSchema | |
| } from "apollo-server"; | |
| import { GraphQLSchema } from "graphql"; | |
| const postSchema: GraphQLSchema = makeExecutableSchema({ | |
| typeDefs: gql` | |
| type Query { | |
| posts: [Post] | |
| } | |
| type Mutation { | |
| addPost(author: String, comment: String): Post | |
| } | |
| type Post { | |
| author: String | |
| comment: String | |
| } | |
| ` | |
| }); | |
| addMockFunctionsToSchema({ schema: postSchema }); | |
| export default postSchema; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment