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

regression with interface model #920

Closed
MichaelMure opened this issue Nov 3, 2019 · 2 comments · Fixed by #1009
Closed

regression with interface model #920

MichaelMure opened this issue Nov 3, 2019 · 2 comments · Fixed by #1009
Labels

Comments

@MichaelMure
Copy link
Contributor

What happened?

I upgraded gqlgen from 0.9.2 to 0.10.1 (git-bug/git-bug#221) and now the generated code doesn't compile.

What did you expect?

A working codebase after the upgrade because gqlgen is a high quality package. It was pretty close though :)

I get errors like:

graphql/graph/gen_graph.go:14196:21: cannot use v (type identity.Interface) as type *identity.Interface in argument to ec._Identity:
    *identity.Interface is pointer to interface, not interface
graphql/graph/gen_graph.go:15164:21: cannot use v (type identity.Interface) as type *identity.Interface in argument to ec._Identity:
    *identity.Interface is pointer to interface, not interface

identity.Interface is obviously an interface.

The generated code leading to the error is:

func (ec *executionContext) marshalNIdentity2githubᚗcomᚋMichaelMureᚋgitᚑbugᚋidentityᚐInterface(ctx context.Context, sel ast.SelectionSet, v identity.Interface) graphql.Marshaler {
	if v == nil {
		if !ec.HasError(graphql.GetResolverContext(ctx)) {
			ec.Errorf(ctx, "must not be null")
		}
		return graphql.Null
	}
	return ec._Identity(ctx, sel, v)
}

Minimal graphql.schema and models to reproduce

You can have a look on my full project. The directive to generate is at https://github.com/MichaelMure/git-bug/blob/master/graphql/handler.go#L1

Let me know if you need something more minimal.

@stale
Copy link

stale bot commented Jan 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 2, 2020
@stale stale bot closed this as completed Jan 9, 2020
@MichaelMure
Copy link
Contributor Author

Hi, I just checked, this is still a problem with both v0.10.2 and master.

@lwc lwc reopened this Jan 9, 2020
@stale stale bot removed the stale label Jan 9, 2020
@vektah vektah mentioned this issue Feb 5, 2020
2 tasks
@vektah vektah added the v0.11 label Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants