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

Merged
merged 15 commits into from
Nov 12, 2024

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.

Breaking Changes

The response format for Provider.getTransactions remains the same. However, the response format for the query Provider.operations.getTransactions has been modified.

// before
query getTransactions {
  id
  rawPayload
  status {
    ...
  }
}
// after
query getTransactions {
  rawPayload
}

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 Nov 12, 2024 7:02am
ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 12, 2024 7:02am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
ts-docs-api ⬜️ Ignored (Inspect) Nov 12, 2024 7:02am

Copy link

codspeed-hq bot commented Oct 15, 2024

CodSpeed Performance Report

Merging #3336 will improve performances by ×2.4

Comparing st/chore/optimize-get-transactions-query (94fd614) with master (1ea2e27)

Summary

⚡ 1 improvements
✅ 17 untouched benchmarks

Benchmarks breakdown

Benchmark master st/chore/optimize-get-transactions-query Change
should successfully conduct a custom transfer between wallets (x20 times) 120.8 ms 49.9 ms ×2.4

.changeset/nervous-impalas-serve.md Outdated Show resolved Hide resolved
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
@Torres-ssf Torres-ssf changed the title chore: optimize getTransactions query chore!: optimize getTransactions query Nov 11, 2024
@Torres-ssf Torres-ssf marked this pull request as ready for review November 11, 2024 02:50
Copy link
Contributor

@petertonysmith94 petertonysmith94 left a comment

Choose a reason for hiding this comment

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

Could we add a migration suggestion to the breaking changes? Maybe just a suggestion to user Provider.getTransactions?

@maschad maschad enabled auto-merge (squash) November 12, 2024 05:41
Copy link
Contributor

Coverage Report:

Lines Branches Functions Statements
65.72%(+0%) 69.68%(-0.03%) 73.49%(+0%) 66.13%(+0%)
Changed Files:
Ok File (✨=New File) Lines Branches Functions Statements
🔴 packages/account/src/providers/transaction-request/transaction-request.ts 88.57%
(+0%)
76.71%
(-1.37%)
84%
(+0%)
88.81%
(+0%)

@maschad maschad merged commit 8c77765 into master Nov 12, 2024
25 checks passed
@maschad maschad deleted the st/chore/optimize-get-transactions-query branch November 12, 2024 07:20
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.

6 participants