Closed pretender91 closed 1 year ago
After some research there are some theses:
Preferable scopes:
As I understand we can put scopes in several places:
I think we should put scopes as close as possible to root. Namespaces are preferable. Something like this:
enum Role {
GUEST
USER
ADMIN
}
type Viewer {
role: Role!
}
type Query {
viewer: Viewer!
guest: GuestQuery
user: UserQuery
admin: AdminQuery
}
type Mutation {
guest: GuestMutation
user: UserMutation
admin: AdminMutation
}
As a developer I want to invoke queries and mutations based on auth scope (guest, user, admin etc). Also I should have mutation to give auth token that grants me access to proper auth scope.