99designs / 99designs/gqlgen

omit_resolver_fields option does not respect `models.<model>.fields.<field>.resolver` option

Đang mở
#3,044 1 bình luận 0 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?

The `omit_resolver_fields` option that introduced by https://github.com/99designs/gqlgen/pull/2957 does not respect `models..fields..resolver` option, only schema directives are respected.

#### gqlgen.yml

```testdata/gqlgen_omit_resolver_fields_with_explicit_resolver.yml
# testdata/gqlgen_omit_resolver_fields_with_explicit_resolver.yml
schema:
- "schema_omit_resolver_fields_with_explicit_resolver.graphql"

exec:
filename: out_omit_resolver_fields/ignored.go
model:
filename: out_omit_resolver_fields/generated.go

omit_resolver_fields: true
models:
Base:
fields:
ResolverField:
resolver: true
```

#### schema.graphql

```testdata/schema_omit_resolver_fields_with_explicit_resolver.graphql
# testdata/schema_omit_resolver_fields_with_explicit_resolver.graphql
type Base {
StandardField: String!
ResolverField: String!
}
```

### What did you expect?

The `models..fields..resolver` option marks the field to be resolved with explit resolvers, so the `omit_resolver_fields` should respect also this option.

### Minimal graphql.schema and models to reproduce

```schema_omit_resolver_fields_with_explicit_resolver.graphql
type Base {
StandardField: String!
ResolverField: String!
}
```

### versions
- `go run github.com/99designs/gqlgen version`?
- `v0.17.45-dev`
- `go version`?
- `go version go1.22.0 linux/amd64`

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.