54 lines
2.0 KiB
GraphQL
54 lines
2.0 KiB
GraphQL
# import Query.TeamConnection, Query.FinancialBeingsConnection, Team, FinancialBeings from "../generated/prisma.graphql"
|
|
|
|
directive @isAuthenticated on QUERY | FIELD | MUTATION | FIELD_DEFINITION
|
|
directive @hasRole(roles: [String]) on QUERY | FIELD | MUTATION | FIELD_DEFINITION
|
|
directive @isOwner(type: String) on QUERY | MUTATION | FIELD_DEFINITION
|
|
directive @isOwnerOrHasRole(type: String, roles: [String]) on QUERY | MUTATION | FIELD_DEFINITION
|
|
|
|
type Query {
|
|
teams: TeamConnection
|
|
teamDetails: [Team!]! @isAuthenticated
|
|
teamByName(name: String!): Team
|
|
teamBySlug(slug: String!): Team
|
|
teamById(teamId: String!): Team
|
|
teamsByIds(teamIds: [ID!]): [Team]
|
|
teamWithRole(teamId: String!, role: String!): Team
|
|
teamAuthorization(teamId: String!, role: String): Team
|
|
teamsByOwner: [Team!]! @isAuthenticated
|
|
teamsByRole: [Team!]! @isAuthenticated
|
|
fbByTeamMember: Team @isAuthenticated
|
|
fbByOwner(fbId: String, fbSlug: String): FinancialBeingsConnection @isAuthenticated
|
|
fbByFbId(fbId: String!): FinancialBeings
|
|
fbByFbSlug(fbSlug: String!): FinancialBeings
|
|
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!, botSlug: 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
|
|
}
|