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

Add maximum query length schema option #494

Merged
merged 2 commits into from
Jan 11, 2023

Conversation

pavelnikolov
Copy link
Member

Allow maximum query length schema option to prevent parsing too long queries.

@@ -122,6 +123,13 @@ func MaxParallelism(n int) SchemaOpt {
}
}

// MaxQueryLength specifies the maximum allowed query length in bytes. The default is 0 which disables max length checking.
func MaxQueryLength(n int) SchemaOpt {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: MaxQueryLengthBytes might be more readable to the user to avoid having to check what is the unit.

@agnivade
Copy link
Contributor

Hey @pavelnikolov - just checking on this one. Let's get this over the finish line?

@pavelnikolov pavelnikolov merged commit 5e16071 into master Jan 11, 2023
@pavelnikolov pavelnikolov deleted the add-max-query-length-restriction branch January 11, 2023 08:26
KNiepok pushed a commit to spacelift-io/graphql-go that referenced this pull request Feb 28, 2023
KNiepok pushed a commit to spacelift-io/graphql-go that referenced this pull request Feb 28, 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.

2 participants