-
Notifications
You must be signed in to change notification settings - Fork 1
chore: migrate-to-envio-query #28
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
base: master
Are you sure you want to change the base?
Conversation
WalkthroughUpdated two GraphQL queries to a new schema: switched root fields to aliased types, changed boolean filters to use _eq, and replaced pagination parameter first with limit. Retrieved field selections and downstream processing remain unchanged. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/light-gtcr-withdrawal.ts (1)
12-16
: Add an explicit limit to avoid unbounded responsesParity with execution (limit: 1000) and defensive querying. Also normalize spacing around _eq.
Apply this diff:
- lcontributions: LContribution(where: { withdrawable: {_eq :true} }) { + lcontributions: LContribution(where: { withdrawable: { _eq: true } }, limit: 1000) {src/light-gtcr-execution.ts (1)
13-21
: Consider stable ordering and pagination follow-upIf the result set can exceed 1000, consider adding an explicit ordering (if supported by your schema) and a looped pagination strategy to avoid skipping or reprocessing items between runs.
If the API supports it, a typical pattern (adjust names per schema) is:
- lrequests: LRequest(where: { resolved: {_eq: false}, disputed: {_eq: false} }, limit: 1000) { + lrequests: LRequest( + where: { resolved: { _eq: false }, disputed: { _eq: false } } + order_by: { submissionTime: asc } # or desc, depending on processing + limit: 1000 + ) {Pair this with cursor/offset handling in subsequent calls to cover all pages.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
src/light-gtcr-execution.ts
(1 hunks)src/light-gtcr-withdrawal.ts
(1 hunks)
🔇 Additional comments (4)
src/light-gtcr-withdrawal.ts (2)
12-16
: Alias migration and _eq filter look correctThe alias keeps downstream access via parsed.data.lcontributions intact, and switching to withdrawable: {_eq: true} matches the new schema’s boolean filter style.
12-16
: Verify GraphQL root field casing
File:src/light-gtcr-withdrawal.ts
(lines 12–16)We attempted to validate the root fields against your subgraph endpoint, but
GTCR_SUBGRAPH_URL
was not set, so no checks could be performed. Please setGTCR_SUBGRAPH_URL
to your GTCR_SUBGRAPH_URL and either re-run the script below or manually introspect the schema to confirm that the root queriesLContribution
andLRequest
exist (with the correct casing) on your subgraph.
- To re-run the automated check, export your endpoint and execute:
export GTCR_SUBGRAPH_URL="https://your.subgraph.url" curl -sS "$GTCR_SUBGRAPH_URL" \ -H 'content-type: application/json' \ --data-binary @- <<'JSON' | jq '.errors // "no errors"' {"query":"{ lcontributions: LContribution(where: { withdrawable: { _eq: true } }, limit: 1) { id contributor } }"} JSON- For manual verification, run an introspection query (e.g., in GraphiQL):
and look for{ __schema { queryType { fields { name } } } }LContribution
(or its lowercase variant, if your server normalizes names) andLRequest
.src/light-gtcr-execution.ts (2)
13-21
: LGTM: alias + _eq filters + limitThe aliased root field lrequests maps cleanly to parsed.data.lrequests, and the switch to _eq filters with limit: 1000 aligns with the new query style.
13-21
: Double-check root field casing (LRequest) on the endpointEnsure LRequest is the correct root field for your GTCR_SUBGRAPH_URL; otherwise, switch to the server’s expected collection field name.
Use the validation script included in the withdrawal file comment to confirm the schema accepts this query without errors.
Summary by CodeRabbit