At the moment, all my query resolvers are under a single Query class and a single Query schema / type as such:
schema {
query: Query #I'd prefer UserQueries and OrganisationQueries
mutation: UserMutations
mutation: OrganisationMutations
}
type Query {
fetchUser(email: String): User
listOrganisations(max: Int): [GenericListing]
}
...
And all my queries in one class:
@Component
public class Query implements GraphQLQueryResolver {
public List<GenericListing> listOrganisations (Integer max) {
...
}
public User fetchUser (String email) {
...
}
}
I've managed to split up and logically separate my mutations by User and Organisation!
@Component
public class UserMutations implements GraphQLMutationResolver {
public User createUser(String firstname, String lastname, String email, String msisdn, String password) {
...
}
}
How do I logically separate my queries - or at least not have all my queries in the Query class.