Nino Matos
Nino Matos

Reputation: 131

Performance of exposing data from two tables via GraphQl

I have data from two tables that I need to expose to frontend as a table where the overview of the sales/refunds will be. Consider the dummy data

Charges id amount created account more fields

Refunds id amount account created more fields charge_id

The solution that I'm trying to go for is to merge the 2 arrays fetched from the db and make a third type that standardize both sources into one and create a graphql resolver for that third "type". But the problem that i foresee is because each table contain millions of rows that the fetching of the data will be not performant.

Is that a different way to achieve this in a performant way? Can I achieve pagination and filtering without having to filter 3 times(one per each source + the resultant type). Or am I over engineering this?

What suggestions do you have?

Thanks in advance

Upvotes: 0

Views: 12

Answers (0)

Related Questions