99designs / 99designs/gqlgen

gqlgen generates non compilable code when schema has Entity interfaces

Open
#2,711 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
10.8k
Forks
1.3k
Avg merge
2d 36m
Merged PRs (30d)
26

Description

### What happened?

gqlgen generates non compilable code when schema has [Entity interfaces](https://www.apollographql.com/docs/federation/federated-types/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

```graphql
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.

```go
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`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.