Skip to content

Commit d649c6d

Browse files
authored
fix: expose boltsCount and pitches in GraphQL mutation SingleClimbChangeInput (#365)
* expose boltsCount and pitches in GraphQL mutation, harmonise naming of disciplines/type variable between Climb and Pitches
1 parent 5055dbe commit d649c6d

File tree

4 files changed

+31
-18
lines changed

4 files changed

+31
-18
lines changed

src/db/ClimbTypes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export interface IPitch {
3838
parentId: MUUID
3939
pitchNumber: number
4040
grades?: Partial<Record<GradeScalesTypes, string>>
41-
type?: DisciplineType
41+
disciplines?: DisciplineType
4242
length?: number
4343
boltsCount?: number
4444
description?: string
@@ -169,8 +169,8 @@ export interface PitchChangeInputType {
169169
id?: string
170170
parentId?: string
171171
pitchNumber?: number
172+
disciplines?: DisciplineType
172173
grades?: Partial<Record<GradeScalesTypes, string>>
173-
type?: DisciplineType
174174
length?: number
175175
boltsCount?: number
176176
description?: string
@@ -180,7 +180,7 @@ export interface ClimbChangeInputType {
180180
id?: string
181181
name?: string
182182
disciplines?: DisciplineType
183-
grade?: string // actual grade value (e.g. "7a", "5+")
183+
grade?: string // single, atomic grade value (e.g. "7a", "5+")
184184
leftRightIndex?: number
185185
description?: string
186186
location?: string

src/graphql/schema/Climb.gql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,4 @@ type Pitch {
205205
length: Int
206206
boltsCount: Int
207207
description: String
208-
}
208+
}

src/graphql/schema/ClimbEdit.gql

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,45 @@ input SingleClimbChangeInput {
4242
fa: String
4343
"Length in meters"
4444
length: Int
45+
"Number of fixed anchors"
46+
boltsCount: Int
47+
"List of Pitch objects representing individual pitches of a multi-pitch climb"
48+
pitches: [PitchInput]
4549
experimentalAuthor: ExperimentalAuthorType
4650
}
4751

52+
input GradeTypeInput {
53+
vscale: String
54+
yds: String
55+
ewbank: String
56+
french: String
57+
brazilianCrux: String
58+
font: String
59+
uiaa: String
60+
}
61+
62+
input PitchInput {
63+
id: ID!
64+
parentId: ID!
65+
pitchNumber: Int!
66+
grades: GradeTypeInput
67+
disciplines: DisciplineType
68+
}
69+
4870
input DisciplineType {
49-
"https://en.wikipedia.org/wiki/Traditional_climbing"
5071
trad: Boolean
51-
"https://en.wikipedia.org/wiki/Sport_climbing"
5272
sport: Boolean
53-
"https://en.wikipedia.org/wiki/Bouldering"
5473
bouldering: Boolean
55-
"https://en.wikipedia.org/wiki/Deep-water_soloing"
5674
deepwatersolo: Boolean
57-
"https://en.wikipedia.org/wiki/Alpine_climbing"
5875
alpine: Boolean
59-
"https://en.wikipedia.org/wiki/Ice_climbing"
6076
snow: Boolean
61-
"https://en.wikipedia.org/wiki/Ice_climbing"
6277
ice: Boolean
6378
mixed: Boolean
64-
"https://en.wikipedia.org/wiki/Aid_climbing"
6579
aid: Boolean
66-
"https://en.wikipedia.org/wiki/Top_rope_climbing"
6780
tr: Boolean
6881
}
6982

7083
input ExperimentalAuthorType {
7184
displayName: String!
7285
url: String!
73-
}
86+
}

src/model/__tests__/MutableClimbDataSource.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,15 @@ describe('Climb CRUD', () => {
123123
{
124124
pitchNumber: 1,
125125
grades: { uiaa: '7' },
126-
type: { sport: true },
126+
disciplines: { sport: true },
127127
length: 30,
128128
boltsCount: 5,
129129
description: 'First pitch description'
130130
},
131131
{
132132
pitchNumber: 2,
133133
grades: { uiaa: '6+' },
134-
type: { sport: true },
134+
disciplines: { sport: true },
135135
length: 40,
136136
boltsCount: 6,
137137
description: 'Second pitch description'
@@ -653,7 +653,7 @@ describe('Climb CRUD', () => {
653653
parentId: originalPitch1ParentID,
654654
pitchNumber: 1,
655655
grades: { ewbank: '19' },
656-
type: { sport: false, alpine: true },
656+
disciplines: { sport: false, alpine: true },
657657
length: 20,
658658
boltsCount: 6,
659659
description: 'Updated first pitch description'
@@ -664,7 +664,7 @@ describe('Climb CRUD', () => {
664664
parentId: originalPitch2ParentID,
665665
pitchNumber: 2,
666666
grades: { ewbank: '18' },
667-
type: { sport: false, alpine: true },
667+
disciplines: { sport: false, alpine: true },
668668
length: 25,
669669
boltsCount: 5,
670670
description: 'Updated second pitch description'

0 commit comments

Comments
 (0)