Vizgql.Core 0.0.2

There is a newer version of this package available.
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
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Vizgql.Core" Version="0.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Vizgql.Core --version 0.0.2
#r "nuget: Vizgql.Core, 0.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last updated
0.0.8 96 4/25/2024
0.0.7 654 1/12/2024
0.0.6 97 1/9/2024
0.0.5 532 11/10/2023
0.0.3 125 10/10/2023
0.0.2 129 9/19/2023
0.0.1 99 9/16/2023

Test release