Extensions for GraphQL.Client to build graphQL queries from a C# model.
Total Downloads
963.0K
963,023
Published
Apr 26, 2022
4y ago
Get Started
dotnet add package GraphQL.Client.Extensions --version 4.0.0
| Product | Versions |
|---|---|
| .NET Standard |
README
GraphQL Client Extensions

Extensions for GraphQL.Client to build graphQL queries from a C# model.
Uses GraphQL.Query.Builder for query building.
See complete documentation here
See sample here
Install
dotnet add package GraphQL.Client.Extensions
Usage
// create the query with GraphQL.Query.Builder
Query<Human> query = new Query<Human>("humans", options) // set the name of the query
.AddArguments(new { id = "uE78f5hq" }) // add query arguments
.AddField(h => h.FirstName) // add firstName field
.AddField(h => h.LastName) // add lastName field
.AddField( // add a sub-object field
h => h.HomePlanet, // set the name of the field
sq => sq /// build the sub-query
.AddField(p => p.Name)
)
.AddField<human>( // add a sub-list field
h => h.Friends,
sq => sq
.AddField(f => f.FirstName)
.AddField(f => f.LastName)
);
// this corresponds to :
// humans (id: "uE78f5hq") {
// FirstName
// LastName
// HomePlanet {
// Name
// }
// Friends {
// FirstName
// LastName
// }
// }
using (GraphQLClient client = new("<url>"))
{
// run the query
Human human = await client.Get<Human>(query);
}
Dependencies
- GraphQL.Client (>= 1.0.3)
- GraphQL.Query.Builder (>= 2.0.0)
- GraphQL.Query.Builder.Formatter.NewtonsoftJson (>= 1.0.0)
Downloads by Version
Similar & Alternative Packages
Hand-picked matching NuGet libraries based on tags & ecosystem
Depended On By
Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Compatibility metadata lists 1 target framework; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.