99designs / 99designs/gqlgen

Is is possible to get field directives in mutation hook?

Đang mở
#1,342 7 bình luận 3 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
10.8k
Fork
1.3k
Merge trung bình
2 ngày 36 phút
Pull request đã merge (30 ngày)
26

Mô tả

### What happened?

According to https://gqlgen.com/recipes/modelgen-hook/ we can mutate generated models file.

### What did you expect?
I want to add some tags into struct fields depending on existing directives.

### Minimal graphql.schema and models to reproduce

```gql
directive @testDirective(value: Int!) on INPUT_FIELD_DEFINITION

input SomeInput {
someField: Int! @testDirective(value: 100)
}
```

Expected struct:

```go
type SomeInput struct {
SomeField int `json:"someField" test:"100"`
}
```

### versions
- `gqlgen version`? 0.12.2
- `go version`? 1.15
- dep or go modules? go.mod

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.