Anarchy.Toolkit.Web.GraphQL
1.0.4
See the version list below for details.
dotnet add package Anarchy.Toolkit.Web.GraphQL --version 1.0.4
NuGet\Install-Package Anarchy.Toolkit.Web.GraphQL -Version 1.0.4
<PackageReference Include="Anarchy.Toolkit.Web.GraphQL" Version="1.0.4" />
<PackageVersion Include="Anarchy.Toolkit.Web.GraphQL" Version="1.0.4" />
<PackageReference Include="Anarchy.Toolkit.Web.GraphQL" />
paket add Anarchy.Toolkit.Web.GraphQL --version 1.0.4
#r "nuget: Anarchy.Toolkit.Web.GraphQL, 1.0.4"
#:package Anarchy.Toolkit.Web.GraphQL@1.0.4
#addin nuget:?package=Anarchy.Toolkit.Web.GraphQL&version=1.0.4
#tool nuget:?package=Anarchy.Toolkit.Web.GraphQL&version=1.0.4
Anarchy.Toolkit.Web.GraphQL
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
1.0.4
- chore(docs): Update release notes
1.0.3
- build: migrate local automation to NUKE
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.
| 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 (>= 1.0.4)
- 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.
Initial release.