Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: when using pagination in a graphql query, the same node seems to be returned on different pages #4700

Closed
wvandeun opened this issue Oct 23, 2024 · 1 comment
Assignees
Labels
group/backend Issue related to the backend (API Server, Git Agent) type/bug Something isn't working as expected

Comments

@wvandeun
Copy link
Contributor

wvandeun commented Oct 23, 2024

Component

API Server / GraphQL

Infrahub version

0.16.4, develop

Current Behavior

When you use pagination on a GraphQL query (offset and limit filters), the same node seems to be returned on different pages.

Expected Behavior

The same node should never be returned on different pages, unless there is an overlap.

Steps to Reproduce

  • load an instance of Infrahub with the demo schema and data
  • open the GraphiQL interface
  • execute the following GraphQL query
query {
 Infranterface(limit: 2) {
  edges {
    node {
      id
    }
  }
 }
}
  • take note of the node ids that got returned
  • query the next page, by introducing an offset filter with value 2 and check the ids, one of the nodes returned will also be in the first query
query {
 InfraInterface(offset: 2, limit: 2) {
  edges {
    node {
      id
    }
  }
 }
}
  • query the next page, by introducing an offset filter with value 4
query {
 InfraInterface(offset: 4, limit: 2) {
  edges {
    node {
      id
    }
  }
 }
}
  • query the next page, by introducing an offset filter with value 6, one of the nodes returned will also be in the first query
query {
 InfraInterface(offset: 6, limit: 2) {
  edges {
    node {
      id
    }
  }
 }
}

Additional Information

No response

@wvandeun wvandeun added type/bug Something isn't working as expected group/backend Issue related to the backend (API Server, Git Agent) labels Oct 23, 2024
@exalate-issue-sync exalate-issue-sync bot added this to the Infrahub - 1.0 milestone Oct 24, 2024
@ogenstad
Copy link
Contributor

Fixed in #4704.

ogenstad added a commit that referenced this issue Oct 24, 2024
ogenstad added a commit that referenced this issue Oct 24, 2024
BeArchiTek pushed a commit that referenced this issue Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) type/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants