Skip to content

A schema-first C# GraphQL library - via IQueryable for use with EF Core!

License

Notifications You must be signed in to change notification settings

mdekrey/GraphLinqQL

Repository files navigation

GraphLinqQL

A schema-first C# GraphQL library.

Master branch

Build Status Test Status Code Coverge

Latest

Build Status Test Status Code Coverge

Latest release

  • GraphLinqQL.Resolvers GraphLinqQL.Resolvers - code generation and basic framework. Use in libraries that will be shared across projects to host GraphLinqQL!

  • GraphLinqQL.AspNetCore GraphLinqQL.AspNetCore - extension methods to easily add ASP.NET Core 3 GraphQL endpoints. Use with GraphLinqQL.Resolvers for a complete solution!

  • GraphLinqQL.Execution GraphLinqQL.Execution - framework for executing GraphQL queries with GraphLinqQL. Use if you're writing a new execution framework!

  • GraphLinqQL.Introspection GraphLinqQL.Introspection - classes for providing introspection support. Use from your Execution project if you want to support full GraphQL introspection!

  • GraphLinqQL.Ast GraphLinqQL.Ast - classes for parsing GraphQL. Use if you want to work with GraphQL but without all our other stuff!

Our Approach

  1. Allow you to write your GraphQL SDL along with your UI developers
  2. Generate C# interfaces for ideal type-checking
  3. Keep generated code out of your committed code for CI of schema changes.
  4. Rely on C#'s Expression infrastructure for better support of other C# libraries, such as EF Core.

How it works

  1. 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.

  2. Add GraphLinqQL.AspNetCore 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.

  3. 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!

  4. 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 GraphLinqQL.Execution will put you well on your way.

About

A schema-first C# GraphQL library - via IQueryable for use with EF Core!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages