Skip to content

feat(graphql): add pairs query with asset details and deprecate listP… - #468

Merged
Miracle656 merged 1 commit into
Divinity-Labs:mainfrom
Bigclavsfx:feat/graphql-pairs-query
Oct 23, 2026
Merged

Miracle656 merged 1 commit into
Divinity-Labs:mainfrom
Bigclavsfx:feat/graphql-pairs-query

Conversation

@Bigclavsfx

Copy link
Copy Markdown
Contributor

Closes #365

Summary

Related issue

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Docs
  • Tests
  • CI / tooling

Checklist

  • I have read CONTRIBUTING.md
  • npx tsc --noEmit passes
  • npm run build passes
  • I added / updated tests where relevant
  • I updated docs where relevant

@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@Bigclavsfx Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Miracle656
Miracle656 merged commit f8e29b8 into Divinity-Labs:main Oct 23, 2026
1 check passed
@Miracle656

Copy link
Copy Markdown
Collaborator

Merged to main as f8e29b8.

listPairs returning bare strings meant a client wanting the assets, the network or a price had to parse the pair key and then ask again. pairs returns the structured form — and keeping listPairs with @deprecated(reason: ...) rather than removing it is the right call for a published API.

The resolver is the good part. One query per request using a LATERAL join to pull the latest price for each active pair, instead of a query per pair — and scoped by network = $1, so it can't blend chains. That last one matters more than it looks: two separate PRs today (#584 and #605) existed solely to fix exactly that bug elsewhere in this codebase.

Conflicts, resolved by keeping main's richer side and adding yours:

  • imports — kept NetworkName, the oracle adapter and compareOracles, added getActivePairs
  • the schema declaration — kept export const schema, which the SDL artifact generator depends on, and added your Asset and Pair types
  • the Query block — kept main's documented getPriceHistory with its from/to range and the oracle query, and added pairs plus the deprecation on listPairs

One thing for next time: I had to regenerate schema.graphql after resolving. src/__tests__/graphqlSchemaDrift.test.ts compares the committed SDL against the code-defined schema, so adding types without regenerating fails it — npx tsx scripts/generate-graphql-schema.ts. That's the third generated-artifact guard in this repo now, alongside openapi.json and the TypeScript client, and they all work the same way.

Lens: 118 files, 1,432 tests passing, typecheck clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

listPairs returns bare strings

2 participants