feat(graphql): [Data Collection 4] Apply GraphQL policies - #5800
Draft
adinauer wants to merge 4 commits into
Draft
feat(graphql): [Data Collection 4] Apply GraphQL policies#5800adinauer wants to merge 4 commits into
adinauer wants to merge 4 commits into
Conversation
Control GraphQL documents and variables through the new Data Collection policies across GraphQL and Apollo integrations. Preserve sendDefaultPii and maxRequestBodySize behavior when Data Collection is absent. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
📲 Install BuildsAndroid
|
This was referenced Jul 21, 2026
Bring the queue option removal and preceding stack updates into this layer.
This was referenced Jul 22, 2026
lbloder
reviewed
Aug 10, 2026
| try { | ||
| it.writeTo(buffer) | ||
| data = buffer.readUtf8() | ||
| data = GraphqlUtils.filterRequestBody(buffer.readUtf8(), scopes.options) |
Collaborator
There was a problem hiding this comment.
GraphQL/Apollo also allow Http.Get for queries (https://graphql.org/learn/serving-over-http/#get-request-and-parameters) so we might need to filter that too, not just the request body.
lbloder
reviewed
Aug 10, 2026
|
|
||
| try (JsonObjectReader reader = new JsonObjectReader(new StringReader(body))) { | ||
| final @Nullable Object value = reader.nextObjectOrNull(); | ||
| if (!(value instanceof Map)) { |
Collaborator
There was a problem hiding this comment.
AFAIK we should also support lists to handle batched requests.
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Stack (Data Collection)
📜 Description
Apply Data Collection policies to GraphQL document and variable capture across GraphQL Java and Apollo 2, 3, and 4 integrations.
The integrations independently filter GraphQL documents and variables while retaining operation metadata. Legacy
sendDefaultPii, request-size, and integration-specific always-collect behavior remain unchanged when Data Collection is absent.💡 Motivation and Context
GraphQL documents and variables can contain customer data. The new namespace provides granular control without forcing integrations to interpret legacy options themselves.
Refs #5666
💚 How did you test it?
./gradlew spotlessApply apiDump./gradlew apiCheck📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Apply the remaining Data Collection categories to database and HTTP integration paths.
#skip-changelog