Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Change paginated API query metadata to only be included in response if requested #791

Closed
Tracked by #794
deekerno opened this issue Apr 24, 2023 · 2 comments
Closed
Tracked by #794
Labels
fuel-explorer This PR is directly related to the block explorer P: High
Milestone

Comments

@deekerno
Copy link
Contributor

deekerno commented Apr 24, 2023

As part of the paginated query support implemented in #763, we automatically return a PageInfo object if a user sends a limit in their query. We should change the behavior to return the PageInfo object only if it is requested.

edit: Here's additional info.

During a sync with a member of the frontend team, they gave an example of a query that they would typically use:

query {
  transactions(first:10) {
    nodes {
      id
    }
    pageInfo {
      hasPreviousPage
    }
  }
  blocks(first:10) {
    nodes {
      id
    }
    pageInfo {
      hasPreviousPage
    }
  }
}

As you can see, this query specifically requests for the PageInfo metadata object to be returned. Upon clarification, they said that the front-end team would rather the PageInfo object only be returned if requested instead of how I originally implemented it (the current behavior is to return it for all paginated queries and it's unable to be specifically requested).

@ra0x3
Copy link
Contributor

ra0x3 commented Apr 24, 2023

@deekerno This seems simple enough for me to handle if you prefer (also happy to let you have it if you have a certain way you'd like to see it implemented).

@deekerno
Copy link
Contributor Author

Go for it! You should be able to look for the PageInfo object inside of Operation.parse(...) and then go from there. 👌🏽

@ra0x3 ra0x3 self-assigned this Apr 24, 2023
@ra0x3 ra0x3 linked a pull request Apr 25, 2023 that will close this issue
4 tasks
@ra0x3 ra0x3 removed their assignment May 1, 2023
@ra0x3 ra0x3 added this to the Beta-4.5 milestone May 1, 2023
@deekerno deekerno self-assigned this May 3, 2023
@ra0x3 ra0x3 added the fuel-explorer This PR is directly related to the block explorer label May 8, 2023
@ra0x3 ra0x3 assigned ra0x3 and unassigned deekerno May 18, 2023
@ra0x3 ra0x3 removed their assignment Jul 3, 2023
@ra0x3 ra0x3 removed devx labels Aug 8, 2023
@ra0x3 ra0x3 closed this as completed Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fuel-explorer This PR is directly related to the block explorer P: High
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants