vektah / gqlparser

A port of the parser from graphql-js into golang
MIT License
498 stars 123 forks source link

New maxTokenLimit default causing breaking change in large schemas #305

Closed golanglemonade closed 4 months ago

golanglemonade commented 4 months ago

What happened?

The change here is setting a maxTokenLimit to 15000 which is causing an issue with gqlgen, which uses this library. There does not appear to be a way to change the default when using this with gqlgen today.

The ParseQuery was set to a default of 0, which I've confirmed eliminates this breaking change on ParseSchema

What did you expect?

Ability to continue to generate our graphql resolvers using gqlgen, however, generation of this https://github.com/datumforge/datum/blob/main/internal/graphapi/generate/generate.go API now fails on this limit:

Minimal graphql.schema and models to reproduce

On the above mentioned repo:

task generate                                                      
task: [generate] go generate ./...
------> Generating code - running entc.go... <------
------> Generating code - running gqlgen... <------
failed to load schema: input: exceeded token limit of 15000

versions

StevenACoffman commented 4 months ago

Fixed in #306

Sorry

golanglemonade commented 4 months ago

Thank you! 🙏🏼