A schema-first C# GraphQL library.
-
GraphLinqQL.Resolvers
- code generation and basic framework. Use in libraries that will be shared across projects to host GraphLinqQL!
-
GraphLinqQL.AspNetCore
- extension methods to easily add ASP.NET Core 3 GraphQL endpoints. Use with GraphLinqQL.Resolvers for a complete solution!
-
GraphLinqQL.Execution
- framework for executing GraphQL queries with GraphLinqQL. Use if you're writing a new execution framework!
-
GraphLinqQL.Introspection
- classes for providing introspection support. Use from your Execution project if you want to support full GraphQL introspection!
-
GraphLinqQL.Ast
- classes for parsing GraphQL. Use if you want to work with GraphQL but without all our other stuff!
- Allow you to write your GraphQL SDL along with your UI developers
- Generate C# interfaces for ideal type-checking
- Keep generated code out of your committed code for CI of schema changes.
- Rely on C#'s
Expression
infrastructure for better support of other C# libraries, such as EF Core.
-
Create your GraphQL schema document using any toolchain you want.
This file can be hand-maintained to be versioned with your repository according to the GraphQL Schema Specification or generated by tools like
graphql-import
or . You may use link references in your csproj, too, which is especially helpful for monorepos. -
Add
GraphLinqQL.AspNetCore
to your project and add your
.graphql
file.This generates C# classes for you to implement.
Note: In versions of Visual Studio prior to 2019, you may need to reload the project after adding the dependency.
-
Implement those interfaces.
Connect them to your Domain model using the expressions that will be converted into the IQueryable. If you need to use APIs with .NET Tasks, those are supported, too!
-
Add GraphQL execution to your endpoint.
With just a few lines added to your ASP.NET Core 3 Startup.cs, your GraphQL API will be ready to go. Introspection is available, but also optional.
Otherwise,
GraphLinqQL.Execution
will put you well on your way.