feat(strawberry): Gate GraphQL data collection behind data_collection option#6887
feat(strawberry): Gate GraphQL data collection behind data_collection option#6887ericapisani wants to merge 1 commit into
Conversation
… option Apply the data_collection option to the Strawberry integration so that graphql.document, request data, and variables are only collected when explicitly enabled. send_default_pii is used as a fallback only when data_collection is not configured. GraphQL operation names are now always captured when available, independent of document or PII settings.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a6055cd. Configure here.
| execution_context.operation_name | ||
| ) | ||
|
|
||
| request_data["data"] = execution_context_data |
There was a problem hiding this comment.
Empty request data written
Low Severity
When data_collection is enabled but document and variables are both off and there is no operationName, the event processor still assigns request.data to an empty dict. That adds empty request payload on events where nothing GraphQL-related was selected for collection.
Reviewed by Cursor Bugbot for commit a6055cd. Configure here.
Codecov Results 📊✅ 97734 passed | ⏭️ 6410 skipped | Total: 104144 | Pass Rate: 93.85% | Execution Time: 343m 16s 📊 Comparison with Base Branch
➖ Removed Tests (1)View removed tests
All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 2512 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 89.71% 89.71% —%
==========================================
Files 193 193 —
Lines 24392 24422 +30
Branches 8642 8672 +30
==========================================
+ Hits 21882 21910 +28
- Misses 2510 2512 +2
- Partials 1399 1402 +3Generated by Codecov Action |


Apply the
data_collectionoption to the Strawberry integration so thatgraphql.document, request data, and variables are only collected whenexplicitly enabled.
send_default_piiis used as a fallback only whendata_collectionis not configured.GraphQL operation names are now always captured when available,
independent of document or PII settings. Tests are updated to assert the
new behavior.
Refs PY-2585
Refs #6745