GraphQL.IntrospectionModel 0.0.21

There is a newer version of this package available.
See the version list below for details.
dotnet add package GraphQL.IntrospectionModel --version 0.0.21                
NuGet\Install-Package GraphQL.IntrospectionModel -Version 0.0.21                
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="GraphQL.IntrospectionModel" Version="0.0.21" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add GraphQL.IntrospectionModel --version 0.0.21                
#r "nuget: GraphQL.IntrospectionModel, 0.0.21"                
#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 GraphQL.IntrospectionModel as a Cake Addin
#addin nuget:?package=GraphQL.IntrospectionModel&version=0.0.21

// Install GraphQL.IntrospectionModel as a Cake Tool
#tool nuget:?package=GraphQL.IntrospectionModel&version=0.0.21                

graphql-introspection-model

<a href="https://www.buymeacoffee.com/sungam3r" target="_blank"><img src="https://bmc-cdn.nyc3.digitaloceanspaces.com/BMC-button-images/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: auto !important;width: auto !important;" ></a>

License

codecov Nuget NuGet

GitHub Release Date GitHub commits since latest release (by date) Size

GitHub contributors Activity Activity Activity

Run unit tests Publish preview to GitHub registry Publish release to Nuget registry CodeQL analysis

Types for GraphQL introspection model. Used by graphql-sdl-exporter.

A GraphQL server supports introspection over its schema. This schema is queried using GraphQL itself, creating a powerful platform for tool‐building.

Here's what a "classic" introspection query looks like:

query IntrospectionQuery {
  __schema {
    queryType { name }
    mutationType { name }
    subscriptionType { name }
    types {
      ...FullType
    }
    directives {
      name
      description
      locations
      args {
        ...InputValue
      }
    }
  }
}

fragment FullType on __Type {
  kind
  name
  description
  fields(includeDeprecated: true) {
    name
    description
    args {
      ...InputValue
    }
    type {
      ...TypeRef
    }
    isDeprecated
    deprecationReason
  }
  inputFields {
    ...InputValue
  }
  interfaces {
    ...TypeRef
  }
  enumValues(includeDeprecated: true) {
    name
    description
    isDeprecated
    deprecationReason
  }
  possibleTypes {
    ...TypeRef
  }
}

fragment InputValue on __InputValue {
  name
  description
  type { ...TypeRef }
  defaultValue
}

fragment TypeRef on __Type {
  kind
  name
  ofType {
    kind
    name
    ofType {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
              ofType {
                kind
                name
              }
            }
          }
        }
      }
    }
  }
}

The result of this query (like all other GraphQL queries) is JSON. You can deal with it directly or deserialize it into some data structures. Such data structures are provided by this repository. The top level type is GraphQLSchema. After deserialization JSON into the GraphQLSchema (or after creating GraphQLSchema in any other way), it can be transformed into AST representation and then printed by SDLPrinter from GraphQL-Parser nuget package.

Example of deserializing introspection response
using System.Text.Json;

string text = ...; // from HTTP introspection response
var response = JsonSerializer.Deserialize<GraphQLResponse>(text, new JsonSerializerOptions
{
    PropertyNameCaseInsensitive = true,
    Converters = { new JsonStringEnumConverter() }
});
var schema = response.Data.__Schema; // note that Data may be null, so check response.Errors 
Example of printing GraphQLSchema into SDL
GraphQLSchema schema = ...;

var converter = new ASTConverter();
var document = converter.ToDocument(schema);
var printer = new SDLPrinter(options);
var sdl = printer.Print(document);

// or use one-line extension method
var sdl = schema.Print();

GraphQL has its own language to write GraphQL schemas, SDL - Schema Definition Language. SDL is simple and intuitive to use while being extremely powerful and expressive. Some examples of SDL documents can be found in graphql-sdl-exporter project.

Many types in this project implement the IHasDirectives interface. It serves to obtain information about the directives applied to the element. The official specification does not describe such a possibility, although discussions are underway to expand the specification to add this feature. graphql-sdl-exporter can get information about directives if the server supports this feature.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on GraphQL.IntrospectionModel:

Package Downloads
Theauxm.GraphQL.Client

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.22 4,186 12/12/2023
0.0.21 520 4/21/2023
0.0.20 1,125 4/21/2023
0.0.19 202 4/21/2023
0.0.18 184 4/21/2023
0.0.17 223 4/14/2023
0.0.16 861 12/2/2022
0.0.15 2,584 3/1/2022
0.0.14 1,149 8/2/2021
0.0.13 1,373 4/22/2021
0.0.12 372 4/20/2021
0.0.11 337 4/15/2021
0.0.10 437 3/24/2021
0.0.9 733 10/25/2020
0.0.7 416 10/25/2020
0.0.5 430 9/10/2020
0.0.4 524 7/6/2020
0.0.3 496 2/4/2020
0.0.2 531 12/9/2019
0.0.1 513 12/9/2019