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

chore: optimize getTransactions query #3336

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Torres-ssf
Copy link
Contributor

@Torres-ssf Torres-ssf commented Oct 15, 2024

Release notes

In this release, we:

  • Optimize graphQL query for Provider.getTransactions

Summary

This PR updates the getTransactions query to return only the rawPayload property

The Provider.getTransactions method, which uses this query, only requires the rawPayload property. Therefore, the broader transactionFragment, which includes unnecessary data, is no longer used.

Since the Provider.getTransactions method did not use the additional fetched data included at transactionFragment, this change does not introduce any breaking changes.

Checklist

  • All changes are covered by tests (or not applicable)
  • All changes are documented (or not applicable)
  • I reviewed the entire PR myself (preferably, on GH UI)
  • I described all Breaking Changes (or there's none)

Copy link

vercel bot commented Oct 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fuels-template ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 15, 2024 3:26pm
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 15, 2024 3:26pm

Copy link

codspeed-hq bot commented Oct 15, 2024

CodSpeed Performance Report

Merging #3336 will not alter performance

Comparing st/chore/optimize-get-transactions-query (fff1af4) with master (9ebd6c2)

Summary

✅ 18 untouched benchmarks

Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
76.11%(+0%) 70.06%(+0.04%) 75.09%(+0%) 76.24%(+0%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 88.57%
(+0%)
78.08%
(+1.37%)
84%
(+0%)
88.81%
(+0%)

@@ -0,0 +1,5 @@
---
"@fuel-ts/account": patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"@fuel-ts/account": minor

Isn't this a breaking change given we changing the response of getTransactions to return two less fields? i.e. the id and transactionStatusFragment ?

Copy link
Contributor Author

@Torres-ssf Torres-ssf Oct 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But @maschad The Provider.getTransactions has exactly the same response, no property was removed from it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with you but if someone called provider.operations.getTransactions() the response would change and thus it's breaking.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We made #3286 and #3296 breaking for the same reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maschad Oook I get you now.

I think this one went unnoticed #3309

Copy link
Contributor

@danielbate danielbate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from the changeset 👍🏻

@Torres-ssf Torres-ssf marked this pull request as draft October 16, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issue is a chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants