-
Notifications
You must be signed in to change notification settings - Fork 164
Add support for persisted GraphQL Queries #3992
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: main
Are you sure you want to change the base?
Conversation
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (graphqlBody && graphqlBody.extensions?.persistedQuery) { | ||
| return { | ||
| operationName: graphqlBody.operationName, | ||
| variables: graphqlBody.variables ? JSON.stringify(graphqlBody.variables) : undefined, | ||
| } |
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.
Restore operationType when persisted queries include a query
The new persisted-query branch returns early whenever extensions.persistedQuery is present, so requests that include both a persisted-query extension and a query string (e.g., the initial Apollo APQ round trip that sends hash and the full query) now skip the later query parsing and emit metadata without operationType or payload. Before this change these same requests produced full GraphQL metadata; after it, GraphQL resource events for those persisted queries lose operation type and payload information. Consider checking for extensions.persistedQuery only when no query is provided so requests that already contain a query keep their operation details.
Useful? React with 👍 / 👎.
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: 02e0cd8 | Docs | Datadog PR Page | Was this helpful? Give us feedback! |
Motivation
Our GraphQL server makes use of persisted queries for operations which means the query and operationType are not known when making calls to GQL which prevents us from being able to use the built in GQL tracking for enriching our resource events
example:
Changes
Test instructions
Checklist