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

transactionsByOwner graphql query doesn't work properly when providing last #1040

Closed
mpoplavkov opened this issue Feb 23, 2023 · 1 comment
Closed
Labels
bug Something isn't working graphql-api Affects API of the GraphQL

Comments

@mpoplavkov
Copy link

The following request works for me:

query Transactions($address: Address) {
  transactionsByOwner(owner: $address, first:10) {
    nodes {
      id
    }
  }
}

Although, if I want to change the ordering and get latest transactions first and therefore provide last parameter instead of first, the query returns an empty response:

query Transactions($address: Address) {
  transactionsByOwner(owner: $address, last:10) {
    nodes {
      id
    }
  }
}

The account I test on is 0xfe1177573a47310756f27ef25c7229b5da8d5109a7258b297f23a6768c78cb40.

Expected: when providing last, the query should return a nonempty result, similar to the case with first, but with a different ordering.

@xgreenx xgreenx added graphql-api Affects API of the GraphQL bug Something isn't working labels Feb 23, 2023
@xgreenx
Copy link
Collaborator

xgreenx commented Feb 23, 2023

Thank you for reporting it=) I guess, you got the weird response during interaction with beta 2.

We already added some handling for it in beta 3. After the change we don't allow backward queries because underlying database doesn't support it too. So with the new version, you should get an error like "reverse pagination isn't supported for this resource".

While our main database is the RocksDB, we don't plan to support functionality that is not supported by this database. But we have an issue to move all GraphQL stuff to the fuel-indexer.

After resolving this issue, we will support queries like this and more=)

I will close this issue for now, because it will be related to the indexer in the future

@xgreenx xgreenx closed this as completed Feb 23, 2023
xgreenx added a commit that referenced this issue Feb 23, 2023
Added test to cover the iteration over owned transactions.

Ref #1040
crypto523 pushed a commit to crypto523/fuel-core that referenced this issue Oct 7, 2024
Added test to cover the iteration over owned transactions.

Ref FuelLabs/fuel-core#1040
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working graphql-api Affects API of the GraphQL
Projects
None yet
Development

No branches or pull requests

2 participants