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

upgrade gqlparser to 2.5.0 #5065

Closed
vikstrous2 opened this issue Aug 29, 2022 · 2 comments · Fixed by #5067
Closed

upgrade gqlparser to 2.5.0 #5065

vikstrous2 opened this issue Aug 29, 2022 · 2 comments · Fixed by #5067

Comments

@vikstrous2
Copy link

What is the underlying problem you're trying to solve?

We are using gqlgen and the latest version of gqlgen requires gqlparser 2.5.0. Unfortunately, we also import this repo and this repo expects gqlparser v2.4.6. We can't upgrade our version of gqlgen until github.com/open-policy-agent/opa also upgrades gqlparser.

Describe the ideal solution

Remove the dependency on gqlparser? No dependency = no problem :) There might be others relying on other versions of gqlgen. It might be good to not bundle this dependency and keep the dependencies of this go module as minimal as possible.

Describe a "Good Enough" solution

Upgrade to the latest version of gqlparser and fix the incompatible changes. The only thing to fix might be error formatting.

Additional Context

This is gqlgen https://gqlgen.com/

@philipaconrad
Copy link
Contributor

philipaconrad commented Aug 29, 2022

Hello @vikstrous2, thanks for filing an issue. I am aware of gqlgen, as it is one of the major downstream users of the gqlparser library.

Removing gqlparser out of our vendored dependencies list entirely would be great, except that it provides critical data structures and logic for OPA's GraphQL builtin functions. 🙁

We cannot rip it out for the time being, but we should be upgrading to version 2.5.0 soon. We may soon be internalizing the library, which would fix your build issues directly.

@vikstrous2
Copy link
Author

Ok! Thanks for the quick response. This works for us.

philipaconrad added a commit to philipaconrad/opa that referenced this issue Aug 30, 2022
This commit addresses issues around vendoring the 3rd party 3rd party
GraphQL parser library, `vektah/gqlparser`, which is used by our GraphQL
builtins.

By directly depending on the library, we accidentally forced all of our
library users to have to match gqlparser versions, which could cause
problems if they wanted to use downstream GraphQL libraries.

To fix this version clash problem, this PR internalizes vektah/gqlparser
v2.4.8 into the internal/gqlparser package (we can update to v2.5.0
later). Scripts are included to automate some of the internalizing
process if we wish to update the library in the future.

Fixes: open-policy-agent#5065

Signed-off-by: Philip Conrad <[email protected]>
philipaconrad added a commit that referenced this issue Aug 30, 2022
This commit addresses issues around vendoring the 3rd party GraphQL
parser library, `vektah/gqlparser`, which is used by our GraphQL builtins.

By directly depending on the library, we accidentally forced all of our
library users to have to match `gqlparser` versions, which could cause
problems if they wanted to use downstream GraphQL libraries.

To fix this version clash problem, this PR internalizes `vektah/gqlparser`
v2.4.8 into the `internal/gqlparser` package (we can update to v2.5.0
later). Scripts are included to automate some of the internalizing
process if we wish to update the library in the future.

Fixes: #5065

Signed-off-by: Philip Conrad <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants