Last active
April 8, 2021 10:08
-
-
Save abernix/e5fc1b081b24250b74083f8e9a409d6e to your computer and use it in GitHub Desktop.
Apollo Gateway: Health Check: Schema Only
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 { ApolloGateway } from "@apollo/gateway"; | |
import { ApolloServer } from "apollo-server"; | |
(async function startApolloServer() { | |
const gateway = new ApolloGateway({ | |
/* Options, maybe! */ | |
}); | |
const server: ApolloServer = new ApolloServer({ | |
gateway, | |
subscriptions: false, | |
onHealthCheck: () => server.executeOperation({ query: "{ __typename }" }) | |
}); | |
await server.listen(); | |
})().catch(console.error); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment