-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
What happened?
If I set a @goField(forceResolver: true) directive, it will be called anyway
What did you expect?
We need a mechanism to automatically determine whether to invoke a resolver, instead of manually parsing fields to determine whether to execute.
like this:
type Product {
productId: ID!
name: String!
extraFields: Any
}
type Project implements Node {
id: ID!
name: String!
products: [Product!] @goField(forceResolver: true, forceResolverIgnoredKeys: ["productId", "name"])
}
type Query {
project(id: ID!) Project!
}the query will not call the products resolver in Project
query {
project(id: "xxxxx") {
id
name
products {
productId # or name or both of them
}
}
}the query will call resolver
query {
project(id: "xxxxx") {
id
name
products {
productId
name
extraFields
}
}
}Minimal graphql.schema and models to reproduce
None
versions
go run github.com/99designs/gqlgen version?v0.17.61go version?go version go1.23.4 linux/amd64
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels