Object directive on root Mutation type doesn't have any effect
- Dominant language
- Go
- Stars
- 10.8k
- Forks
- 1.3k
- Avg merge
- 2d 36m
- Merged PRs (30d)
- 26
Description
### What happened?
Placing a `OBJECT` directive on the root `Mutation` type doesn't get run
### What did you expect?
The directive should get run for the root nodes
### Minimal graphql.schema and models to reproduce
```gql
type Mutation @cacheControl(maxAge: 0) {
dummy: Boolean
}
directive @cacheControl(
maxAge: Int
) on OBJECT
```
### versions
- `gqlgen version`?
v0.13.0
- `go version`?
1.13
- dep or go modules?
Contributor guide
Research direction
The issue is about OBJECT directives not being applied to the root Mutation type in gqlgen. Start by examining the code generation and directive execution logic, likely in the codegen and execution packages. Look for where directives are processed for object types, and see if root types are handled differently. Run the provided minimal schema to reproduce the issue, and check test files related to directives and root types to understand the expected behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, graphql
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100