Skip to content

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

License

Notifications You must be signed in to change notification settings

orbital7/orbital7.graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 schemaInterrogator = new GraphQLSchemaInterrogator();
string schema = await schemaInterrogator.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

 
 
 

Languages