Closed
Description
Hello,
I hope this is the right place to ask this question. I could not find anything on the internet that could provide me with an answer.
Is it possible to define schemas like following:
type UserQueries {
get(id: String! @NotEmpty): String
}
type UserMutations {
delete(id: String! @NotEmpty): String
}
extend type Mutation {
users: UserMutations
}
extend type Query {
users: UserQueries
}
When I attempt to do it like that. I can't make annotated controller model work.
@Controller
@SchemaMapping(field = "users")
public class UserController {
private final UserService userService;
public UserController(UserService userService) {
this.userService = userService;
}
@SchemaMapping(typeName = "UsersMutations", field = "delete")
String delete(@Argument String id) {
userService.delete(id);
return id;
}
}