Bird
0
0

How do you correctly use a fragment named ProfileInfo inside a GraphQL query?

easy📝 Syntax Q3 of 15
GraphQL - Queries
How do you correctly use a fragment named ProfileInfo inside a GraphQL query?
Aquery { user { ProfileInfo } }
Bquery { user { ...ProfileInfo() } }
Cquery { user { ...ProfileInfo } }
Dquery { user { fragment ProfileInfo } }
Step-by-Step Solution
Solution:
  1. Step 1: Recall fragment usage syntax

    Fragments are included with spread operator and fragment name without parentheses.
  2. Step 2: Analyze options

    query { user { ...ProfileInfo } } uses correct syntax: ...ProfileInfo.
  3. Final Answer:

    query { user { ...ProfileInfo } } -> Option C
  4. Quick Check:

    Fragments use spread syntax without parentheses [OK]
Quick Trick: Use ...FragmentName without parentheses to include fragments [OK]
Common Mistakes:
  • Adding parentheses after fragment name
  • Using fragment keyword inside query selection
  • Referencing fragment as a field

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes