Skip to content
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

fix: internal server error when query max depth setting is left empty #2853

Merged
merged 6 commits into from Jul 12, 2023

Conversation

jasonbahl
Copy link
Collaborator

What does this implement/fix? Explain your changes.

This fixes a bug that occurs when leaving the "Max Depth to allow for GraphQL Queries" value empty in the GraphQL > Settings page.

Does this close any currently open issues?

closes #2809

Any other comments?

If the value entered in the "Max Depth" setting is a non-positive integer, the default value of 10 will be saved. If a non-positive integer is already stored for the setting value, the default of 10 will be used.

- add sanitization callback to the query_depth_max setting, ensuring that the saved value is a positive integer, else default to 10
@jasonbahl jasonbahl self-assigned this Jul 12, 2023
@coveralls
Copy link

coveralls commented Jul 12, 2023

Coverage Status

coverage: 85.034% (-0.03%) from 85.064% when pulling 3785a16 on jasonbahl:fix/#2809-max-age-error into 85852e2 on wp-graphql:develop.

@jasonbahl jasonbahl changed the title Fix: internal server error when query max depth setting is left empty fix: internal server error when query max depth setting is left empty Jul 12, 2023
@codeclimate
Copy link

codeclimate bot commented Jul 12, 2023

Code Climate has analyzed commit 725df89 and detected 0 issues on this pull request.

View more on Code Climate.

@jasonbahl jasonbahl merged commit b06c682 into wp-graphql:develop Jul 12, 2023
29 of 31 checks passed
@jasonbahl jasonbahl mentioned this pull request Jul 12, 2023
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.

500 internal Server error if query-depth_max left empty
2 participants