Last active
June 14, 2018 21:06
-
-
Save daniele-zurico/d80dbdd04840ad9f6a2f5ded7025bb84 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 | |
| } | |
| type Subscription { | |
| postAdded: Post | |
| } | |
| ` | |
| }); | |
| addMockFunctionsToSchema({ schema: postSchema }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment