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.

nextToken Handling

See original GitHub issue

** Which Category is your question related to? **

AppSync SDK

** What AWS Services are you utilizing? **

Amplify, AppSync

** Provide additional details e.g. code snippets **

We’re using the AppSync SDK as documented here: https://aws-amplify.github.io/docs/js/api#aws-appsync-sdk

We’re using queries started like this:

appSyncClient
        .query({
          query: gql(getBlog)
        })

The problem is that we’re not getting all data. This is not specific to list queries (#2728), it also happens when getting a single entity that has a list of another entity attached (e.g., get a blog with all its posts).

In our application, it is not an issue if ALL posts (in the example) are received at once. We do not want to use pagination and would like to get everything at once.

How can we skip pagination and use AppSync to get everything?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wizawuzacommented, Apr 15, 2019

Also note that you don’t want to overwrite that file as it’ll be overwritten by the next time you amplify push/etc. Instead you want to copy it to the /amplify/backend/api/your GraphQL API name/resolvers/ directory (note the lack of the ‘build’ directory). That’s where you put custom resolvers.

0reactions
github-actions[bot]commented, Jun 12, 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 or Discussions for those types of questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do you use "NextToken" in AWS API calls - Stack Overflow
This is how the AWS SDK handles pagination in many cases. You will see the usage of the NextToken in other service clients...
Read more >
Using NextToken to request additional pages
Handling errors with NextTokens. If you ever submit a NextToken to a "ByNextToken" operation and the service returns a NextTokenCorrupted error, ...
Read more >
API (GraphQL) - GraphQL pagination - JavaScript - Amplify Docs
The nextToken is what is used to handle pagination. If the nextToken is null , that means that there is no more data...
Read more >
What is StringTokenizer.nextToken() in Java? - Educative.io
The nextToken method of the StringTokenizer class is an instance method that returns the next token from the string tokenizer.
Read more >
Paginating table query results - Amazon DynamoDB
The AWS SDKs handle the low-level DynamoDB responses (including the presence or absence of LastEvaluatedKey ) and provide various abstractions for ...
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