openbeta-graphql icon indicating copy to clipboard operation
openbeta-graphql copied to clipboard

Resolve specific grade conversion at the GQL schema level

Open Vichy97 opened this issue 1 year ago • 3 comments

For consistency and ease of use, we should populate all grades using sandbag when adding a climb. For example if I add a climb with a YDS grade, the ewbank and french grades should be auto-populated. This would make implementing grade systems on mobile much easier, but also ensure that all clients are doing grade conversions consistently

Vichy97 avatar Nov 11 '24 16:11 Vichy97

So if I understand right the API should resolve the grade conversions for us?

CocoisBuggy avatar May 09 '25 06:05 CocoisBuggy

Ya there is a js library (sandbag) for doing grade conversions. I think it makes sense to actually only store one grade but do the conversion on fetching

Vichy97 avatar May 12 '25 14:05 Vichy97

Seems sensible to me, I'm going to edit the issue title a little bit to reflect that. The trick here will be to only do conversion work on the requested grade types - but I think mostly people will try and resolve all of the grades at the same time so a little bit of an overhead test will need to happen to make sure it's sane.

This may not be a low complexity issue, though. Our grade types are not super well described - for example i have been guilty of inferring grade context by checking which of the returned values are not-null. so I suspect it's a v2 issue

CocoisBuggy avatar May 13 '25 16:05 CocoisBuggy