Bird
0
0

Which of the following is a valid way to define an argument named limit of type Int in a GraphQL schema?

easy📝 Conceptual Q2 of 15
GraphQL - Resolvers
Which of the following is a valid way to define an argument named limit of type Int in a GraphQL schema?
Alimit: Int!
Blimit: Boolean
Climit: String
Dlimit: Int
Step-by-Step Solution
Solution:
  1. Step 1: Understand GraphQL argument types

    Arguments must have a type; Int is a valid scalar type for integers.
  2. Step 2: Check the options

    limit: Int defines limit as Int (nullable), matching type Int. limit: Int! defines non-nullable Int!. limit: String and limit: Boolean use wrong types for Int.
  3. Final Answer:

    limit: Int -> Option D
  4. Quick Check:

    Argument type must match expected data type [OK]
Quick Trick: Use correct scalar types for args like Int, String, Boolean [OK]
Common Mistakes:
  • Using wrong types like String for numbers
  • Forgetting non-null ! when required
  • Confusing argument with field type

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GraphQL Quizzes