Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: expose boltsCount and pitches in GraphQL mutation SingleClimbChangeInput #365

Merged
merged 4 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/db/ClimbTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface IPitch {
parentId: MUUID
pitchNumber: number
grades?: Partial<Record<GradeScalesTypes, string>>
type?: DisciplineType
disciplines?: DisciplineType
length?: number
boltsCount?: number
description?: string
Expand Down Expand Up @@ -169,8 +169,8 @@ export interface PitchChangeInputType {
id?: string
parentId?: string
pitchNumber?: number
disciplines?: DisciplineType
grades?: Partial<Record<GradeScalesTypes, string>>
type?: DisciplineType
length?: number
boltsCount?: number
description?: string
Expand All @@ -180,7 +180,7 @@ export interface ClimbChangeInputType {
id?: string
name?: string
disciplines?: DisciplineType
grade?: string // actual grade value (e.g. "7a", "5+")
grade?: string // single, atomic grade value (e.g. "7a", "5+")
leftRightIndex?: number
description?: string
location?: string
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/schema/Climb.gql
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,4 @@ type Pitch {
length: Int
boltsCount: Int
description: String
}
}
33 changes: 23 additions & 10 deletions src/graphql/schema/ClimbEdit.gql
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,45 @@ input SingleClimbChangeInput {
fa: String
"Length in meters"
length: Int
"Number of fixed anchors"
boltsCount: Int
"List of Pitch objects representing individual pitches of a multi-pitch climb"
pitches: [PitchInput]
experimentalAuthor: ExperimentalAuthorType
}

input GradeTypeInput {
vscale: String
yds: String
ewbank: String
french: String
brazilianCrux: String
font: String
uiaa: String
}

input PitchInput {
id: ID!
parentId: ID!
pitchNumber: Int!
grades: GradeTypeInput
disciplines: DisciplineType
}

input DisciplineType {
"https://en.wikipedia.org/wiki/Traditional_climbing"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed these comments to clean up code

trad: Boolean
"https://en.wikipedia.org/wiki/Sport_climbing"
sport: Boolean
"https://en.wikipedia.org/wiki/Bouldering"
bouldering: Boolean
"https://en.wikipedia.org/wiki/Deep-water_soloing"
deepwatersolo: Boolean
"https://en.wikipedia.org/wiki/Alpine_climbing"
alpine: Boolean
"https://en.wikipedia.org/wiki/Ice_climbing"
snow: Boolean
"https://en.wikipedia.org/wiki/Ice_climbing"
ice: Boolean
mixed: Boolean
"https://en.wikipedia.org/wiki/Aid_climbing"
aid: Boolean
"https://en.wikipedia.org/wiki/Top_rope_climbing"
tr: Boolean
}

input ExperimentalAuthorType {
displayName: String!
url: String!
}
}
8 changes: 4 additions & 4 deletions src/model/__tests__/MutableClimbDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ describe('Climb CRUD', () => {
{
pitchNumber: 1,
grades: { uiaa: '7' },
type: { sport: true },
disciplines: { sport: true },
length: 30,
boltsCount: 5,
description: 'First pitch description'
},
{
pitchNumber: 2,
grades: { uiaa: '6+' },
type: { sport: true },
disciplines: { sport: true },
length: 40,
boltsCount: 6,
description: 'Second pitch description'
Expand Down Expand Up @@ -653,7 +653,7 @@ describe('Climb CRUD', () => {
parentId: originalPitch1ParentID,
pitchNumber: 1,
grades: { ewbank: '19' },
type: { sport: false, alpine: true },
disciplines: { sport: false, alpine: true },
length: 20,
boltsCount: 6,
description: 'Updated first pitch description'
Expand All @@ -664,7 +664,7 @@ describe('Climb CRUD', () => {
parentId: originalPitch2ParentID,
pitchNumber: 2,
grades: { ewbank: '18' },
type: { sport: false, alpine: true },
disciplines: { sport: false, alpine: true },
length: 25,
boltsCount: 5,
description: 'Updated second pitch description'
Expand Down
Loading