@graphox/cli
v1.2.0
Published
Graphox CLI - High-performance GraphQL toolset
Maintainers
Readme
@graphox/cli
NPM package for installing the Graphox CLI - a high-performance GraphQL toolset for TypeScript monorepos.
Installation
pnpm add @graphox/cli
# or
npm install @graphox/cli
# or
yarn add @graphox/cliUsage
Once installed, you can use the Graphox command:
# Start the Language Server
pnpm graphox lsp
# Validate GraphQL files
pnpm graphox check
pnpm graphox check apps/web # Report only files under a directory
# Generate TypeScript types
pnpm graphox codegen
pnpm graphox codegen --clean
pnpm graphox codegen --watch
pnpm graphox codegen packages/schema # Only the projects and schema_types under a directory
# Run performance benchmarks
pnpm graphox benchmarkGlobal Installation
pnpm add -g @graphox/cli
# Now you can use it directly
graphox lsp
graphox check
graphox codegenSupported Platforms
This package automatically downloads the correct binary for your platform:
- macOS: x86_64 (Intel) and ARM64 (Apple Silicon)
- Linux: x86_64 and ARM64
- Windows: x86_64 and ARM64
Features
- Language Server (LSP): Real-time GraphQL validation, autocomplete, go-to-definition, hover docs, and more
- Type Generation: TypeScript type generation from GraphQL operations
- Validation: Granular diagnostics for GraphQL schemas and operations
- Fragment Tracking: Automatic fragment dependency resolution across packages
Configuration
Create a graphox.yaml file in your project root. See the main documentation for details.
Editor Support
To get validation and autocomplete in your editor, add the following line at the top of your graphox.yaml file:
# yaml-language-server: $schema=node_modules/@graphox/cli/graphox.schema.jsonOr, if you use VS Code with the YAML extension, you can add the following to your workspace settings:
{
"yaml.schemas": {
"node_modules/@graphox/cli/graphox.schema.json": "graphox.yaml"
}
}Manual Binary Download
If automatic installation fails, you can manually download binaries from the releases page.
Repository
https://github.com/soundtrackyourbrand/graphox
License
MIT — see LICENSE.
