dotnet-ngql
2.0.1-preview.21
This is a prerelease version of dotnet-ngql.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet tool install --global dotnet-ngql --version 2.0.1-preview.21
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
dotnet tool install --local dotnet-ngql --version 2.0.1-preview.21
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dotnet-ngql&version=2.0.1-preview.21&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package dotnet-ngql --version 2.0.1-preview.21
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
dotnet-ngql
Command-line tool for NGql — compiles a C# QueryBuilder snippet against NGql.Core and prints the rendered GraphQL.
Install
dotnet tool install -g dotnet-ngql
Update
dotnet tool update -g dotnet-ngql
The tool's version tracks NGql.Core in lockstep — installing a specific NGql version is --version 2.1.0.
Use
Render from a file:
ngql my-snippet.cs
Render from stdin:
cat my-snippet.cs | ngql
# or
echo 'QueryBuilder.CreateDefaultBuilder("Hello").AddField("world.name")' | ngql
A snippet is an expression-bodied C# script. The final expression must yield the builder whose ToString() will be printed. The tool automatically imports:
using System;
using System.Collections.Generic;
using System.Linq;
using NGql.Core;
using NGql.Core.Builders;
so a complete snippet can be as small as:
QueryBuilder.CreateDefaultBuilder("Hello")
.AddField("world.name")
The output is plain GraphQL on stdout — composable with shell redirects:
ngql my-snippet.cs > out.graphql
Exit codes
| Code | Meaning |
|---|---|
| 0 | rendered successfully |
| 1 | snippet failed to compile or threw at runtime (error on stderr) |
| 64 | invalid usage |
| 66 | input file not found |
When to use this
- Hand verification that a
QueryBuildersnippet renders the GraphQL you expect. - Companion tool for the NGql Claude Code skill, which generates NGql code from natural language or pasted GraphQL.
- Quick rendering inside CI scripts or git hooks (e.g. snapshotting expected query text).
License
MIT, same as NGql itself.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.1.0 | 107 | 5/4/2026 |
| 2.1.0-preview.47 | 45 | 5/4/2026 |
| 2.1.0-preview.37 | 58 | 5/2/2026 |
| 2.1.0-preview.36 | 49 | 5/2/2026 |
| 2.0.1-preview.21 | 51 | 5/2/2026 |
| 2.0.1-preview.19 | 60 | 5/2/2026 |
See https://github.com/dolifer/NGql/blob/main/CHANGELOG.md for the full changelog.