Vizgql.Core
0.0.2
See the version list below for details.
dotnet add package Vizgql.Core --version 0.0.2
NuGet\Install-Package Vizgql.Core -Version 0.0.2
<PackageReference Include="Vizgql.Core" Version="0.0.2" />
paket add Vizgql.Core --version 0.0.2
#r "nuget: Vizgql.Core, 0.0.2"
// Install Vizgql.Core as a Cake Addin
#addin nuget:?package=Vizgql.Core&version=0.0.2
// Install Vizgql.Core as a Cake Tool
#tool nuget:?package=Vizgql.Core&version=0.0.2
Goals
The goal of this project is to have a tool for vizualizing and testing authorization for GraphQL schemas. It is not always clear and easy to vizualize how authorization constraints (roles/policies) are applied fields. This projects aims to give you tools to automatically test this, and genrate vizualisations.
Vizgql.Core
This package contains the logic for parsing and finding validation errors for schemas.
Installation
dotnet add package Vizgql.Core
In unit tests
We can assert validation of a schema with the SchemaAuthorization
class. It exposes AssertValidate
which validates the schema sdl. You can configure some of it behaviour by also passing a ValidationOptions
object. AssertValidate
will throw exceptions if the schema fails some validation check. The package is not specific to any testing framework.
Example test
[Test]
public void ExampleTest()
{
SchemaAuthorization.AssertValidate(
sdlSchema,
new ValidationOptions(AllowFieldWithoutAuthorization: true)
);
}
Other
You can use the Validate
method to find all warnings for the schema.
ValidationOptions
public sealed record ValidationOptions(
bool AllowRootTypeWithoutAuthorization = false,
bool AllowRootTypeEmptyAuthorize = true,
bool AllowFieldWithoutAuthorization = false
);
AllowRootTypeWithoutAuthorization
If this is enabled, validation will pass for missing @authorize
directive on root types such as Query
and Mutation
.
AllowRootTypeEmptyAuthorize
If enabled validation will pass for missing constraints such as roles/policies on root types such as Query
and Mutation
.
AllowFieldWithoutAuthorization
If enabled validation will pass for missing @authorize
directive on fields.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net7.0
- GraphQL-Parser (>= 9.2.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Vizgql.Core:
Package | Downloads |
---|---|
Vizgql.ReportBuilder.Html
The goal of this project is to have a tool for vizualizing and testing authorization for GraphQL schemas. It is not always clear and easy to vizualize how authorization constraints (roles/policies) are applied fields. This projects aims to give you tools to automatically test this, and genrate vizualisations. |
|
Vizgql.ReportBuilder
The goal of this project is to have a tool for vizualizing and testing authorization for GraphQL schemas. It is not always clear and easy to vizualize how authorization constraints (roles/policies) are applied fields. This projects aims to give you tools to automatically test this, and genrate vizualisations. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Test release