You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have some GraphQL queries where the top-level field is resolved from a different source, but nested objects are resolved using Join Monster. For example:
In this case, we have a resolver on Query.courses that fetches data from a different API. Course.pool and Pool.views are using Join Monster to query our database (pools and views tables, respectively).
With this query, we run into an n+1 issue: as Query.courses returns a list of courses, and Course.pool calls Join Monster for each course, we're making a DB query for each course!
Describe the ideal solution
A solution that would allow us to batch the Join Monster calls, something like a DataLoader, would be very helpful.
Alternatives and current work-arounds
We tried using batchDelegateToSchema from graphql-tools, but had some problems to get it to work reliably.
Additional context
The text was updated successfully, but these errors were encountered:
Describe the problem you'd like to have solved
We have some GraphQL queries where the top-level field is resolved from a different source, but nested objects are resolved using Join Monster. For example:
In this case, we have a resolver on
Query.courses
that fetches data from a different API.Course.pool
andPool.views
are using Join Monster to query our database (pools
andviews
tables, respectively).With this query, we run into an n+1 issue: as
Query.courses
returns a list of courses, andCourse.pool
calls Join Monster for each course, we're making a DB query for each course!Describe the ideal solution
A solution that would allow us to batch the Join Monster calls, something like a DataLoader, would be very helpful.
Alternatives and current work-arounds
We tried using
batchDelegateToSchema
fromgraphql-tools
, but had some problems to get it to work reliably.Additional context
The text was updated successfully, but these errors were encountered: