Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start a subscription for a user.
GraphQL
mutation StartSubscription { startSubscription(userId: [1]) { id status } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using an unquoted number for userId causes syntax errors.
Using variable names instead of actual values.
✗ Incorrect
The userId must be a string in quotes in GraphQL mutations.
2fill in blank
mediumComplete the code to query the subscription status.
GraphQL
query GetSubscriptionStatus { subscription(id: [1]) { status } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted IDs causes errors.
Confusing field names with ID values.
✗ Incorrect
Subscription IDs are strings and must be quoted in GraphQL queries.
3fill in blank
hardFix the error in the mutation to cancel a subscription.
GraphQL
mutation CancelSubscription { cancelSubscription(id: [1]) { id status } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes around string IDs.
Using variable names instead of actual values.
✗ Incorrect
The subscription ID must be a string in quotes for the mutation to work.
4fill in blank
hardFill both blanks to query active subscriptions for a user.
GraphQL
query ActiveSubscriptions { user(id: [1]) { subscriptions(status: [2]) { id } } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted strings for IDs or status.
Using wrong status values.
✗ Incorrect
User ID and status must be strings in quotes in GraphQL queries.
5fill in blank
hardFill all three blanks to update subscription status with a mutation.
GraphQL
mutation UpdateSubscription { updateSubscription(id: [1], status: [2]) { id [3] } } Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting string arguments.
Returning wrong fields in the response.
✗ Incorrect
The subscription ID and status must be strings, and the field to return is 'status'.