A walkthrough of GraphQL unions in the context of Java and Spring for GraphQL. Covers how to declare a union type in a GraphQL schema (e.g., SearchItem as either Author or Book), implement a search query controller that queries multiple repositories, and use the inline fragment syntax (... on TypeName) in GraphQL queries to request type-specific fields. Also demonstrates the __typename meta-field for identifying returned types at runtime.
•6m watch time
Sort: