Repository navigation
Description
Upstream dependencies
- [FEATURE] Execute GraphQL mutations with typed variables and payload errors stackql-labs/omnisdk#43
- [FEATURE] Add GitLab mutation mappings and a full-lifecycle regression stackql-registry/stackql-provider-gitlab#4
Keep this issue open until the relevant upstream changes are available, any required StackQL integration is complete, and the acceptance checks here pass. Upstream issue closure alone is not sufficient. Current execution work targets omnisdk. The legacy design is stackql/any-sdk#142; its successor is omnisdk #43.
Summary
Priority: HIGH
Effort: HIGH
Historical design reference: stackql/any-sdk#142. Active dependencies are listed above.
Once omnisdk #43 supplies GraphQL mutations (operationType: mutation, variables payloads, errorSelection), stackql should execute mutating SQL verbs against GraphQL-backed provider methods. The pinned omnisdk GraphQL document model does not expose operationType, typed variables or errorSelection; a complete SQL mutation route must be established against the new SDK contract. This keeps every GraphQL-backed provider (gitlab, newrelic, buildkite, and the planned runpod and railway) read-only by engine constraint.
Scope
- Verb routing: when a resolved method carries a GraphQL block with
operationType: mutation, route INSERT/UPDATE/DELETE/EXEC through omnisdk's one-shot GraphQL mutation executor rather than the REST HTTP payload path.sqlVerbswiring in provider docs works unchanged - the method$refmechanism is protocol-agnostic already. - Parameter binding: SQL-supplied values (INSERT column/value lists,
@-params on EXEC, WHERE-bound required params) feed the method's declared parameters, which omnisdk renders into thevariablespayload. Required-parameter validation and overloaded-verb signature resolution behave identically to REST methods. - Result semantics:
- success:
responseSelectionprojection returned as the statement result (INSERT/EXEC result rows where the payload selects an object), consistent with REST mutation result handling. - failure: an omnisdk
errorSelectionhit (or top-level GraphQLerrorson HTTP 200) surfaces as a statement error carrying the selected error content - never as an empty success and never as rows.
- success:
SHOW METHODS/DESCRIBE: mutation-backed methods present identically to REST-backed ones (no protocol leakage into the SQL surface).--http.log.enabled: mutation requests and raw responses use the current omnisdk HTTP observer and StackQL logging adapter, matching REST logging behaviour.
Reference implementation and acceptance
gitlab v2 is the canonical reference provider for this feature (strict Relay conventions: single input object argument, errors: [] payloads in HTTP 200, free full-lifecycle CI via the gitlab-ce container). Acceptance is demonstrated against it:
INSERT INTO gitlab.issues.issues ...executescreateIssuewith a variables payload and returns the created issue projection.- An update mutation (label or issue state) executes via
UPDATE/EXECper the provider's mapping. DELETEexecutes the corresponding destroy mutation.- A negative test: a mutation returning a populated
errorsarray in a 200 fails the statement with the error content surfaced. - A regression test: existing GraphQL SELECTs (gitlab list resources) are byte-identical in behaviour.
- Registry docs: the gitlab provider's
sqlVerbs.insert/update/deletepopulated for the piloted resources; no other provider docs change.
Downstream (not in this issue)
- Mutation generation rules in
@stackql/provider-utils(deriving mutation methods and variables skeletons from introspection - the gitlab generator grows amap_mutationsstage). - Provider builds unlocked by this feature: runpod (pod lifecycle), railway (deploys), newrelic NerdGraph and buildkite write phases.
Activity
[-][FEATURE] support GraphQL-backed INSERT/UPDATE/DELETE/EXEC via any-sdk GraphQL mutation support[/-][+][FEATURE] Support GraphQL-backed INSERT/UPDATE/DELETE/EXEC via omnisdk[/+]