@soda-gql/runtime
v0.12.6
Published
Minimal runtime for soda-gql operations
Maintainers
Readme
@soda-gql/runtime
Runtime utilities for soda-gql zero-runtime GraphQL operations.
Installation
bun add @soda-gql/runtimeOverview
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
Usage
With Build-Time Transformation
When using soda-gql with a build plugin (Babel, TypeScript, Vite, etc.), the runtime is automatically integrated:
// Your source code
import { gql } from "@/graphql-system";
export const userQuery = gql.default(({ query }) =>
query("GetUser")`($id: ID!) {
user(id: $id) {
id
name
}
}`(),
);
// After transformation (automatically handled by build plugin)
import { gqlRuntime } from "@soda-gql/runtime";
export const userQuery = gqlRuntime.getOperation("GetUser");API Reference
gqlRuntime
The main runtime object for operation management:
import { gqlRuntime } from "@soda-gql/runtime";
// Get an operation by name
const operation = gqlRuntime.getOperation("GetUser");Zero-Runtime Philosophy
This package is designed to have minimal impact on bundle size:
- Operations are registered at build time
- No heavy dependencies
- Tree-shakeable exports
Related Packages
- @soda-gql/core - Core types and utilities
- @soda-gql/babel - Babel transformer and plugin
- @soda-gql/tsc - TypeScript transformer and plugin
License
MIT
