Created
January 9, 2021 15:53
-
-
Save shamique/0bf9cc108d87326deb1c9ec72d3f5d74 to your computer and use it in GitHub Desktop.
GraphQL_Serverless_API
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 Apollo Azure integration library | |
const { ApolloServer, gql } = require('apollo-server-azure-functions'); | |
// Construct a schema, using GraphQL schema language | |
const typeDefs = gql` | |
type Query { | |
hello: String | |
} | |
`; | |
// Provide resolver functions for your schema fields | |
const resolvers = { | |
Query: { | |
hello: () => 'Hello world!', | |
}, | |
}; | |
const server = new ApolloServer({ typeDefs, resolvers }); | |
exports.graphqlHandler = server.createHandler(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment