-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
unable to bind to interface when updating gqlgen #1424
Comments
Hey @miroslavLalev I just ran into this and figured I'd share a workaround. I run into this as I have 3 different "File" schemas that all implement at least the BaseFile interface.
I noticed it created a generated interface in my
I went ahead and slapped an empty method on my
|
@miroslavLalev we ran into the same issue. There's an open PR here by my colleague which fixes it for our codebase. |
Hey @jmhwang7, thanks for the heads up! Actually, we decided to look back at our schema and completely dropped the interface, which simplified stuff, and the issue was resolved out of the box. I will be looking at the PR and resolve this issue after it gets merged. |
What happened?
Hello, I've been dealing with update from older version (0.7.2) of gqlgen to the newest - 0.13.0. I am having trouble with code generation for our current schemas - it fails with
merging type systems failed: unable to bind to interface: ...
.Something goes wrong with a schema like this:
This is just a small segment of the whole schema, as it is rather big and spread across multiple files.
I am also providing external models for most of the types in gqlgen.yml file. The implementation looks around the lines of:
As you can see,
ChildrenConnection
implements theConnection
interface, and everything generates properly with versions less than 0.11.0. However, if I try generating with anything above that, I get the following error:I've tried to debug why the generator thinks that interfaces are not satisfied and it has something to do with the
PageInfo
method - for some reason it thinks that the signatures are not the same. More interestingly, if I remove that method (and the attribute from the schema), everything starts generating successfully again. I've tried to switch the return type to justPageInfo
, instead of*PageInfo
but that did not work as well.I've also checked that the following PR introduces checks for interfaces satisfaction, so I believe it is where my problems originate from.
What did you expect?
Properly generated go files.
Minimal graphql.schema and models to reproduce
Sadly, I could not reproduce the results when trying to create a new project with only the specified schema here. I would suspect that the remaining parts might also take part in the behaviour that I am describing, just don't know how - we have multiple implementers of the
Connection
interface.versions
gqlgen version
? 0.13.0go version
? 1.15.6The text was updated successfully, but these errors were encountered: