Recall & Review
beginner
What is an entity reference in GraphQL?
An entity reference is a way to uniquely identify an object across services in a federated GraphQL setup, allowing different services to share and resolve the same entity.
Click to reveal answer
beginner
How do you mark a type as an entity in GraphQL federation?
You add the
@key directive to the type, specifying one or more fields that uniquely identify the entity.Click to reveal answer
intermediate
What is the purpose of the
_entities field in a federated GraphQL schema?The
_entities field allows querying multiple entities by their references, resolving them to their full data from the appropriate service.Click to reveal answer
intermediate
Explain how entity references help in a microservices architecture using GraphQL.
Entity references let different microservices own parts of the data but still link and fetch complete entities by their unique keys, enabling a unified API.Click to reveal answer
beginner
What directive is used to specify the fields that form the unique key for an entity?
The
@key directive is used to specify the unique identifying fields of an entity in GraphQL federation.Click to reveal answer
Which directive marks a GraphQL type as an entity for federation?
✗ Incorrect
The @key directive marks a type as an entity by specifying its unique identifying fields.
What is the purpose of the _entities field in a federated GraphQL schema?
✗ Incorrect
The _entities field allows querying multiple entities by their references to fetch full data.
In GraphQL federation, what does an entity reference usually contain?
✗ Incorrect
An entity reference contains the unique key fields that identify the entity.
Why are entity references important in a microservices GraphQL architecture?
✗ Incorrect
Entity references enable different services to share and resolve the same entity data across the federated schema.
Which of the following is NOT true about entity references?
✗ Incorrect
Entity references do not store the entire entity data locally; they only contain unique identifiers.
Describe what an entity reference is and how it works in GraphQL federation.
Think about how different services share data about the same object.
You got /4 concepts.
Explain why entity references are useful in a microservices environment using GraphQL.
Consider how multiple teams manage parts of data but want a single API.
You got /4 concepts.