Repository navigation
feat(codegen): graphql spec kind — introspection to the api manifest, and a GraphQL fake - #635
Merged
Merged
Conversation
…phqlFake, syncGraphql An introspection result becomes the ApiModel: one operation per Query and Mutation field with a graphql binding (field, variables' GraphQL types, default selection), arguments as body flags and the variables as the request body, Relay connections paged as the existing cursor style, and *Delete/*Archive mutations as deletes. graphqlFake is the strict fake for tests; syncGraphql/readGraphql keep the snapshot with its hash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… stricter fake Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
leemour
added a commit
that referenced
this pull request
Nov 17, 2026
Dates the release as 0.115.0, carrying #635 (the `graphql` spec kind, Added → minor) and #634 (`auth` signs in an operation whose spec says `security: []`). Only package.json and the CHANGELOG change; `bin/release` publishes it after the merge. 🤖 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
L1 of the source-manifest plan (cli-private
plans/2026-11-16-cli-factory/source-manifest.md, section 6.2): thegraphqlspec kind the Linear pilot needs. The manifest shape is agreed with the L2 executor in that plan ("Поправка L1", accepted by L2).Why
Linear has no OpenAPI description, only a GraphQL schema. A WireCat CLI is built from its API manifest, so GraphQL must produce the same manifest the
apigroup,manifestCalland the source interpreters read.What
adaptGraphql(introspection, { url, scalars, exclude })→ApiModel: one operation perQuery/Mutationfield with a newgraphqlbinding (operation,field, each argument's GraphQL type invariables, a defaultselection: scalars and{ id }of objects one level deep, a connection'snodesandpageInfo). Arguments arein: "body"flags and the variables object is the request body; the answer isdata.<field>, typed by the field's type.*Delete/*Archive(not*Unarchive) → destructive, sopermissionsgives<group>.delete.cursorstyle (after/firstin the variables,pageInfo.endCursor,pageInfo.hasNextPage,nodes), not a newrelaystyle: cli-core'snextPageandcrmSourceFromManifestalready read it, and a new style would break cli-core's exhaustive switch on the bump.graphqlDocument(binding, selection?)builds the one document a call sends;parseSelectionreads a selection.graphqlFake: strict fake in the spirit offakeApi: only documentsgraphqlDocumentbuilt, selections checked against the types (a union takes only__typename), variables against their schema, answers within the selection,errors[]at HTTP 200.syncGraphql/readGraphql: the introspection snapshot with its provenance and hash. SDL is not read (needs graphql-js; codegen adds no runtime dependency).bindingLabelnames any binding. May break callers:Bindinghas a third member; code that readsbinding.nameonce a binding is nothttpmust narrow torpc(in cli-core:src/cli/bot/api.ts:45, fixed in L2's bump).Testing
src/codegen/graphql.test.tsover a hand-made, Linear-shaped introspection fixture (test/fixtures/graphql-tracker.ts): connections, an input object, an enum, a custom scalar, a union, wrapped types, a nullable answer, a defaulted non-null argument, Delete/Archive/Unarchive. No call to Linear.pnpm lint,tscwithtsconfig.jsonandtsconfig.test.json,vitest run src/codegen(141 tests),pnpm docs:check.🤖 Generated with Claude Code