Data aggregation - federate schema design

Hi everyone,

We are implementing the federation at my current company. we do have a couple of entities, Brand, Category, and Product. In some cases, we need to do some data aggregation between two of these entities. we could also have aggregation between Product and Category.
We trying to figure out the best way to that. is it by adding a new entity BrandProductAggeragtion, CategoryProdcutAggregation? or by just playing with a query? if it is a latter, how that could be achieved

Thanks

I think Entities in Apollo Federation - Apollo GraphQL Docs is a good place to get started. As suggested in the docs, you can set up your federated services for your entities based on Concern-based Separation. And then you can use the entity referencing (using directives like @external, @requires, @provides as needed) and build your schema.

Also recommend checking out Apollo Workbench, a VSCode extension to get in insight into the query plan even before you publish your schema on any federated service.

1 Like