Created
March 3, 2020 19:20
-
-
Save chris-feist/769f8ca67edab408a49b87b3fc51c8d4 to your computer and use it in GitHub Desktop.
Temporary GraphQL schema for production GraphQL server example
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'; | |
import gql from 'graphql-tag'; | |
const pingSchema = gql` | |
type Query { | |
"Returns 'pong'" | |
ping: String | |
} | |
`; | |
const typeDefs = [ | |
pingSchema, | |
]; | |
const resolvers = { | |
Query: { | |
ping: () => 'pong', | |
}, | |
}; | |
const schema = makeExecutableSchema({ | |
typeDefs, | |
resolvers, | |
}); | |
export default schema; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment