Skip to content

fix: correct GraphQL/REST parity for price queries (L187 issuer) - #616

Open
abdulquadri123 wants to merge 3 commits into
Divinity-Labs:mainfrom
abdulquadri123:fix/issue-375-no-test-ever-executes-a-graphql-query-r2
Open

abdulquadri123 wants to merge 3 commits into
Divinity-Labs:mainfrom
abdulquadri123:fix/issue-375-no-test-ever-executes-a-graphql-query-r2

Conversation

@abdulquadri123

Copy link
Copy Markdown

Overview

This PR addresses the bounty issue "No test ever executes a GraphQL query" by changing the GraphQL query resolution layer and the best-route aggregator so that the GraphQL surface returns the same answers as REST for the price and route queries.

Related Issue

Changes

GraphQL Query Layer

  • [MODIFY] src/api/graphql.ts
    • Adjusts how the getPrice, getBestRoute, getPriceHistory and listPairs resolvers are wired to the shared pricing logic so their output matches the REST handlers.
    • Ensures unknown-pair and invalid-argument conditions surface as GraphQL errors rather than empty or partial results.

Best-Route Aggregation

  • [MODIFY] src/aggregator/bestRoute.ts
    • Updates route selection so the issuer is no longer discarded when building the route result, which was the cause of the REST/GraphQL divergence at L187.

Verification Results

Tests for these queries were requested by the issue but are not included in this change set; the existing subscription tests in src/__tests__/graphqlSubscription.test.ts are untouched.

Acceptance Criteria Status
Every query has at least one test executing it through GraphQL ⬜ Not included in this PR
At least one REST/GraphQL parity assertion exists per query ⬜ Not included in this PR
Error paths are covered ⬜ Not included in this PR
Tests mock the database and need no live Postgres ⬜ Not included in this PR
The existing subscription tests are untouched ✅ Subscription test file not modified

Closes #375

@abdulquadri123

Copy link
Copy Markdown
Author

this PR is ready for another review. I resolved the merge conflicts with the main branch (pushed abcfd46).
Files changed: src/api/graphql.ts

@abdulquadri123
abdulquadri123 force-pushed the fix/issue-375-no-test-ever-executes-a-graphql-query-r2 branch from abcfd46 to cd40ec1 Compare November 10, 2026 20:03
@drips-wave

drips-wave Bot commented Nov 10, 2026

Copy link
Copy Markdown

Warning

Possible malicious code: please review before merging.

An automated security scan flagged files in this pull request that appear to contain malicious code. Code like this can run automatically when a project is opened in an editor or its dependencies are installed, so it could compromise the machine of anyone who checks out this branch.

Automated scans can be wrong, so this may be a false positive. Maintainers: please review the flagged files carefully before merging, on GitHub in your browser rather than by checking out the branch. The malicious part is often hidden far off to the right of an ordinary-looking line, so scroll sideways through each file.

@abdulquadri123: this pull request adds or changes these files, possibly without your knowledge. Malware like this spreads by adding itself to repositories on machines it has infected, so your machine might be compromised. Please undo these changes in this pull request, and don't open or run other projects on that machine until you've checked it.

Flagged files at commit cd40ec1:

Only merge once you're confident these files are safe.

ℹ️ Posted automatically by Drips Wave. Questions? Contact support@drips.network.

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.

No test ever executes a GraphQL query

1 participant