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. Which of the following best describes mutation input type in GraphQL?
- A. Marks a field or argument that can never be null.
- B. Guard rejecting overly expensive queries.
- C. Structured object type used as a mutation argument.correct
- D. Server function that returns the data for a field.
Why: mutation input type: Structured object type used as a mutation argument.
2. Which of the following best describes non-null modifier (!) in GraphQL?
- A. Pre-registered query referenced by hash to reduce payloads.
- B. Technique grouping resolver calls to avoid N+1 queries.
- C. Marks a field or argument that can never be null.correct
- D. Structured object type used as a mutation argument.
Why: non-null modifier (!): Marks a field or argument that can never be null.
3. 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.
4. Which of the following best describes batching (dataloader) in GraphQL?
- A. Guard rejecting overly expensive queries.
- B. Structured object type used as a mutation argument.
- C. Query that returns the schema itself.
- D. Technique grouping resolver calls to avoid N+1 queries.correct
Why: batching (dataloader): Technique grouping resolver calls to avoid N+1 queries.
5. Which of the following best describes persisted query in GraphQL?
- A. Pre-registered query referenced by hash to reduce payloads.correct
- B. Query that returns the schema itself.
- C. Server function that returns the data for a field.
- D. Technique grouping resolver calls to avoid N+1 queries.
Why: persisted query: Pre-registered query referenced by hash to reduce payloads.
6. Which of the following best describes query complexity limit in GraphQL?
- A. Marks a field or argument that can never be null.
- B. Structured object type used as a mutation argument.
- C. Guard rejecting overly expensive queries.correct
- D. Pre-registered query referenced by hash to reduce payloads.
Why: query complexity limit: Guard rejecting overly expensive queries.
7. 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.
8. 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.
9. What is the purpose of non-null modifier (!) in GraphQL?
- A. Leaf type such as Int, String, or Boolean.
- B. Server function that returns the data for a field.
- C. Marks a field or argument that can never be null.correct
- D. Structured object type used as a mutation argument.
Why: non-null modifier (!): Marks a field or argument that can never be null.
10. Which of the following best describes scalar type in GraphQL?
- A. Guard rejecting overly expensive queries.
- B. Leaf type such as Int, String, or Boolean.correct
- C. Server function that returns the data for a field.
- D. Technique grouping resolver calls to avoid N+1 queries.
Why: scalar type: Leaf type such as Int, String, or Boolean.
11. What is the purpose of query complexity limit in GraphQL?
- A. Guard rejecting overly expensive queries.correct
- B. Query that returns the schema itself.
- C. Leaf type such as Int, String, or Boolean.
- D. Server function that returns the data for a field.
Why: query complexity limit: Guard rejecting overly expensive queries.
12. What is the purpose of mutation input type in GraphQL?
- A. Structured object type used as a mutation argument.correct
- B. Server function that returns the data for a field.
- 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.
13. In GraphQL, what does batching (dataloader) do or refer to?
- A. Server function that returns the data for a field.
- B. Query that returns the schema itself.
- C. Technique grouping resolver calls to avoid N+1 queries.correct
- D. Marks a field or argument that can never be null.
Why: batching (dataloader): Technique grouping resolver calls to avoid N+1 queries.
14. What is the purpose of batching (dataloader) in GraphQL?
- A. Leaf type such as Int, String, or Boolean.
- B. Technique grouping resolver calls to avoid N+1 queries.correct
- C. Pre-registered query referenced by hash to reduce payloads.
- D. Structured object type used as a mutation argument.
Why: batching (dataloader): Technique grouping resolver calls to avoid N+1 queries.
15. In GraphQL, what does mutation input type do or refer to?
- A. Pre-registered query referenced by hash to reduce payloads.
- B. Leaf type such as Int, String, or Boolean.
- C. Structured object type used as a mutation argument.correct
- D. Marks a field or argument that can never be null.
Why: mutation input type: Structured object type used as a mutation argument.
16. In GraphQL, what does query complexity limit do or refer to?
- A. Technique grouping resolver calls to avoid N+1 queries.
- B. Query that returns the schema itself.
- C. Guard rejecting overly expensive queries.correct
- D. Leaf type such as Int, String, or Boolean.
Why: query complexity limit: Guard rejecting overly expensive queries.
17. In GraphQL, what does non-null modifier (!) do or refer to?
- A. Query that returns the schema itself.
- B. Structured object type used as a mutation argument.
- C. Leaf type such as Int, String, or Boolean.
- 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.
18. What is the purpose of persisted query in GraphQL?
- A. Query that returns the schema itself.
- B. Pre-registered query referenced by hash to reduce payloads.correct
- C. Server function that returns the data for a field.
- D. Guard rejecting overly expensive queries.
Why: persisted query: Pre-registered query referenced by hash to reduce payloads.
19. Which of the following best describes resolver in GraphQL?
- A. Query that returns the schema itself.
- B. Pre-registered query referenced by hash to reduce payloads.
- C. Server function that returns the data for a field.correct
- D. Technique grouping resolver calls to avoid N+1 queries.
Why: resolver: Server function that returns the data for a field.
20. What is the purpose of introspection query in GraphQL?
- A. Leaf type such as Int, String, or Boolean.
- B. Server function that returns the data for a field.
- C. Query that returns the schema itself.correct
- D. Pre-registered query referenced by hash to reduce payloads.
Why: introspection query: Query that returns the schema itself.