diff --git a/src/graphql/schema/Tick.gql b/src/graphql/schema/Tick.gql index 002323e..d52d9af 100644 --- a/src/graphql/schema/Tick.gql +++ b/src/graphql/schema/Tick.gql @@ -107,6 +107,9 @@ type TickType { """User public profile""" user: UserPublicProfile! + + """The climb associated with this tick. Null when the climb doesn't exist in our database.""" + climb: Climb } "The tick sources that openbeta supports." diff --git a/src/graphql/tick/TickResolvers.ts b/src/graphql/tick/TickResolvers.ts index 62242fb..b92bf9e 100644 --- a/src/graphql/tick/TickResolvers.ts +++ b/src/graphql/tick/TickResolvers.ts @@ -7,6 +7,11 @@ export const TickResolvers = { user: async (node: TickType, args: any, { dataSources }: GQLContext) => { const { users } = dataSources return await users.getUserPublicProfileByUuid(muuid.from(node.userId)) + }, + + climb: async (node: TickType, args: any, { dataSources }: GQLContext) => { + const { areas } = dataSources + return await areas.findOneClimbByUUID(muuid.from(node.climbId)) } } }