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

Introspection query does not have stable sort order of fields and types #1426

Closed
frederikhors opened this issue Dec 18, 2020 · 5 comments
Closed

Comments

@frederikhors
Copy link
Collaborator

frederikhors commented Dec 18, 2020

What happened?

Introspection query does not have stable sort order of fields and types

versions

  • gqlgen version? 0.13.0
@pietdevries94
Copy link

We use the introspection to generate types on the frontend, but because the introspection is unstable, the generated code is also unstable, which creates false merge/rebase conflicts.

@frederikhors
Copy link
Collaborator Author

Same here. I fixed with custom script.

@nyergler
Copy link
Contributor

nyergler commented Feb 2, 2021

@frederikhors Any chance you can share said script? This makes the life with gqlgen pretty painful.

@duckbrain
Copy link
Contributor

@nyergler; here is a plugin we wrote that does it by wrapping each field with middleware and sorts the results if it's an introspection field.

https://pkg.go.dev/github.com/ec2-software/gqlgen-introspect-filter#SortPlugin

@nyergler
Copy link
Contributor

Thanks for the pointer, @duckbrain; I have a PR open to make the ordering stable, but a plugin may wind up being more straight-forward for tracking upstream.

@lwc lwc closed this as completed Sep 17, 2021
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

No branches or pull requests

5 participants