0
0
GraphQLquery~10 mins

Introspection control in GraphQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to disable introspection in a GraphQL server.

GraphQL
const server = new ApolloServer({ schema, [1] });
Drag options to blanks, or click blank then click option'
Aintrospection: false
Bintrospection: true
Cintrospect: false
Dintrospect: true
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'introspect' instead of 'introspection'.
Setting introspection to true disables it (it's the opposite).
2fill in blank
medium

Complete the code to allow introspection only in development environment.

GraphQL
const server = new ApolloServer({ schema, introspection: process.env.NODE_ENV === [1] });
Drag options to blanks, or click blank then click option'
A'staging'
B'production'
C'development'
D'test'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'production' instead of 'development'.
Forgetting to use quotes around the environment string.
3fill in blank
hard

Fix the error in the code to properly disable introspection in Apollo Server.

GraphQL
const server = new ApolloServer({ schema, introspection: [1] });
Drag options to blanks, or click blank then click option'
Aundefined
B0
Cnull
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 or null instead of false.
Leaving the option undefined.
4fill in blank
hard

Fill both blanks to disable introspection and enable playground only in development.

GraphQL
const server = new ApolloServer({ schema, introspection: [1], playground: [2] });
Drag options to blanks, or click blank then click option'
Afalse
Bprocess.env.NODE_ENV === 'development'
Ctrue
Dprocess.env.NODE_ENV === 'production'
Attempts:
3 left
💡 Hint
Common Mistakes
Enabling introspection by mistake.
Enabling playground in production.
5fill in blank
hard

Fill all three blanks to create a GraphQL server that disables introspection, disables playground, and sets a custom schema.

GraphQL
const server = new ApolloServer({ schema: [1], introspection: [2], playground: [3] });
Drag options to blanks, or click blank then click option'
AmyCustomSchema
Bfalse
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using true for introspection or playground.
Not passing the schema variable correctly.