Complete the code to disable introspection in a GraphQL server.
const server = new ApolloServer({ schema, [1] });Setting introspection: false disables introspection queries in Apollo Server.
Complete the code to allow introspection only in development environment.
const server = new ApolloServer({ schema, introspection: process.env.NODE_ENV === [1] });Introspection is usually enabled only in development to prevent exposing schema details in production.
Fix the error in the code to properly disable introspection in Apollo Server.
const server = new ApolloServer({ schema, introspection: [1] });The introspection option expects a boolean. Use false to disable it.
Fill both blanks to disable introspection and enable playground only in development.
const server = new ApolloServer({ schema, introspection: [1], playground: [2] });Introspection is disabled with false. Playground is enabled only in development environment.
Fill all three blanks to create a GraphQL server that disables introspection, disables playground, and sets a custom schema.
const server = new ApolloServer({ schema: [1], introspection: [2], playground: [3] });The server uses a custom schema myCustomSchema, disables introspection and playground by setting both to false.