Skip to content
Discussion options

You must be logged in to vote

ah i see, yeah joins need the field on other side so wont work for your case

about graphql locally - its not that bad actually. payload graphql resolver uses dataloader pattern internally so it batches the queries, not pure N+1. but yes there is some overhead compared to direct local api

for your case i think best options:

  1. depth 1 with select - this should work:
const result = await payload.find({
  collection: "product-selections",
  depth: 1,
  select: {
    title: true,
    owner: true,  // will populate with depth 1
    // dont include tags, subscribers, products - they stay as IDs
  },
});

when you dont select a relationship field, it shouldnt populate it even with depth 1. can you…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@MurzNN
Comment options

@MurzNN
Comment options

Comment options

You must be logged in to vote
1 reply
@MurzNN
Comment options

Answer selected by MurzNN
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants