You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When GraphQL schema is really large (~60.000+ lines), the code generated with gqlgen fails to compile with the following error:
<autogenerated>:1: internal compiler error: NewBulk too big: nbit=13244 count=1469951 nword=414 size=608559714
More details about this compiler issue can be found here: golang/go#48375, golang/go#33437
This compilation error is caused by: type ComplexityRoot struct { ... } func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { ... }
What did you expect?
Code should compile successfully, regardless of the GraphQL schema size.
versions
v0.17.22
Proposed solution
Introduce a new config flag omit_complexity, which when set to true will skip the generation of the body of these constructs.
The resulting generated code will be:
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
}
This proposal is backwards compatible, won't introduce any breaking changes.
The text was updated successfully, but these errors were encountered:
* Add omit_complexity config option to skip generation of ComplexityRoot struct content and Complexity function
* fix lint error
Co-authored-by: Marius Craciunescu <marius.craciunescu@crowdstrike.com>
What happened?
When GraphQL schema is really large (~60.000+ lines), the code generated with gqlgen fails to compile with the following error:
<autogenerated>:1: internal compiler error: NewBulk too big: nbit=13244 count=1469951 nword=414 size=608559714
More details about this compiler issue can be found here: golang/go#48375, golang/go#33437
This compilation error is caused by:
type ComplexityRoot struct { ... }
func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { ... }
What did you expect?
Code should compile successfully, regardless of the GraphQL schema size.
versions
Proposed solution
Introduce a new config flag
omit_complexity
, which when set totrue
will skip the generation of the body of these constructs.The resulting generated code will be:
This proposal is backwards compatible, won't introduce any breaking changes.
The text was updated successfully, but these errors were encountered: