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
I have a performance question about Payload GraphQL queries: does querying the id field of a relationship field lead to the "join" query in the database, or does it get it directly from the parent document without increasing the complexity of the database query?
In this query, will the full "Author" document from the "Users" collection be joined on the database query, or will only the "Posts" collection be queried without any joins?
Using the Payload Local API, we can use depth: 0 to prevent additional joins in such cases, but I can't find to do the same with GraphQL queries.
So, if it leads to an additional join, is there any way to prevent this join somehow, as the id value is already available in the main document collection?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a performance question about Payload GraphQL queries: does querying the id field of a relationship field lead to the "join" query in the database, or does it get it directly from the parent document without increasing the complexity of the database query?
Here is an example:
In this query, will the full "Author" document from the "Users" collection be joined on the database query, or will only the "Posts" collection be queried without any joins?
Using the Payload Local API, we can use
depth: 0to prevent additional joins in such cases, but I can't find to do the same with GraphQL queries.So, if it leads to an additional join, is there any way to prevent this join somehow, as the id value is already available in the main document collection?
Beta Was this translation helpful? Give feedback.
All reactions