-
Notifications
You must be signed in to change notification settings - Fork 319
Closed as not planned
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply
Description
We are currently using our custom GraphQL library (https://github.com/agrpdev/graphql) which is very similar to spring-graphql
. We would like to switch to spring-graphql
for obvious reasons.
Our code depends heavily on aspects provided by custom annotations and their processing that is done on method call, therefore I am very please with PR #325 and looking forward to it.
The only missing part is support for fields with arguments on DTOs:
public class User {
// `spring-grapqhl` uses PropertyDataFetcher to fetch this field
public String getId() {
return id;
}
// this field is ignored by `spring-graphql`
@SchemaMapping(field = "permissions")
public List<Permission> getPermissions(final @Argument("authority") String authority) {
return this.permissions.stream().filter(p -> p.getAuthority().equals("authority")).toList();
}
}
@Controller
public class UserController {
@QueryMapping
public User getUser(@Argument("id") final String id) {
return userService.getUser(id);
}
}
I'd like spring-graphql
to call DTO method getPermissions
using same logic it uses to call controller methods.
Why?
- Better encapsulation of data in DTOs
- Less verbose Controllers
Metadata
Metadata
Assignees
Labels
status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply