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 omit_complexity config option for issue #2502 #2504

Merged

Conversation

mariuscraciunescu
Copy link
Contributor

@mariuscraciunescu mariuscraciunescu commented Jan 12, 2023

Full description in issue #2502

Introduced a new config flag omit_complexity, which when set to true will skip the generation of the body of the following:

type ComplexityRoot struct {
  // empty struct
}
func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) {
  ec := executionContext{nil, e}
  _ = ec

  // switch statement is not generated

  return 0, false
}

Fixes the following compiler issue when GraphQL schema is too large:
<autogenerated>:1: internal compiler error: NewBulk too big: nbit=13244 count=1469951 nword=414 size=608559714

I have:

  • Added tests covering the bug / feature (see testing)
  • Updated any relevant documentation (see docs)

@coveralls
Copy link

coveralls commented Jan 12, 2023

Coverage Status

Coverage: 75.636%. Remained the same when pulling 3bd9dce on mariuscraciunescu:omit_complexity_option into f5764a8 on 99designs:master.

@StevenACoffman StevenACoffman merged commit 2bd7cfe into 99designs:master Jan 13, 2023
@StevenACoffman
Copy link
Collaborator

Thanks!

@mariuscraciunescu mariuscraciunescu deleted the omit_complexity_option branch January 16, 2023 08:55
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.

3 participants