Repository navigation
feat(cli): send a GraphQL operation through the api group and serviceApiCall - #3097
Merged
Merged
Conversation
leemour
added a commit
that referenced
this pull request
Nov 17, 2026
…s, echoed codes From the review of #3097: a write that errors[] does not show as undone is outcome_unknown; a GraphQL flag is the body and stays out of the run's files; the run log records the failure and names the endpoint query/issues; digits go as written, without 0x or 1e; a code is repeated only when it is a plain constant; a CLI's failure is asked first; a missing required variable is refused unsent in serviceApiCall too; the POST never follows a redirect; the credential check comes before the GraphQL branch; graphqlVariables lives in api-input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ApiCall L2 of the source-manifest plan, on cli-base 0.115.0's graphql binding. A call is one POST of the document graphqlDocument builds; the variables are --body with each flag over it, read by its schema, and the request schema sees them merged. errors[] fails even at HTTP 200, named by extensions.code, never by the message; the answer is data.<field>. --all pages by pageInfo through the existing cursor style. ApiCommandInput.selection lets a source ask for more than the generated selection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s, echoed codes From the review of #3097: a write that errors[] does not show as undone is outcome_unknown; a GraphQL flag is the body and stays out of the run's files; the run log records the failure and names the endpoint query/issues; digits go as written, without 0x or 1e; a code is repeated only when it is a plain constant; a CLI's failure is asked first; a missing required variable is refused unsent in serviceApiCall too; the POST never follows a redirect; the credential check comes before the GraphQL branch; graphqlVariables lives in api-input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
leemour
force-pushed
the
feat/graphql-executor
branch
from
November 17, 2026 22:12
e6566b5 to
e10ff12
Compare
This was referenced Nov 17, 2026
leemour
added a commit
that referenced
this pull request
Nov 17, 2026
….config, over GraphQL (#3099) ## Task L4 of the Linear pilot: a tracker CLI assembles from `wirecat.config.ts`, as a CRM does. This adds `trackerSourceFromManifest` over the tracker category (#3095) and the GraphQL executor (#3097). ## What - `src/tracker/manifest/`: `TrackerManifest`, `parseTrackerManifest`, `mapTrackerRecord`, `trackerSourceFromManifest`. - Each kind names a `list`, a `changes` call with `"{since}"` (the cursor less `overlapMs`), and an `ids` call; a `map` in the CRM rule language. - Over GraphQL a call sends its own `selection`; the parser refuses a map path the selection leaves out, so a field missing from the request is never read as "cleared". - A selected object answered `null` clears the field, converted by its type (`[]` for a list). - An `optional` kind refused (`errors[]` FORBIDDEN through the executor) is a gap; the other kinds still sync. - `syncTracker`: an id pass after a gap for its kind is held even under `--rescan`. - `wirecat.config`: `category: "tracker"` with its `source`, `spec.kind: "graphql"`. - CRM manifest: a `number` conversion; `crmRuleSchema` exported. ## Testing - `trackerSourceContract` over a Linear-shaped `graphqlFake` (pages by two, filters on `updatedAt.gte`, archived only on ask), every call through `serviceApiCall`. - Mapping tests (null under every rule kind), optional-kind tests, and refusal tests for the parser. - Local: typecheck (all configs), lint, `docs:check`, `src/tracker src/manifest src/crm/manifest src/cli/service-api` (130 tests). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Task
L2 of the source-manifest plan (Linear first). It builds on L1, cli-base #635 (0.115.0): the
graphqlbinding,graphqlDocumentandgraphqlFake. It follows the agreed contract, "Поправка L1" insource-manifest.mdsection 6.2.Why
A manifest generated from a GraphQL schema could not be sent. The
apigroup andserviceApiCallknew onlyhttpandrpcbindings, and cli-core did not build against cli-base 0.115.0 (src/cli/bot/api.ts:45readbinding.name).What
>=0.115.0 <1.0.0.graphqlDocument(binding, selection?).--bodyas one object, with each flag over it.true/false, JSON for an input object, a bare word for an enum.apigroup the merged variables go through the request schema before anything is sent.errors[]is a failure even at HTTP 200.extensions.code, using Apollo's names (UNAUTHENTICATED,FORBIDDEN,RATELIMITED,BAD_USER_INPUT…); any other code isprovider_error.data.<field>.--allpages bypageInfothrough the existingcursorstyle.withValuedrops a flag of the same name, so later pages ask for the next cursor.ApiCommandInput.selectiongives a source a deeper selection than the generated one. Theapigroup never sets it.api listand the run record name a GraphQL operation asquery issuesormutation issueCreate.Not done here
issue(id)is not checked yet. It is noted in the plan for L3/L4 (get → null).errors[]sent with HTTP 400 goes through the usual refusal path, and itsextensions.codeis lost.Review
A fresh review found SEC-1/2, BUG-1 to BUG-4, RISK-1 to RISK-3, DEBT-1/2 and NIT-1 to NIT-6. The second commit fixes these:
errors[]does not show it as undone isoutcome_unknown.query/issues.0x10and1e1are refused.serviceApiCalltoo.failureis asked first;rate_limitedis retryable.graphqlVariablesmoved toapi-input.ts.--body 5gives a clear error.api listshowsPOSTonly for GraphQL operations.Left as is:
nullgiven as a flag is sent as text. Use--bodyfor it.Testing
service-api-graphql.test.tsruns ongraphqlFakeover a manifest generated from a Linear-shaped fixture (copied from cli-base's test fixture). It checks:errors[]at HTTP 200;--allacross two pages;serviceApiCallwith a deeper selection;errors[]asvalidation_errororoutcome_unknown;mutation/issueCreate.🤖 Generated with Claude Code