Minimal runtime for soda-gql operations
npm install @soda-gql/runtime

Runtime utilities for soda-gql zero-runtime GraphQL operations.
``bash`
bun add @soda-gql/runtime
This package provides the minimal runtime needed to execute soda-gql GraphQL operations. It includes:
- Operation registry for storing compiled GraphQL documents
- Runtime utilities for operation retrieval
- Minimal footprint for production builds
When using soda-gql with a build plugin (Babel, TypeScript, Vite, etc.), the runtime is automatically integrated:
`typescript
// Your source code
import { gql } from "@/graphql-system";
export const userQuery = gql.default(({ query, $var }) =>
query.operation({
name: "GetUser",
variables: { ...$var("id").ID("!") },
fields: ({ f, $ }) => ({ ...f.user({ id: $.id })(({ f }) => ({ ...f.id(), ...f.name() })) }),
}),
);
// After transformation (automatically handled by build plugin)
import { gqlRuntime } from "@soda-gql/runtime";
export const userQuery = gqlRuntime.getOperation("canonicalId");
`
The main runtime object for operation management:
`typescript
import { gqlRuntime } from "@soda-gql/runtime";
// Get an operation by canonical ID
const operation = gqlRuntime.getOperation("path/to/file.ts::userQuery");
``
This package is designed to have minimal impact on bundle size:
- Operations are registered at build time
- No heavy dependencies
- Tree-shakeable exports
- @soda-gql/core - Core types and utilities
- @soda-gql/babel - Babel transformer and plugin
- @soda-gql/tsc - TypeScript transformer and plugin
MIT