Skip to content

feat(soilId): pull soilIdAlgorithmVersion on userSoilData sync (Section 6) - #1559

Merged
johannesparty merged 5 commits into
mainfrom
feat/soil-id-algorithm-version
Sep 25, 2026
Merged

johannesparty merged 5 commits into
mainfrom
feat/soil-id-algorithm-version

Conversation

@johannesparty

Copy link
Copy Markdown
Contributor

Section 6 — client-shared link. Threads the backend's soilIdAlgorithmVersion through the pull so the mobile client can detect a soil-ID algorithm change. Stacked on #1558.

What

  • Add soilId { soilIdAlgorithmVersion } to the userSoilData (pullUserData) query and thread it onto the returned object.
  • Bump the terraso-backend pin → the branch exposing the field (terraso-backend#2084). In-flight pin — re-pin to a release tag at merge.

Notes

  • GraphQL types are gitignored and regenerate on build — run npm install && npm run generate-types (the schema comes from node_modules/terraso-backend). package-lock.json reconciles on install.
  • Prettier clean; full typecheck runs after the codegen above.

🤖 Generated with Claude Code

Comment thread src/soilId/syncService.ts Outdated
@johannesparty
johannesparty force-pushed the feat/soil-id-elevation-query branch from 75d181d to 4d9daf4 Compare September 25, 2026 21:03
Base automatically changed from feat/soil-id-elevation-query to main September 25, 2026 21:05
johannesparty and others added 5 commits September 25, 2026 14:06
Adds soilId { soilIdAlgorithmVersion } to the pullUserData query and
threads it onto the returned object so the mobile client can detect a
soil-ID algorithm change and flush its cached matches. Bumps the
terraso-backend pin to the branch exposing the field. GraphQL types are
gitignored and regenerate on build (npm run generate-types).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ation/

Follows terraso-backend's parallel move of the GraphQL surface from
soilId.elevation to lookup.elevation. fetchElevation was never a
soil-ID concept — it just happened to live under that GraphQL
namespace on the backend. Now:

- src/elevation/elevationService.ts (new) — exports fetchElevation,
  wraps the new lookup.elevation query.
- src/soilId/soilIdService.ts — drops the fetchElevation export.
- Bump terraso-backend pin to 58667ca (the "move to lookup namespace"
  commit on the algorithm-version stack tip).

Import path change for consumers:
    terraso-client-shared/soilId/soilIdService  →
    terraso-client-shared/elevation/elevationService
Mobile client gets the corresponding import bump in its own PR.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The root soilId field is non-null, so the optional chain was dead; and
soilIdAlgorithmVersion is now non-null in the schema, so the `?? undefined`
normalization is no longer needed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Points at the backend commit that makes soilIdAlgorithmVersion non-null, so
codegen now generates `string` (not `string | null`) for the field, matching
the syncService cleanup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Converts the stacked in-flight backend commit pin to the released backend tag
2026-09-25.0 (commit f73b1cde), which carries the full soil-id schema
(soilId.elevation, soilIdExplanation, soilIdAlgorithmVersion, lookup namespace).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@johannesparty
johannesparty force-pushed the feat/soil-id-algorithm-version branch from 2317a14 to 412940c Compare September 25, 2026 21:09
@johannesparty
johannesparty merged commit 5d1ab75 into main Sep 25, 2026
5 checks passed
@johannesparty
johannesparty deleted the feat/soil-id-algorithm-version branch September 25, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants