Add query teamBySlug #56
This commit is contained in:
1 parent
7fa1c21092
commit
ba87853988
2 files changed
+5
No files matched your search
@@ -19,6 +19,10 @@ export const teamByName = async (parent, { name }, ctx, info) => {
|
||||
return ctx.db.query.team({ where: { name: name } }, TEAMS_FRAGMENT)
|
||||
}
|
||||
|
||||
export const teamBySlug= async (parent, { slug }, ctx, info) => {
|
||||
return ctx.db.query.team({ where: { slug: slug } }, TEAMS_FRAGMENT)
|
||||
}
|
||||
|
||||
export const teamWithRole = async (parent, { teamId, role }, ctx, info) => {
|
||||
return ctx.db.query.teamsConnection({where: {AND: [{id: teamId},{members_some:{role: role}}]}, first:1}, info)
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ type Query {
|
||||
teams: TeamConnection
|
||||
teamDetails: [Team!]! @isAuthenticated
|
||||
teamByName(name: String!): Team
|
||||
teamBySlug(slug: String!): Team
|
||||
teamById(teamId: String!): Team
|
||||
teamWithRole(teamId: String!, role: String!): Team
|
||||
teamsByOwner: [Team!]! @isAuthenticated
|
||||
|
||||
Reference in new issue
Block a user