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.

Query Limit does not work properly with API GraphQL

See original GitHub issue

Note: If your issue/bug is regarding the AWS Amplify Console service, please log it in the Amplify Console GitHub Issue Tracker

Describe the bug I try to get X elements from AppSync with query Limit but it does not work properly.

Amplify CLI Version 4.18.1

To Reproduce Schema.graphql

type InventoryRoom
    @model
    @auth(rules: [
        { allow: private, operations: [read] }
        { allow: groups, groups: ["admin"] }
    ])
{
    id: ID!
    name: String
    items: [InventoryItem] @connection(keyName: "byRoom", fields: ["id"])
}

type InventoryItem
    @model
    @key(name: "byRoom", fields: ["roomID"])
    @auth(rules: [
        { allow: private, operations: [read] }
        { allow: groups, groups: ["admin"] }
    ])
{
    id: ID!
    name: String!
    volume: Int!
    imageKey: String
    imageIdentityId: String
    roomID: ID!
    room: InventoryRoom! @connection(fields: ["roomID"])
}

Expected behavior I except to receive 5 items if I enter limit: 5

Screenshots Limit 5: got 2 image

Limit 10: got 3 image

Limit 500: to list all image

Desktop (please complete the following information):

  • OS: Windows 10 Pro
  • Node Version. v12.16.2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
LucasAndradcommented, Jul 1, 2020

Issues on Amplify are almost always left behind, people are asking questions here so why nobody answered? Why there is no link to some doc or somewhere with an explanation? Why is this issue closed? @edeuxk @alxistn asked great questions and I also didn’t get why Dynamo works that way in this case. @yuth

0reactions
github-actions[bot]commented, May 24, 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

Securing GraphQL API endpoints using rate limits and depth ...
See how to secure your GraphQL API endpoints to prevent API spam and query attacks with rate and depth limiting.
Read more >
Rate limitations are preventing my query - FAQs - GraphQL API
I am using the Monday API to extract data from 1 board! The problem I am having is that this board, whilst it...
Read more >
How to use graphQL limit in aws amplify - Stack Overflow
Consider adding a GSI so that you can query instead of Scan / Filter. Hacks to accumulate the pages of results inside Lambda...
Read more >
Five Common Problems in GraphQL Apps (And How to Fix ...
There is a solution though, which is to cache the entire GraphQL query response. Unlike Dataloader, whose scope is limited to the current ......
Read more >
API (GraphQL) - Fetch data - JavaScript - AWS Amplify Docs
The API category provides a GraphQL client for working with queries, mutations, and subscriptions. Query Declarations. The Amplify CLI codegen automatically ...
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