[{"id":"graphqladvanced-001","courseId":"graphql-advanced","domain":"schema-and-types","topic":"Non-null wrapping non-null","prompt":"A query asks for `book { title }`. The field book is nullable, and title is String!. The resolver for title raises an error. Where does that error go in the response?","hint":"Think about where a null is allowed to go when a Non-Null field fails.","explain":"A Non-Null field cannot hold null, so a failure there cannot stay in that field's own position. Consider which response position the spec hands the error to instead.","source":"https://spec.graphql.org/draft/#sec-Non-Null","interaction":{"type":"single"},"options":[{"id":"a","text":"It propagates to the parent response position, the book field.","why":"The spec says an execution error at a non-null response position propagates to the parent response position, here book."},{"id":"b","text":"It stays at title, which is filled with an empty string.","whyNot":"title is Non-Null, so it cannot hold null, and the spec never fills a failed value with an empty string."},{"id":"c","text":"It is dropped, and the rest of the response is returned without it.","whyNot":"An execution error on a non-null position is not dropped; it propagates to the parent response position."},{"id":"d","text":"It is returned only in extensions, and title stays in the result.","whyNot":"title is Non-Null and cannot hold null, so the error must move up to the parent response position."}],"answer":"a","explanation":"An execution error at a non-null response position propagates to the parent response position.","concept":"An execution error at a non-null response position propagates to the parent response position.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","code":"type Query {\n  book: Book\n}\n\ntype Book {\n  title: String!\n}","takeaways":["A failing Non-Null field passes its execution error up to the parent response position."]},{"id":"graphqladvanced-002","courseId":"graphql-advanced","domain":"schema-and-types","topic":"Circular input objects","prompt":"The input type below is valid, because a client may leave out its self field.","hint":"Ask whether a client could ever finish building a value of this type.","explain":"An input object may refer to its own type, but building a value must end somewhere. Whether a type can be used depends on whether every required field can be filled with finite data.","source":"https://spec.graphql.org/draft/#sec-Input-Objects","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","whyNot":"self is Non-Null with no default, so a client cannot leave it out, and the type has no finite value."},{"id":"b","text":"False","why":"A required non-null self-reference can never end, so no finite value exists and the input object is invalid."}],"answer":"b","explanation":"An input object whose required field refers back to its own type has no finite value, so it is invalid; a nullable or list self-reference is fine.","concept":"An input object whose required field refers back to its own type has no finite value, so it is invalid; a nullable or list self-reference is fine.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","code":"input Example {\n  self: Example!\n  value: String\n}","takeaways":["A self-referencing input is valid only if the self field can be null or an empty list."]},{"id":"graphqladvanced-003","courseId":"graphql-advanced","domain":"schema-and-types","topic":"Lexical analysis order","prompt":"A client sends a GraphQL document to a server as plain text. Put these stages of reading it in the order the spec describes them.","hint":"Ask what each stage needs as its input before it can run.","explain":"A GraphQL document starts as plain text, and the spec describes several processing stages before any tree exists. Some kinds of text carry no meaning for the grammar and are set aside along the way.","source":"https://spec.graphql.org/draft/#sec-Language","interaction":{"type":"sort","items":[{"text":"Read the document as a sequence of source characters, each a Unicode scalar value.","why":"The source text must be a sequence of SourceCharacter before any token can be formed."},{"text":"Scan the characters from left to right into Token and Ignored lexical tokens.","why":"The source text is first converted into lexical tokens and ignored tokens, scanned from left to right."},{"text":"Drop the Ignored tokens, such as whitespace and comments.","why":"The lexical token sequence, omitting Ignored, is what the grammar reads."},{"text":"Parse the remaining tokens with the Document grammar to build an abstract syntax tree.","why":"The lexical token sequence, omitting Ignored, is scanned into an AST by the Document syntactic grammar."}]},"options":[],"answer":"o:abcd","explanation":"The spec turns document text into lexical tokens, drops the Ignored tokens, and then parses the rest into an AST with the Document grammar.","concept":"The spec turns document text into lexical tokens, drops the Ignored tokens, and then parses the rest into an AST with the Document grammar.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Whitespace and comments are Ignored tokens; the Document grammar only sees the tokens left after they are dropped."]},{"id":"graphqladvanced-004","courseId":"graphql-advanced","domain":"schema-and-types","topic":"specifiedBy on scalars","prompt":"A team adds a custom scalar DateTime and links its format with @specifiedBy. Which TWO statements about that scalar specification URL match the spec?","hint":"Consider who reads the link and whether it should ever change.","explain":"A custom scalar is a name for a format, so people and tools need a written definition of its values. The spec sets rules for what that definition must be and how it may change over time.","source":"https://spec.graphql.org/draft/#sec--specifiedBy","interaction":{"type":"multiple","tellCount":true},"options":[{"id":"a","text":"It should point to a fixed version of the format document, not a page that may change.","why":"If the linked specification is in flux, the service should link to a fixed version rather than a resource that might change."},{"id":"b","text":"It should link to a human-readable description of the data format and its coercion rules.","why":"The linked document must be a human-readable specification of the format, serialization and coercion rules."},{"id":"c","text":"It should be a machine-readable JSON Schema, so tools can validate every value.","whyNot":"The spec asks for a human-readable specification, so a machine-readable schema is not what it requires."},{"id":"d","text":"Its URL may be updated in later releases whenever the format evolves.","whyNot":"The spec says a scalar specification URL should not be changed once defined, since changes can break tooling."},{"id":"e","text":"Built-in scalars such as Int should also carry @specifiedBy to document their rules.","whyNot":"Built-in scalars must not provide a scalar specification URL, because the spec itself defines them."},{"id":"f","text":"It must link to a page on the GraphQL spec, not an outside standard.","whyNot":"The spec's own example links a UUID scalar to RFC 4122, so an outside standard is allowed."}],"answer":"ab","explanation":"A custom scalar's specification URL should be a stable, human-readable document, and built-in scalars must not carry one.","concept":"A custom scalar's specification URL should be a stable, human-readable document, and built-in scalars must not carry one.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Pin a custom scalar's @specifiedBy URL to a stable, human-readable spec and never change it."]},{"id":"graphqladvanced-005","courseId":"graphql-advanced","domain":"schema-and-types","topic":"Cyclic interface references","prompt":"A schema declares three interfaces that implement one another in a loop: A implements B, B implements C, and C implements A. Each interface has an id field. Is this schema valid?","hint":"Follow the implements links and see whether you can return to where you started.","explain":"An interface can implement other interfaces, so the links between interfaces form a graph. The rules about that graph decide which sets of links a schema may contain.","source":"https://graphql.org/learn/schema/#interface-types","interaction":{"type":"single"},"options":[{"id":"a","text":"Invalid: interface types may not contain cyclic references to each other.","why":"The three interfaces form a loop, and the spec forbids cyclic references between interface types."},{"id":"b","text":"Valid: each interface names only one parent, so no interface implements itself.","whyNot":"Each link is single, but a chain of single links can still loop back to its start."},{"id":"c","text":"Valid: the cycle is only forbidden between object types, not interfaces.","whyNot":"The rule applies to interface types, so a loop made only of interfaces is not allowed."},{"id":"d","text":"Valid: the loop is only a problem if an object type implements all three.","whyNot":"The rule concerns the interfaces themselves, so whether an object implements them does not change the result."}],"answer":"a","explanation":"Interface types may not implement themselves or form cyclic references to each other, directly or through a chain.","concept":"Interface types may not implement themselves or form cyclic references to each other, directly or through a chain.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","code":"interface A implements B { id: ID! }\ninterface B implements C { id: ID! }\ninterface C implements A { id: ID! }","takeaways":["An interface's implements chain must never loop back to an interface already on it."]}]