spring-projects / spring-projects/spring-graphql
Support Spring Data projections as `@SchemaMapping` method return values
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.6k
- Forks
- 336
- PR merge metrics
- No merged PRs in 30d
Description
QueruydslDataFetcher and QueryByExampleDataFetcher already support use of projection interfaces to customize return values. The same is useful in controller methods too to allow loose coupling between schema types and domain entities, see for example discussion in #636.
An @ProjectAs annotation on the controller method could be used to specify the projection interface type to apply to the return value.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the projection support in QueruydslDataFetcher and QueryByExampleDataFetcher, then inspect how @SchemaMapping controller methods handle return values. Determine how an @ProjectAs annotation would select a projection interface for those returns; done means controller methods can apply Spring Data projections while keeping schema types decoupled from domain entities.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, java, spring
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100