0
0
GraphQLquery~10 mins

Schema visibility 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 define a GraphQL schema with a visible Query type.

GraphQL
type [1] { hello: String }
Drag options to blanks, or click blank then click option'
AMutation
BQuery
CSubscription
DVisible
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Mutation' or 'Subscription' as the root query type.
Naming the type something unrelated like 'Visible'.
2fill in blank
medium

Complete the directive to hide a field from the schema.

GraphQL
type Query { secretField: String [1] }
Drag options to blanks, or click blank then click option'
A@deprecated
B@skip
C@hidden
D@include
Attempts:
3 left
💡 Hint
Common Mistakes
Using '@deprecated' which only marks a field as deprecated but does not hide it.
Using '@skip' or '@include' which control query execution, not schema visibility.
3fill in blank
hard

Fix the error in the schema to properly hide the Mutation type.

GraphQL
schema { query: Query mutation: [1] }
Drag options to blanks, or click blank then click option'
AMutation
BHiddenMutation
CMutation @deprecated
DMutation @hidden
Attempts:
3 left
💡 Hint
Common Mistakes
Just renaming the type without hiding it.
Using '@deprecated' which does not hide the type.
4fill in blank
hard

Fill both blanks to define a schema with a visible Query and a hidden Mutation.

GraphQL
schema { query: [1] mutation: [2] }
Drag options to blanks, or click blank then click option'
AQuery
BMutation
CMutation @hidden
DSubscription
Attempts:
3 left
💡 Hint
Common Mistakes
Not adding '@hidden' to Mutation.
Using 'Subscription' instead of 'Mutation' for mutation root.
5fill in blank
hard

Fill all three blanks to define a schema with a visible Query, a hidden Mutation, and a visible Subscription.

GraphQL
schema { query: [1] mutation: [2] subscription: [3] }
Drag options to blanks, or click blank then click option'
AQuery
BMutation @hidden
CSubscription
DMutation
Attempts:
3 left
💡 Hint
Common Mistakes
Not hiding Mutation with '@hidden'.
Mixing up Subscription and Mutation roots.