Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
docs: update code sample for N+1 queries for graphback crud service `…
Browse files Browse the repository at this point in the history
…findBy` method
  • Loading branch information
CoreyKovalik authored and machi1990 committed Jul 21, 2021
1 parent 34a932e commit 3abc57c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/resolvers/custom-resolvers.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const { items: allNotes } = await context.Notes.findBy(args, context, info);
const noteIds = allNotes.map(({ id }) => id);

// retrieves comments owned by notes selected above. Specifying the "comments" path so start selection
const { items: comments } = await context.Comment.findBy({noteId: {in: noteIds}}, context, info, 'comments');
const { items: comments } = await context.Comment.findBy({ filter: { noteId: { in: noteIds } } }, context, info, 'comments');

// ... do the rest
```
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const { items: allNotes } = await context.Notes.findBy(args, context, info);
const noteIds = allNotes.map(({ id }) => id);

// retrieves comments owned by notes selected above. Specifying the "comments" path so start selection
const { items: comments } = await context.Comment.findBy({noteId: {in: noteIds}}, context, info, 'comments');
const { items: comments } = await context.Comment.findBy({ filter: { noteId: { in: noteIds } } }, context, info, 'comments');

// ... do the rest
```
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ const { items: allNotes } = await context.Notes.findBy(args, context, info);
const noteIds = allNotes.map(({ id }) => id);

// retrieves comments owned by notes selected above. Specifying the "comments" path so start selection
const { items: comments } = await context.Comment.findBy({noteId: {in: noteIds}}, context, info, 'comments');
const { items: comments } = await context.Comment.findBy({ filter: { noteId: { in: noteIds } } }, context, info, 'comments');

// ... do the rest
```

0 comments on commit 3abc57c

Please sign in to comment.