Skip to content

Modernize read path to current Jobber schema; gate write commands (v1.1.0) - #1

Merged
acaracappa merged 1 commit into
mainfrom
schema-refresh-v1.1.0
Jul 2, 2026
Merged

Modernize read path to current Jobber schema; gate write commands (v1.1.0)#1
acaracappa merged 1 commit into
mainfrom
schema-refresh-v1.1.0

Conversation

@acaracappa

Copy link
Copy Markdown
Owner

Summary

Refreshes getjobber-cli for Jobber's current GraphQL API. The read path was rebuilt against the live schema and verified end-to-end against a real account; the write path is temporarily gated pending a redesign.

How the schema was sourced: Jobber's doc site is Cloudflare-JS-gated (no automated read), and Jobber's own docs designate GraphQL introspection as the authoritative live schema. Pulling description + deprecationReason via introspection gave the written field docs and migration guidance (e.g. "use the amounts field instead"), which drove every change here.

Read path (fixed + live-tested)

  • Money read from amounts { total, subtotal, paymentsTotal, invoiceBalance, ... } — removed totalAmount / amountPaid / balance
  • Typed status enums invoiceStatus / quoteStatus / jobStatus; list filters use InvoiceStatusTypeEnum / QuoteStatusTypeEnum / JobStatusTypeEnum
  • EncodedId! for single-record lookups (was ID!)
  • Line items totalPrice under nodes { ... }; invoice→jobs, client tags / phones as connections
  • Client phone reads phone (was phoneNumber)
  • invoices list --unpaid filters client-side by outstanding balance (no valid UNPAID enum)

Write path (gated)

clients create/update/delete, jobs create/update/complete, quotes create/send/approve, invoices create/send now exit with a clear "reworked — v1.2.0" message instead of cryptic GraphQL errors. Rationale: the current schema removed invoiceSend / quoteSend / quoteApprove / jobComplete, and create mutations require nested inputs (dueDetails, tax, lineItems, propertyId) the commands don't collect. Full write redesign tracked for v1.2.0.

Tests

  • 196 pass (was 179); write-command tests converted to gating assertions
  • New tests/api/test_queries_schema.py guards against regressions to removed fields

Verification

Live smoke test on a real account: all list/get commands render correctly (real invoices, quotes, jobs, clients), write gating fires with exit 2 and no network call, --unpaid returns only balance>0 invoices.

🤖 Generated with Claude Code

….1.0)

Rebuilt api/queries.py against the live schema (verified via introspection +
deprecation guidance, then live-tested on a real account):
- money read from `amounts { ... }` (removed totalAmount/amountPaid/balance)
- typed status enums invoiceStatus/quoteStatus/jobStatus + enum list filters
- EncodedId! for single-record lookups; line items totalPrice under nodes;
  invoice->jobs, client tags/phones as connections; client phone (was phoneNumber)
- invoices --unpaid filters client-side by balance (no valid "UNPAID" enum)

Write commands (create/update/delete/send/approve/complete) are gated with a
clear message: the current schema removed invoiceSend/quoteSend/quoteApprove/
jobComplete and requires nested create inputs the commands don't collect.
Write redesign tracked for v1.2.0.

Tests: 196 pass; added schema-shape guard tests. Version bumped to 1.1.0.
@acaracappa
acaracappa merged commit 4481762 into main Jul 2, 2026
3 checks passed
@acaracappa
acaracappa deleted the schema-refresh-v1.1.0 branch July 2, 2026 01:36
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.

1 participant