Bird
0
0

Identify the error in this GraphQL query:

medium📝 Debug Q14 of 15
GraphQL - Resolvers
Identify the error in this GraphQL query:
{ product(id=10) { name price } }
AUsing equals sign (=) instead of colon (:) for argument
BMissing curly braces around the query
CField name 'product' is invalid
DArguments must be outside parentheses
Step-by-Step Solution
Solution:
  1. Step 1: Check argument syntax

    GraphQL requires arguments to use colon (:), not equals sign (=). The query uses id=10 which is invalid.
  2. Step 2: Verify other parts

    The query has curly braces, 'product' is a valid field name, and arguments must be inside parentheses, so other options are incorrect.
  3. Final Answer:

    Using equals sign (=) instead of colon (:) for argument -> Option A
  4. Quick Check:

    Args use colon, not equals [OK]
Quick Trick: Args use colon (:), never equals (=) [OK]
Common Mistakes:
  • Using = instead of : in args
  • Thinking args go outside parentheses
  • Assuming missing braces error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes