Directive functions should be given the expected return type
- Langage dominant
- Go
- Étoiles
- 10.8k
- Forks
- 1.3k
- Merge moyen
- 2 j 36 min
- PR mergées (30 j)
- 26
Description
### What happened?
Directives are allowed on all fields, and their corresponding directive functions are called with the parent object and all directive arguments, but the expected return type is not available. Without that, the returned type must either be consistent for all directives, which is not practical for objects modeled by structs, or implied by the directive arguments, which is redundant.
The problem becomes even worse because the way gqlgen represents value optionality is by using a ref instead of a value.
### What did you expect?
I might reasonably expect a go reflected type value to be one of the arguments to the directive function.
### versions
- `gqlgen version`? `0.13.0`
- `go version`? `go version go1.17 darwin/amd64`
- dep or go modules? go modules
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.