question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to fetch records based on array of ID's with graphql API

See original GitHub issue

Which Category is your question related to? API

What AWS Services are you utilizing? Cognito, AWS AppSync, graphql API

Provide additional details e.g. code snippets I have array of todoID how do I fetch only records matching these ID’s.

Currently I fetch everything and filter.

const allTodos = await API.graphql(graphqlOperation(listTodos));

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
edwardfoylecommented, Nov 12, 2020

@jamesalester If the client is specifying projectIDs on the fly, you would have to either have the client issue multiple byProject() queries or have a lambda resolver as you mentioned. If the projects that you are querying are known in advance though (such as “all projects in an organization” then you could include another field in the todo table such as “organizationID” and have a GSI on that field so you could query Todos “byOrganization”

0reactions
github-actions[bot]commented, May 25, 2021

This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get all data of array of ids in one query in graphql?
My query for Roster - query GetRoster( $startDate: DateTime! $endDate: DateTime! $wardId: String! $rosterTypeId: String! ) ...
Read more >
GraphQL List - How to use arrays in GraphQL schema ...
The user query returns the User object based on the passed id. The users query then returns a list of users. We have...
Read more >
GraphQL Search and Filter – How to ...
} Let's try this: type AlbumsFilters = { genre: Genre ids: [ID!] } type AlbumsInput = { filter: AlbumsFilters } type Query {...
Read more >
Global Object Identification
This returns objects which conform to a "Node" interface. The id field can be extracted out of the response safely, and can be...
Read more >
How to query multiple document refs in GraphQL - Help
I have the following graphQL Schema. I want to query the Decor type by multiple reference ID's. I have an array of Decor...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found