Skip to content

Commit

Permalink
fix(gql): remove unused but required fields in climbs
Browse files Browse the repository at this point in the history
  • Loading branch information
Silthus committed Feb 15, 2024
1 parent aeb6e49 commit 44015e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/graphql/resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const resolvers = {
})
},

ancestors: (node: ClimbGQLQueryType) => node.ancestors.split(','),
ancestors: (node: ClimbGQLQueryType) => node.ancestors?.split(',') ?? [],

media: async (node: ClimbType, args: any, { dataSources }: Context) => {
const { media } = dataSources
Expand Down Expand Up @@ -220,7 +220,7 @@ const resolvers = {
return node.aggregate
},

ancestors: async (parent) => parent.ancestors.split(','),
ancestors: async (parent) => parent.ancestors?.split(',') ?? [],

climbs: async (node: AreaType, _, { dataSources: { areas } }: Context) => {
if ((node?.climbs?.length ?? 0) === 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/schema/Area.gql
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Area {
content: AreaContent

"pathTokens hashed into a single string"
pathHash: String!
pathHash: String

"""
Grade systems have minor variations between countries.
Expand Down
6 changes: 3 additions & 3 deletions src/graphql/schema/Climb.gql
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ type Climb {
content: Content!

"""
Area names traversing up the heirarchy from this climbs immediate
Area names traversing up the hierarchy from this climbs immediate
parent to the root area.
"""
pathTokens: [String!]!
pathTokens: [String!]

"""
Area UUIDs traversing up the heirarchy from this climbs immediate
parent to the root area.
"""
ancestors: [String!]!
ancestors: [String!]

"Media associated with this climb"
media: [MediaWithTags]
Expand Down

0 comments on commit 44015e5

Please sign in to comment.