99designs / 99designs/gqlgen

Autobinded packages which contain interfaces that are in the scheme, are not implemented properly in the models

オープン
#2,574 コメント 0 件 リアクション 26 件 担当者 0 名 GitHub で見る
主要言語
Go
スター
10.8k
フォーク
1.3k
平均マージ
2日 36分
マージ済み PR(30日)
26

説明

### What happened?
When auto-binding packages that contain interfaces which are used in the schema, they are not implemented properly in the generated models of the Graphql types that implement them.

### What did you expect?
That the types which implement the interfaces have their getter methods implements properly in the generated models file.

**If I remove the auto-bind from the config, the interface is implemented properly.**(but then I have two appearances of it, one in the auto-binded package and one in the generated one)

### Minimal graphql.schema and models to reproduce
```gql
interface Node {
id: ID!
}

type MyType implements Node {
id: ID!
}

```

```yaml
...
autobind:
- github.com/my-custom-types/model
...
```

Only file "github.com/my-custom-types/model":
```go
package model

type Node interface {
IsNode()
GetID() string
}

```

Expected generated models:
```go
type MyType struct {
Id string
}

func (MyType) IsNode() {}
func (this MyType) GetID() string { return this.Id }
```

Actual generated models:
```go
type MyType struct {
Id string
}

func (MyType) IsNode() {}
```

### versions
- `go run github.com/99designs/gqlgen version`? v0.17.25
- `go version`? go1.19.5 linux/arm64

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。