Skip to content

orbital7/orbital7.graphql

main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 

orbital7.graphql

.NET Standard 2.0 library for creating C# model classes for use with an external GraphQL API

Nuget Package: Orbital7.GraphQL

Example usage:

// Deterine the GraphQL types schema.
var schemaIntrospector = new GraphQLSchemaInterrogator();
string schema = await schemaIntrospector.ExecuteGraphQLSchemaQueryAsync(
  "https://api.something.com/graphql",
  "MY_API_KEY");

// Create a C# class file for the GraphQL types.
var classBuilder = new GraphQLTypesClassBuilder();
var types = classBuilder.ParseTypes(schema);
var model = classBuilder.CoalesceToModel(types);
string classContents = classBuilder.WriteModelToClass(model, "Something.Api.Models");
System.IO.File.WriteAllText(@"C:\Temp\SomethingApiModels.cs", classContents);

About

.NET Standard 2.0 library for creating C# model classes for use with an external GraphQL API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages