Modernize read path to current Jobber schema; gate write commands (v1.1.0) - #1
Merged
Conversation
….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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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+deprecationReasonvia introspection gave the written field docs and migration guidance (e.g. "use theamountsfield instead"), which drove every change here.Read path (fixed + live-tested)
amounts { total, subtotal, paymentsTotal, invoiceBalance, ... }— removedtotalAmount/amountPaid/balanceinvoiceStatus/quoteStatus/jobStatus; list filters useInvoiceStatusTypeEnum/QuoteStatusTypeEnum/JobStatusTypeEnumEncodedId!for single-record lookups (wasID!)totalPriceundernodes { ... }; invoice→jobs, clienttags/phonesas connectionsphone(wasphoneNumber)invoices list --unpaidfilters client-side by outstanding balance (no validUNPAIDenum)Write path (gated)
clients create/update/delete,jobs create/update/complete,quotes create/send/approve,invoices create/sendnow exit with a clear "reworked — v1.2.0" message instead of cryptic GraphQL errors. Rationale: the current schema removedinvoiceSend/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
tests/api/test_queries_schema.pyguards against regressions to removed fieldsVerification
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,
--unpaidreturns only balance>0 invoices.🤖 Generated with Claude Code