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

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

Open
aereal opened this issue May 6, 2024 · 1 comment

Comments

@aereal
Copy link

aereal commented May 6, 2024

What happened?

The omit_resolver_fields option that introduced by #2957 does not respect models.<model>.fields.<field>.resolver option, only schema directives are respected.

gqlgen.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
type Base {
    StandardField: String!
    ResolverField: String!
}

What did you expect?

The models.<model>.fields.<field>.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

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
@aereal
Copy link
Author

aereal commented May 6, 2024

I have the intention to fix this bug: #3045.

If this issue treated as the simple bug, I'll open #3045.

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

1 participant