In GraphQL SDL, the ! (exclamation mark) after a field type means:
Non-null (!) in SDL guarantees that the field will always have a value. name: String! means name is always a String, never null. This affects client null-safety handling and is a key schema design decision.
2 / 5
GraphQL has three operation types. Which of the following is NOT a valid GraphQL operation?
GraphQL defines three operation types: Query (read), Mutation (write), Subscription (real-time). 'Transaction' is not a GraphQL concept — mutations are used for writes, and atomicity must be handled at the application layer.
3 / 5
What is the difference between an Interface and a Union in GraphQL?
Interface: all implementing types share the interface's fields (e.g., Node with id). Union: a field can return one of several unrelated types (e.g., SearchResult = User | Post | Product) — no shared fields required.
4 / 5
Which of these is a custom scalar in GraphQL?
GraphQL's built-in scalars are String, Int, Float, Boolean, ID. 'Date' is not built-in — it is a common custom scalar added by schemas to represent date/time values, typically serialised as ISO 8601 strings or Unix timestamps.
5 / 5
Fill in the blank: "Our search endpoint returns a ___ type because results can be either a User, a Post, or a Product."
A Union is the right choice when a field can return one of several unrelated types. The client uses inline fragments to handle each type: ... on User { name }, ... on Post { title }.