Releases: charlesdevandiere/graphql-client-extensions
4.0.0
Breaking change
- Upgrade GraphQL.Query.Builder to version 2.0.0.
You must use GraphQL.Query.Builder.Formatter.NewtonsoftJson explicitly.
3.2.2
Added
Add source link to the nuget package
3.2.1
Upgrade GraphQL.Query.Builder 1.6.0
3.1.0
Changes:
Upgrade GraphQL.Query.Builder to version 1.2.1
3.0.1
Upgrade dependencies
- Dawn.Guard:
1.12.0
- GraphQL.Query.Builder:
1.0.1
3.0.0
Changes
Query build outsourced
Query build has been outsourced in GraphQL.Query.Builder package.
New icon
Breaking changes
Namespace for IQuery
, IQuery<T>
, Query<T>
, IQueryStringBuilder
, QueryStringBuilder
, QueryOptions
classes and interfaces is now GraphQL.Query.Builder
2.1.0
Changes
Support scalar type query
Schema :
names(match: String!): [String!]
Query :
names(match: "John")
2.0.0
New features
Batched queries
You can now send batched queries
var queries = new IQuery[]
{
new Query<Human>("human")
.Alias("john")
.AddArguments(new { name = "John" })
.AddField(h => h.FirstName),
new Query<Human>("humans")
.Alias("all")
.AddField(h => h.FirstName)
};
using var client = new GraphQLClient("<url>");
IReadOnlyDictionary<string, JToken> batch = await client.GetBatch(queries);
Improuvments
.NET Core 3.1
Samples and test projects target now .NET Core 3.1.
GraphQL.Client.Extensions continue to target .NET Standard 2.0.
Code quality
Code coverage is now published.
Test projects were migrated to XUnit.
We use Dawn.Guard for argument validation.
Breaking changes
JToken and string result
Now, if you use JToken or string result in Get or Post methods, you recieve only the data
node of the JSON response :
var queri = new Query<Human>("human")
.AddArguments(new { name = "John" })
.AddField(h => h.FirstName);
using var client = new GraphQLClient("<url>");
string json = await client.Get<string>(query);
{
"firstName": "John"
}
In previous version :
{
"data": {
"human": {
"firstName": "John"
}
}
}
Exception management
GraphQL.Client.Extensions methods now throw GraphQLClientException.
GraphQL errors can be recovered like this :
try
{
// ...
}
catch (GraphQLClientException e)
{
GraphQLError[] errors = e.Data["Errors"];
}
In previous version :
GraphQLError[] errors = e.Data["errors"];