Last active
June 14, 2018 21:07
-
-
Save daniele-zurico/bd4fbc3bc7e3a6dca801ab3da3f567b1 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