graphql-dotnet /graphql-dotnet

GraphQL for .NET

★ 5,984⑂ 944👁 162⑃ 2,680● 1,805▤ 140
C#MITCreated 2015-07-06graphql-dotnet.github.io
Download: 8.8.58.8.5 ↓8.8.52026-08-18
+0
Daily
5,984
stars
944
forks
162
watchers
2,680
prs
1,805
issues
140
releases

README

GraphQL for .NET







!Size


!Activity
!Activity
!Activity

| :heart: Become a backer! :heart: |    |
|-|-|

This is an implementation of GraphQL, a query language and execution engine originally created
by Facebook in 2012, in .NET.

The GraphQL specification is now being developed and
maintained by the GraphQL Foundation, established in 2019 to
support the GraphQL ecosystem. You can also find the specification's source and discussions
on GitHub at graphql/graphql-spec.

This project uses a lexer/parser originally written
by Marek Magdziak and released with a MIT license. Thank you Marek!

Provides the following packages:

| Package                | Downloads                                                                                                                 | NuGet Latest                                                                                                             |
|------------------------|---------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|
| GraphQL                |                                |                                |
| GraphQL.SystemTextJson |  |  |
| GraphQL.NewtonsoftJson |  |  |
| GraphQL.MemoryCache    |        |        |
| GraphQL.DataLoader     |          |          |
| GraphQL.MicrosoftDI    |        |        |

You can get all preview versions from GitHub Packages.
Note that GitHub requires authentication to consume the feed. See here.

 Documentation

1. http://graphql-dotnet.github.io - documentation site that is built from the docs folder in the master branch.
2. https://graphql.org/learn - learn about GraphQL, how it works, and how to use it.

 Debugging

All packages generated from this repository come with embedded pdb and support Source Link.
If you are having difficulty understanding how the code works or have encountered an error, then it is just enough to enable
Source Link in your IDE settings. Then you can debug GraphQL.NET source code as if it were part of your project.

 Installation

 1. GraphQL.NET engine

This is the main package, the heart of the repository in which you can find all the necessary classes
for GraphQL request processing.


 dotnet add package GraphQL


 2. Serialization

For serialized results, you'll need an IGraphQLSerializer implementation.
We provide several serializers (or you can bring your own).


 dotnet add package GraphQL.SystemTextJson
 dotnet add package GraphQL.NewtonsoftJson


 Note: You can use GraphQL.NewtonsoftJson with .NET Core 3+, just be aware it lacks async writing 
 capabilities so writing to an ASP.NET Core 3.0 HttpResponse.Body will require you to set 
 AllowSynchronousIO to true as per this announcement;
 which isn't recommended.

 3. Document Caching

The recommended way to setup caching layer (for caching of parsed GraphQL documents) is to

Top issues

Discussions

Latest release

8.8.5 8.8.5 2026-08-18
What's Changed
 Clarify DataLoader DI setup and listener behavior by @yuliuyi717-ux in https://github.com/graphql-dotnet/graphql-dotnet/pull/4385
 Fix handling of directive arguments with default values by @jbellenger in https://github.com/graphql-dotnet/graphql-dotnet/pull/4437
 Fix self-referencing input type default values throwing circular dependency error by @Shane32 with @Copilot in https://github.com/graphql-dotnet/graphql-dotnet/pull/4445
 Fix recursively referenced input object not initializing all field default values by @Shane32 in https://github.com/graphql-dotnet/graphql-dotne

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON