Fragments let you define a set of fields once and include them in multiple queries/mutations with ...FragmentName. This avoids repeating the same field selections and keeps operations maintainable.
2 / 5
Persisted queries improve performance and security because:
Persisted queries: clients pre-register operations with the server (often at build time) and send a small ID instead of the full query string. This reduces bandwidth, prevents clients from running unregistered queries, and improves security.
3 / 5
GraphQL solves the over-fetching problem by:
Over-fetching (REST returns all fields; client uses only a few) is a key REST pain point. GraphQL clients declare exactly what they need in the selection set — the server resolves only those fields, reducing bandwidth.
4 / 5
GraphQL introspection allows:
Introspection is a built-in GraphQL feature (queries starting with __schema, __type) that lets clients discover the API's structure dynamically. Tools like GraphiQL and code generators rely on introspection — it is often disabled in production for security.
5 / 5
Which sentence correctly uses GraphQL variables?
Variables let clients pass dynamic values (e.g., an ID, a filter) into an operation: query GetOrder($id: ID!) { order(id: $id) { ... } }. This prevents query string manipulation and allows queries to be cached by the server.