From 3abc57c947409a3df24533d1a92b04842838aa03 Mon Sep 17 00:00:00 2001 From: Corey Kovalik Date: Wed, 21 Jul 2021 11:16:00 -0700 Subject: [PATCH] docs: update code sample for N+1 queries for graphback crud service `findBy` method --- docs/resolvers/custom-resolvers.md | 2 +- .../versioned_docs/version-0.16.x/resolvers/custom-resolvers.md | 2 +- .../versioned_docs/version-1.0/resolvers/custom-resolvers.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/resolvers/custom-resolvers.md b/docs/resolvers/custom-resolvers.md index 7991693c68..3f147603fc 100644 --- a/docs/resolvers/custom-resolvers.md +++ b/docs/resolvers/custom-resolvers.md @@ -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 ``` diff --git a/website/versioned_docs/version-0.16.x/resolvers/custom-resolvers.md b/website/versioned_docs/version-0.16.x/resolvers/custom-resolvers.md index 674591a20c..a726526391 100644 --- a/website/versioned_docs/version-0.16.x/resolvers/custom-resolvers.md +++ b/website/versioned_docs/version-0.16.x/resolvers/custom-resolvers.md @@ -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 ``` diff --git a/website/versioned_docs/version-1.0/resolvers/custom-resolvers.md b/website/versioned_docs/version-1.0/resolvers/custom-resolvers.md index 7991693c68..3f147603fc 100644 --- a/website/versioned_docs/version-1.0/resolvers/custom-resolvers.md +++ b/website/versioned_docs/version-1.0/resolvers/custom-resolvers.md @@ -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 ```