Skip to content

ref(strawberry)!: Drop send_default_pii support in request data - #7869

Open
ericapisani wants to merge 2 commits into
major/3.0from
py-2843-strawberry-remove-send-default-pii
Open

ericapisani wants to merge 2 commits into
major/3.0from
py-2843-strawberry-remove-send-default-pii

Conversation

@ericapisani

Copy link
Copy Markdown
Member

The request event processor now reads only the data_collection options for the GraphQL document and variables, and no longer falls back to send_default_pii. It also no longer removes request.data when neither option is set, so a body attached by the web framework integration is left untouched (as the attaching of the body is controlled by the http_bodies property in the data_collection settings)

Fixes PY-2843
Fixes #7614

The request event processor now reads only the `data_collection` options
for the GraphQL document and variables, and no longer falls back to
`send_default_pii`. It also no longer removes `request.data` when
neither option is set, so a body attached by the web framework
integration is left untouched (as the attaching of the body is controlled by the `http_bodies` property in the `data_collection` settings)

Fixes PY-2843
Fixes #7614

else:
try:
del event["request"]["data"]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

whether this is added or not is now controlled by the data_collection.http_bodies flag within _wsgi_common, so this doesn't need to be here anymore.

@linear-code

linear-code Bot commented Oct 5, 2026

Copy link
Copy Markdown

PY-2843

assert error_event["exception"]["values"][0]["mechanism"]["type"] == "chained"
assert error_event["exception"]["values"][-1]["mechanism"]["type"] == "strawberry"
assert "data" not in error_event["request"]
assert error_event["request"]["data"] == {"operationName": "ErrorQuery"}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In the data collection world we now set operationName unconditionally

@ericapisani
ericapisani marked this pull request as ready for review October 5, 2026 15:38
@ericapisani
ericapisani requested a review from a team as a code owner October 5, 2026 15:38
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ 56580 passed | ⏭️ 2727 skipped | Total: 59307 | Pass Rate: 95.4% | Execution Time: 151m 38s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -78399
Passed Tests 📉 -74004
Failed Tests —
Skipped Tests 📉 -4395

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2072 uncovered lines.


Generated by Codecov Action

This branch has not been deployed

No deployments
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.

1 participant