Skip to content

feat(graphql): extended query suite for history range, oracle, volumes, spreads, and screener (#367, #368, #369, #370) - #457

Open
sparkysolutions10-pixel wants to merge 2 commits into
Divinity-Labs:mainfrom
sparkysolutions10-pixel:feat/graphql-query-cluster-367-368-369-370
Open

sparkysolutions10-pixel wants to merge 2 commits into
Divinity-Labs:mainfrom
sparkysolutions10-pixel:feat/graphql-query-cluster-367-368-369-370

Conversation

@sparkysolutions10-pixel

Copy link
Copy Markdown
Contributor

Summary of Changes

This pull request implements the GraphQL extended query cluster, bridging critical REST analytics and comparison capabilities to the GraphQL surface (POST /graphql):

1. getPriceHistory Timestamp Boundaries & Range Validation (closes #370)

  • Added optional from and to ISO 8601 timestamp arguments.
  • Enforced strict validation: rejected malformed ISO timestamps with INVALID_INPUT.
  • Enforced from <= to ordering (rejects inverted timestamps).
  • Capped window output against MAX_HISTORY_POINTS (10,000 buckets) matching the REST safety boundary.
  • Documented two-ended range inclusivity ([from, to]) in GraphQL schema SDL.

2. Oracle Comparison Query (closes #369)

  • Exposed oracle(asset: String!, network: String): OracleComparison.
  • Implemented OracleStatus enum (AVAILABLE, UNREACHABLE, EMPTY, NOT_CONFIGURED) explicitly distinguishing between an unreachable source (network/adapter error) and an empty source (reporting null).
  • Added per-source metadata including ageSeconds, value, and deviationPct.
  • Shared underlying calculation with src/routes/oracle.ts.

3. Volumes & Spreads Queries with REST Parity (closes #368)

  • Exposed volumes(asset: String!, window: String, network: String): VolumeReport and spreads(asset: String!, window: String, network: String): SpreadReport.
  • Returned venue breakdowns as typed lists ([VenueVolume!] and [VenueQuote!]) allowing selective GraphQL field extraction.
  • Fully network-aware, supporting testnet and mainnet scoping.
  • Refactored core queries into shared helpers with 1:1 REST parity.

4. Market Screener Query with Filter Inputs & Pagination (closes #367)

  • Exposed screener(filter: ScreenerFilterInput, sort: ScreenerSortInput, pagination: ScreenerPaginationInput, network: String): ScreenerResult.
  • Structured filters via typed inputs (volume, change24hMin, priceMin, liquidity, etc.).
  • Reused cursor-based pagination and sorting logic from src/routes/screener.ts.
  • Explicitly rejected market_cap sorting/filtering with the exact constant explanation used by REST: market_cap is not supported: Lens has no circulating supply data to compute it from. Use liquidity instead.

Verification

  • Comprehensive Vitest suite in src/__tests__/graphqlExtendedQueries.test.ts verifying:
    • Bounded history range, invalid date handling, and over-large range rejection.
    • Oracle comparison with unreachable vs empty source differentiation.
    • Volumes and spreads parity against live REST route responses.
    • Screener filtering, sorting, cursor pagination, and market_cap rejection.
  • All existing REST and GraphQL test suites pass with zero regressions (74 tests passing).
  • TypeScript compiler passes cleanly with zero errors (npx tsc --noEmit).

…s, spreads, and screener (Divinity-Labs#367, Divinity-Labs#368, Divinity-Labs#369, Divinity-Labs#370)

- Add from/to ISO timestamp boundaries, range validation, and inclusivity docs to getPriceHistory (closes Divinity-Labs#370)
- Add oracle comparison query with typed OracleStatus enum, age, and unreachable vs empty distinction (closes Divinity-Labs#369)
- Add volumes and spreads queries with typed VenueVolume and VenueQuote lists matching REST (closes Divinity-Labs#368)
- Add screener query with filter inputs, cursor pagination, and explicit market_cap rejection (closes Divinity-Labs#367)
- Add comprehensive Vitest suite covering bounds, REST parity, error handling, and enum resolution

@Miracle656 Miracle656 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Changes requested: one issue per PR, and only issues assigned to you

This is a process requirement, applied to all 23 of your open PRs in this repo. It is not a judgement about the code, which I have not been able to review — and that is the first half of the problem.

The bundling

Across your open PRs, 150 distinct issues are claimed. This one claims several. #483 claims 22, #481 claims 20, #477 claims 20, #474 claims 20.

A PR that closes twenty issues cannot be reviewed. Each of those issues has its own acceptance criteria — typically five — so twenty issues is a hundred separate things to verify in one diff, and if any one of them is wrong the whole PR is blocked while it is fixed. Every batch I published says the issues are deliberately independent so they can be worked in parallel, by different people, without colliding. Bundling them removes exactly that property.

The assignments

135 of the 150 issues claimed are assigned to other contributors — 67 different people.

This PR is an example: it names issues currently assigned to other contributors who are working on them now. Several have open PRs of their own. If this merged as it stands, those people would have done the work and received nothing for it, and I would have no way to tell the two efforts apart.

I am not assuming anything about why. Assignments change, Drips and GitHub can disagree, and a wide-ranging branch picks up issue numbers easily. But the effect on the people holding those assignments is the same regardless of intent, which is why I have to act on it.

What I need

  • One issue per PR. The issue number in the title, its acceptance criteria met, and nothing else in the diff.
  • Only issues assigned to you, or unassigned ones you have claimed through Drips. If an issue is assigned to someone else, it is theirs.
  • Re-open the work that meets both conditions as individual PRs. I will review them in the order they arrive and at the same pace as everyone else's.

Nothing is being closed. These stay open and are yours to re-cut, withdraw or split as you choose.

Two things worth knowing before you re-cut

Some of this has already landed. #488 (SSRF guard for bazaar_search) and #487 (the paid_call host allow-list) cover the same ground as your #449; #486 covers the MCP README. Check current main before rebuilding something that is already there.

main has moved a long way today — #306, #309, #252, #256, #355, #381, #390, #402, #476, #488 and more. Cut from current main, not from where these branches started.

If you believe an issue named here is genuinely yours, say which and I will check the assignment myself — I would rather be corrected than have someone lose work.

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.

There is no volumes or spreads query There is no screener query getPriceHistory cannot express a time range There is no oracle query

2 participants