I have an entity (Customer) that needs to pull data from multiple sources. The schema looks roughly like this:
{
id: string
name: string
address: string
contact: string
status: string
}
The id
, name
and address
come from an EF datacontext. The contact
and status
fields come from a single REST endpoint, and looks like this:
GET /url/customer?id=1234
{
id: '1234'
contact: 'joe@bloggington.com'
status: 'ACTIVE'
}
If I put both contact
and status
into a single field/object (i.e. ContactStatus
), then it would be a simple case of creating an extension for Customer
. But these fields are not related, and should be regarded as different top-level fields.
Is there a way to ensure that the REST endpoint is called only once, when fetching all values? Essentially resolving both fields when fetching one or the other maybe?
Hot Chocolate v12.15.0
, net6.0