MichalLytek / MichalLytek/typegraphql-prisma
Feature request: Support schema annotation to enable simpleResolvers for a single object type.
- Dominant language
- TypeScript
- Stars
- 918
- Forks
- 130
- PR merge metrics
- No merged PRs in 30d
Description
We are running into performance issues with one of our models and would like to set `simpleResolvers: true` for just that model. I don't want to enable it globally because we use middleware / authorization on other models.
I think something like the following would work?
```
/// @TypeGraphQL.simpleResolvers(true)
model User {
...
}
```
Alternatives we've considered:
- Applying a patch on the generated model file won't work for us, because our models are generated into `node_modules` and therefore not included in source control, so there's no easy way for us to maintain the patch. Moving generated files into source control opens up a can of worms for us
- That's all we've considered
Contributor guide
No contributing guide indexed for this repository
Research direction
No file, test, or entry point is named. Start by tracing how the generator reads model annotations and applies the global simpleResolvers setting; define done as enabling simpleResolvers for one model without changing middleware or authorization behavior on other models.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, typescript
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100