Skip to content

GraphQL interview questions — Easy

150 easy-level GraphQL questions from our API Testing bank, each with the correct answer and an explanation of why it is correct.

What this covers

GraphQL appears throughout API Testing interviews. At easy level, interviewers are typically checking that you know the fundamentals and can describe them precisely — definitions, defaults, and the basic mechanics. Work through these, then explain your answer out loud; the second part is what interviews actually test.

20 example questions

  1. 1. In the context of GraphQL, mutation input type is best described as:

    • A. Leaf type such as Int, String, or Boolean.
    • B. Structured object type used as a mutation argument.correct
    • C. Guard rejecting overly expensive queries.
    • D. Technique grouping resolver calls to avoid N+1 queries.

    Why: mutation input type: Structured object type used as a mutation argument.

  2. 2. Which of the following best describes batching (dataloader) in GraphQL?

    • A. Server function that returns the data for a field.
    • B. Query that returns the schema itself.
    • C. Pre-registered query referenced by hash to reduce payloads.
    • D. Technique grouping resolver calls to avoid N+1 queries.correct

    Why: batching (dataloader): Technique grouping resolver calls to avoid N+1 queries.

  3. 3. Which of the following best describes mutation input type in GraphQL?

    • A. Technique grouping resolver calls to avoid N+1 queries.
    • B. Structured object type used as a mutation argument.correct
    • C. Server function that returns the data for a field.
    • D. Leaf type such as Int, String, or Boolean.

    Why: mutation input type: Structured object type used as a mutation argument.

  4. 4. Which of the following best describes non-null modifier (!) in GraphQL?

    • A. Marks a field or argument that can never be null.correct
    • B. Server function that returns the data for a field.
    • C. Technique grouping resolver calls to avoid N+1 queries.
    • D. Structured object type used as a mutation argument.

    Why: non-null modifier (!): Marks a field or argument that can never be null.

  5. 5. Which of the following best describes query complexity limit in GraphQL?

    • A. Guard rejecting overly expensive queries.correct
    • B. Query that returns the schema itself.
    • C. Technique grouping resolver calls to avoid N+1 queries.
    • D. Leaf type such as Int, String, or Boolean.

    Why: query complexity limit: Guard rejecting overly expensive queries.

  6. 6. Which of the following best describes persisted query in GraphQL?

    • A. Server function that returns the data for a field.
    • B. Guard rejecting overly expensive queries.
    • C. Query that returns the schema itself.
    • D. Pre-registered query referenced by hash to reduce payloads.correct

    Why: persisted query: Pre-registered query referenced by hash to reduce payloads.

  7. 7. What is the purpose of non-null modifier (!) in GraphQL?

    • A. Marks a field or argument that can never be null.correct
    • B. Structured object type used as a mutation argument.
    • C. Leaf type such as Int, String, or Boolean.
    • D. Query that returns the schema itself.

    Why: non-null modifier (!): Marks a field or argument that can never be null.

  8. 8. In GraphQL, what does batching (dataloader) do or refer to?

    • A. Pre-registered query referenced by hash to reduce payloads.
    • B. Server function that returns the data for a field.
    • C. Marks a field or argument that can never be null.
    • D. Technique grouping resolver calls to avoid N+1 queries.correct

    Why: batching (dataloader): Technique grouping resolver calls to avoid N+1 queries.

  9. 9. In GraphQL, what does query complexity limit do or refer to?

    • A. Guard rejecting overly expensive queries.correct
    • B. Query that returns the schema itself.
    • C. Pre-registered query referenced by hash to reduce payloads.
    • D. Server function that returns the data for a field.

    Why: query complexity limit: Guard rejecting overly expensive queries.

  10. 10. In GraphQL, what does non-null modifier (!) do or refer to?

    • A. Query that returns the schema itself.
    • B. Technique grouping resolver calls to avoid N+1 queries.
    • C. Guard rejecting overly expensive queries.
    • D. Marks a field or argument that can never be null.correct

    Why: non-null modifier (!): Marks a field or argument that can never be null.

  11. 11. Which of the following best describes introspection query in GraphQL?

    • A. Query that returns the schema itself.correct
    • B. Pre-registered query referenced by hash to reduce payloads.
    • C. Guard rejecting overly expensive queries.
    • D. Server function that returns the data for a field.

    Why: introspection query: Query that returns the schema itself.

  12. 12. What is the purpose of query complexity limit in GraphQL?

    • A. Technique grouping resolver calls to avoid N+1 queries.
    • B. Leaf type such as Int, String, or Boolean.
    • C. Query that returns the schema itself.
    • D. Guard rejecting overly expensive queries.correct

    Why: query complexity limit: Guard rejecting overly expensive queries.

  13. 13. What is the purpose of batching (dataloader) in GraphQL?

    • A. Leaf type such as Int, String, or Boolean.
    • B. Server function that returns the data for a field.
    • C. Guard rejecting overly expensive queries.
    • D. Technique grouping resolver calls to avoid N+1 queries.correct

    Why: batching (dataloader): Technique grouping resolver calls to avoid N+1 queries.

  14. 14. What is the purpose of mutation input type in GraphQL?

    • A. Structured object type used as a mutation argument.correct
    • B. Technique grouping resolver calls to avoid N+1 queries.
    • C. Pre-registered query referenced by hash to reduce payloads.
    • D. Marks a field or argument that can never be null.

    Why: mutation input type: Structured object type used as a mutation argument.

  15. 15. In GraphQL, what does mutation input type do or refer to?

    • A. Technique grouping resolver calls to avoid N+1 queries.
    • B. Structured object type used as a mutation argument.correct
    • C. Query that returns the schema itself.
    • D. Leaf type such as Int, String, or Boolean.

    Why: mutation input type: Structured object type used as a mutation argument.

  16. 16. In GraphQL, what does persisted query do or refer to?

    • A. Pre-registered query referenced by hash to reduce payloads.correct
    • B. Technique grouping resolver calls to avoid N+1 queries.
    • C. Marks a field or argument that can never be null.
    • D. Leaf type such as Int, String, or Boolean.

    Why: persisted query: Pre-registered query referenced by hash to reduce payloads.

  17. 17. Which of the following best describes scalar type in GraphQL?

    • A. Technique grouping resolver calls to avoid N+1 queries.
    • B. Query that returns the schema itself.
    • C. Leaf type such as Int, String, or Boolean.correct
    • D. Server function that returns the data for a field.

    Why: scalar type: Leaf type such as Int, String, or Boolean.

  18. 18. What is the purpose of persisted query in GraphQL?

    • A. Technique grouping resolver calls to avoid N+1 queries.
    • B. Guard rejecting overly expensive queries.
    • C. Pre-registered query referenced by hash to reduce payloads.correct
    • D. Structured object type used as a mutation argument.

    Why: persisted query: Pre-registered query referenced by hash to reduce payloads.

  19. 19. In GraphQL, what does resolver do or refer to?

    • A. Server function that returns the data for a field.correct
    • B. Marks a field or argument that can never be null.
    • C. Guard rejecting overly expensive queries.
    • D. Query that returns the schema itself.

    Why: resolver: Server function that returns the data for a field.

  20. 20. What is the purpose of scalar type in GraphQL?

    • A. Leaf type such as Int, String, or Boolean.correct
    • B. Guard rejecting overly expensive queries.
    • C. Marks a field or argument that can never be null.
    • D. Pre-registered query referenced by hash to reduce payloads.

    Why: scalar type: Leaf type such as Int, String, or Boolean.

Related API Testing topics