refactor resolvers
This commit is contained in:
1 parent
4ae50ab3f2
commit
2449c642d2
21 files changed
+336
-325
No files matched your search
@@ -0,0 +1,47 @@
|
||||
# import Query.TeamConnection, Team from "../generated/prisma.graphql"
|
||||
|
||||
directive @isAuthenticated on QUERY | FIELD | MUTATION
|
||||
directive @hasRole(roles: [String]) on QUERY | FIELD | MUTATION
|
||||
directive @isOwner(type: String) on QUERY | MUTATION
|
||||
directive @isOwnerOrHasRole(type: String, roles: [String]) on QUERY | MUTATION
|
||||
|
||||
type Query {
|
||||
teams: TeamConnection
|
||||
teamDetails: [Team!]! @isAuthenticated
|
||||
teamByName(name: String!): Team
|
||||
teamById(teamId: String!): Team
|
||||
teamWithRole(teamId: String!, role: String!): Team
|
||||
teamsByOwner(ownerId: String!): [Team!]! @isAuthenticated
|
||||
teamsByRole: [Team!]! @isAuthenticated
|
||||
fbByTeamMember: Team @isAuthenticated
|
||||
owner: Member @isAuthenticated
|
||||
member: Member @isAuthenticated
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
authenticate(idToken: String!): Member
|
||||
verifyTeamInvite(token: String!): TeamMembers
|
||||
createTeam(name: String!, slug: String!, botName: String!, botSlug: String!): Team @isAuthenticated
|
||||
updateTeamProfile(slug: String!, description: String, motto: String, avatar: String, banner: String): Team @isAuthenticated
|
||||
updateFB(fbId: String!, avatar: String): FinancialBeings @isAuthenticated
|
||||
deleteTeam(slug: String!): Team @isAuthenticated @isOwner(type: "Team")
|
||||
sendMemberInviteSG(email: String!, teamId: String!): String
|
||||
confirmMember(token: String!): String
|
||||
removeTeamMember(teamId: String!, memberId: String!): String
|
||||
}
|
||||
|
||||
fragment MemberInfo on Member {
|
||||
id
|
||||
authId
|
||||
alias
|
||||
visible
|
||||
status {
|
||||
...MemberStatusInfo
|
||||
}
|
||||
}
|
||||
|
||||
fragment MemberStatusInfo on MemberStatus {
|
||||
status
|
||||
reason
|
||||
createdAt
|
||||
}
|
||||
Reference in new issue
Block a user