Anarchy.Toolkit.Web.GraphQL
2.0.1
dotnet add package Anarchy.Toolkit.Web.GraphQL --version 2.0.1
NuGet\Install-Package Anarchy.Toolkit.Web.GraphQL -Version 2.0.1
<PackageReference Include="Anarchy.Toolkit.Web.GraphQL" Version="2.0.1" />
<PackageVersion Include="Anarchy.Toolkit.Web.GraphQL" Version="2.0.1" />
<PackageReference Include="Anarchy.Toolkit.Web.GraphQL" />
paket add Anarchy.Toolkit.Web.GraphQL --version 2.0.1
#r "nuget: Anarchy.Toolkit.Web.GraphQL, 2.0.1"
#:package Anarchy.Toolkit.Web.GraphQL@2.0.1
#addin nuget:?package=Anarchy.Toolkit.Web.GraphQL&version=2.0.1
#tool nuget:?package=Anarchy.Toolkit.Web.GraphQL&version=2.0.1
Anarchy.Toolkit.Web.GraphQL
Part of Anarchy I/O Toolkit, a .NET developer platform · Pillar: Infrastructure · Layer: Web · Package catalog
GraphQL wiring for ASP.NET Core APIs built on the toolkit's web pipeline.
dotnet add package Anarchy.Toolkit.Web.GraphQL
- Define your schema using
SchemaBaseand register it withAddToolkitGraphQl<TSchema>(graphTypesAssembly). Register root graph types separately. - Add the endpoint and GraphiQL playground middleware with
UseToolkitGraphQl<TSchema>(authorizationPolicy). GraphQlRoutesprovides route conventions; the GraphQL endpoint requires the supplied authorization policy.
When to use it
Add this package when an ASP.NET Core application needs a GraphQL endpoint alongside, or instead of, REST routes. It wires graphql-dotnet into the host; your application supplies its schema, query and mutation types, resolvers and authorization policy.
How to use it
- Define a schema (optionally deriving from
SchemaBase) and set its query and any mutation or subscription roots. Register root graph types and their application services in DI. - Register the schema and discover graph types from the appropriate assembly. Add the middleware with the name of an authorization policy already configured by the host:
using Anarchy.Toolkit.Web.GraphQL.Extension.DependencyInjection;
using Anarchy.Toolkit.Web.GraphQL.Extension.Service.Builder;
services.AddToolkitGraphQl<MySchema>(typeof(MySchema).Assembly);
// In the configured ASP.NET Core pipeline:
app.UseToolkitGraphQl<MySchema>("MyGraphQlPolicy");
Replace MySchema and the policy name with your application types. Optional path arguments override the endpoint and GraphiQL routes. The GraphQL endpoint requires the supplied policy; evaluate whether the separately served GraphiQL UI should be exposed in each environment.
See the endpoint guide and toolkit overview.
Releases
See the release notes for the complete release history.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- Anarchy.Toolkit.Core (>= 2.0.1)
- GraphQL (>= 8.8.5)
- GraphQL.Server.Transports.AspNetCore (>= 8.3.3)
- GraphQL.Server.Ui.GraphiQL (>= 8.3.3)
- Humanizer (>= 3.0.10)
- Newtonsoft.Json (>= 13.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
## Releases
### 2.0.1
- chore(build): Format package release notes property
### 2.0.0
- feat(automation): establish onboarding and layering conventions
- feat(telemetry)!: introduce provider-neutral application telemetry
- refactor(packages)!: restructure persistence and automation packages
- refactor(core)!: reshape telemetry, event and health contracts
- refactor(telemetry)!: remove legacy APIs and simplify namespaces
### 1.1.2
- build(deps): drop package references already resolved transitively
### 1.1.1
- docs(packages): identify each package's pillar and layer
- build(packages): attribute the copyright to Leandro Melão Medeiros
- build: relicense under Apache-2.0 and update the package metadata
### 1.1.0
- build(deps): upgrade Swashbuckle.AspNetCore to 11.0.1 and Microsoft.OpenApi to 3.11.1
### 1.0.6
- docs: expand XML docblocks across all projects for the DocFX API reference
### 1.0.5
- refactor(src): clean up code style across library packages
### 1.0.3
- build: migrate local automation to build tooling
### 1.0.2
- docs: expand package guides and release histories
### 1.0.1
- Added a package-specific NuGet README.
### 1.0.0
- Introduced a GraphQL schema base, route definitions and extensions for exposing GraphQL endpoints.