Skip to content

Update documentation with advice on how to achieve schema namespacing #863

Closed
@can-axelspringer

Description

@can-axelspringer

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;
    }

}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions