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

gqlgen generates non compilable code when schema has Entity interfaces #2711

Open
victorkt opened this issue Jul 13, 2023 · 2 comments
Open

Comments

@victorkt
Copy link

victorkt commented Jul 13, 2023

What happened?

gqlgen generates non compilable code when schema has Entity interfaces.

I've noticed this after trying to upgrade gqlgen from v0.17.31 -> v0.17.34

What did you expect?

It should generate compilable code

Minimal graphql.schema and models to reproduce

interface User @key(fields: "id") {
  id: ID!
  name: String!
  email: String!
}

type Customer implements User @key(fields: "id") {
  id: ID!
  name: String!
  email: String!
}

extend type Query {
  me: User!
}

gqlgen is generating this model for the interface, but it doesn't implement the fedruntime.Entity interface.

type User interface {
	IsUser()
	GetID() string
	GetName() string
	GetEmail() string
}

versions

  • go run github.com/99designs/gqlgen version? v0.17.34
  • go version go1.20.5 darwin/arm64
@nullism
Copy link
Contributor

nullism commented Dec 7, 2023

Running into this as well.

@kjones-onx
Copy link
Contributor

I have a related PR up which should address this:
#2868

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

3 participants