Skip to content

Commit 79b0161

Browse files
authored
Prepare Release 6.0.4 (#634)
* add stringsyntaxattribute to constructor of GraphQLHttpRequest, ad "QL" abbreviation to resharper dictionary * disable compiler warnings in stub StringSyntaxAttribute for netstandard2.0 * upgrade dependencies * use dotnet 8.0 for gh workflows
1 parent 95d3476 commit 79b0161

File tree

17 files changed

+96
-78
lines changed

17 files changed

+96
-78
lines changed

.github/workflows/branches.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: actions/setup-dotnet@v4
2626
with:
2727
dotnet-version: |
28-
7.0.x
28+
8.0.x
2929
- name: Restore dotnet tools
3030
run: dotnet tool restore
3131
- name: Fetch complete repository including tags

.github/workflows/master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup .NET SDK
2424
uses: actions/setup-dotnet@v4
2525
with:
26-
dotnet-version: "7.0.x"
26+
dotnet-version: "8.0.x"
2727
source-url: https://nuget.pkg.github.com/graphql-dotnet/index.json
2828
env:
2929
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup .NET SDK
2828
uses: actions/setup-dotnet@v4
2929
with:
30-
dotnet-version: "7.0.x"
30+
dotnet-version: "8.0.x"
3131
source-url: https://api.nuget.org/v3/index.json
3232
env:
3333
NUGET_AUTH_TOKEN: ${{secrets.NUGET_API_KEY}}

GraphQL.Client.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
3232
ProjectSection(SolutionItems) = preProject
3333
.github\workflows\branches.yml = .github\workflows\branches.yml
3434
.github\workflows\master.yml = .github\workflows\master.yml
35+
.github\workflows\publish.yml = .github\workflows\publish.yml
3536
EndProjectSection
3637
EndProject
3738
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphQL.Primitives", "src\GraphQL.Primitives\GraphQL.Primitives.csproj", "{87FC440E-6A4D-47D8-9EB2-416FC31CC4A6}"

GraphQL.Client.sln.DotSettings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=QL/@EntryIndexedValue">QL</s:String></wpf:ResourceDictionary>

src/GraphQL.Client.LocalExecution/GraphQL.Client.LocalExecution.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="GraphQL.MicrosoftDI" Version="7.6.1" />
9+
<PackageReference Include="GraphQL.MicrosoftDI" Version="7.8.0" />
1010
<PackageReference Include="System.Reactive" Version="6.0.0" />
1111
</ItemGroup>
1212

src/GraphQL.Client.Serializer.SystemTextJson/GraphQL.Client.Serializer.SystemTextJson.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
9-
<PackageReference Include="System.Text.Json" Version="8.0.0" />
9+
<PackageReference Include="System.Text.Json" Version="8.0.3" />
1010
</ItemGroup>
1111

1212
<ItemGroup>
Lines changed: 50 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,53 @@
1-
#pragma warning disable IDE0005
2-
// see https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/implicit-global-using-netfx
3-
using System.Net.Http;
4-
#pragma warning restore IDE0005
5-
using System.Net.Http.Headers;
6-
using System.Text;
7-
using GraphQL.Client.Abstractions;
8-
9-
namespace GraphQL.Client.Http;
10-
11-
public class GraphQLHttpRequest : GraphQLRequest
12-
{
13-
public GraphQLHttpRequest()
14-
{
15-
}
16-
17-
public GraphQLHttpRequest(string query, object? variables = null, string? operationName = null, Dictionary<string, object?>? extensions = null)
18-
: base(query, variables, operationName, extensions)
19-
{
20-
}
21-
22-
public GraphQLHttpRequest(GraphQLRequest other)
23-
: base(other)
24-
{
25-
}
26-
27-
/// <summary>
28-
/// Creates a <see cref="HttpRequestMessage"/> from this <see cref="GraphQLHttpRequest"/>.
29-
/// Used by <see cref="GraphQLHttpClient"/> to convert GraphQL requests when sending them as regular HTTP requests.
30-
/// </summary>
31-
/// <param name="options">the <see cref="GraphQLHttpClientOptions"/> passed from <see cref="GraphQLHttpClient"/></param>
32-
/// <param name="serializer">the <see cref="IGraphQLJsonSerializer"/> passed from <see cref="GraphQLHttpClient"/></param>
33-
/// <returns></returns>
34-
public virtual HttpRequestMessage ToHttpRequestMessage(GraphQLHttpClientOptions options, IGraphQLJsonSerializer serializer)
35-
{
36-
var message = new HttpRequestMessage(HttpMethod.Post, options.EndPoint)
37-
{
38-
Content = new StringContent(serializer.SerializeToString(this), Encoding.UTF8, options.MediaType)
39-
};
40-
message.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/graphql-response+json"));
41-
message.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
1+
#pragma warning disable IDE0005
2+
// see https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/implicit-global-using-netfx
3+
using System.Diagnostics.CodeAnalysis;
4+
using System.Net.Http;
5+
#pragma warning restore IDE0005
6+
using System.Net.Http.Headers;
7+
using System.Text;
8+
using GraphQL.Client.Abstractions;
9+
10+
namespace GraphQL.Client.Http;
11+
12+
public class GraphQLHttpRequest : GraphQLRequest
13+
{
14+
public GraphQLHttpRequest()
15+
{
16+
}
17+
18+
public GraphQLHttpRequest([StringSyntax("GraphQL")] string query, object? variables = null, string? operationName = null, Dictionary<string, object?>? extensions = null)
19+
: base(query, variables, operationName, extensions)
20+
{
21+
}
22+
23+
public GraphQLHttpRequest(GraphQLRequest other)
24+
: base(other)
25+
{
26+
}
27+
28+
/// <summary>
29+
/// Creates a <see cref="HttpRequestMessage"/> from this <see cref="GraphQLHttpRequest"/>.
30+
/// Used by <see cref="GraphQLHttpClient"/> to convert GraphQL requests when sending them as regular HTTP requests.
31+
/// </summary>
32+
/// <param name="options">the <see cref="GraphQLHttpClientOptions"/> passed from <see cref="GraphQLHttpClient"/></param>
33+
/// <param name="serializer">the <see cref="IGraphQLJsonSerializer"/> passed from <see cref="GraphQLHttpClient"/></param>
34+
/// <returns></returns>
35+
public virtual HttpRequestMessage ToHttpRequestMessage(GraphQLHttpClientOptions options, IGraphQLJsonSerializer serializer)
36+
{
37+
var message = new HttpRequestMessage(HttpMethod.Post, options.EndPoint)
38+
{
39+
Content = new StringContent(serializer.SerializeToString(this), Encoding.UTF8, options.MediaType)
40+
};
41+
message.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/graphql-response+json"));
42+
message.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
4243
message.Headers.AcceptCharset.Add(new StringWithQualityHeaderValue("utf-8"));
4344

4445
// Explicitly setting content header to avoid issues with some GrahQL servers
45-
message.Content.Headers.ContentType = new MediaTypeHeaderValue(options.MediaType);
46-
47-
if (options.DefaultUserAgentRequestHeader != null)
48-
message.Headers.UserAgent.Add(options.DefaultUserAgentRequestHeader);
49-
50-
return message;
51-
}
52-
}
46+
message.Content.Headers.ContentType = new MediaTypeHeaderValue(options.MediaType);
47+
48+
if (options.DefaultUserAgentRequestHeader != null)
49+
message.Headers.UserAgent.Add(options.DefaultUserAgentRequestHeader);
50+
51+
return message;
52+
}
53+
}
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
#if !NET7_0_OR_GREATER
22

3+
// ReSharper disable once CheckNamespace
34
namespace System.Diagnostics.CodeAnalysis;
45

56
/// <summary>
67
/// Stub
78
/// </summary>
89
public sealed class StringSyntaxAttribute : Attribute
910
{
11+
// ReSharper disable once InconsistentNaming
12+
#pragma warning disable IDE1006
1013
public const string CompositeFormat = nameof(CompositeFormat);
14+
#pragma warning restore IDE1006
1115

16+
#pragma warning disable IDE0060
1217
public StringSyntaxAttribute(string syntax)
13-
{
14-
}
15-
18+
{ }
19+
#pragma warning restore IDE0060
1620
}
1721
#endif

tests/GraphQL.Client.Serializer.Tests/GraphQL.Client.Serializer.Tests.csproj

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="GraphQL.NewtonsoftJson" Version="7.6.1" />
11-
<PackageReference Include="GraphQL.SystemTextJson" Version="7.6.1" />
10+
<PackageReference Include="GraphQL.NewtonsoftJson" Version="7.8.0" />
11+
<PackageReference Include="GraphQL.SystemTextJson" Version="7.8.0" />
1212
</ItemGroup>
1313

1414
<ItemGroup>
@@ -20,9 +20,13 @@
2020
</ItemGroup>
2121

2222
<ItemGroup>
23-
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
24-
<PackageReference Update="xunit" Version="2.6.2" />
25-
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.4">
23+
<PackageReference Update="coverlet.collector" Version="6.0.2">
24+
<PrivateAssets>all</PrivateAssets>
25+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
26+
</PackageReference>
27+
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.9.0" />
28+
<PackageReference Update="xunit" Version="2.7.1" />
29+
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.8">
2630
<PrivateAssets>all</PrivateAssets>
2731
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2832
</PackageReference>

tests/GraphQL.Client.Tests.Common/GraphQL.Client.Tests.Common.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<ItemGroup>
99
<PackageReference Include="FluentAssertions.Reactive" Version="0.2.0" />
10-
<PackageReference Include="GraphQL" Version="7.6.1" />
10+
<PackageReference Include="GraphQL" Version="7.8.0" />
1111
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
1212
</ItemGroup>
1313

tests/GraphQL.Client.Tests.Common/StarWars/Types/DroidType.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ public DroidType(StarWarsData data)
1515

1616
Field<ListGraphType<CharacterInterface>>("friends").Resolve(context => data.GetFriends(context.Source));
1717

18-
Connection<CharacterInterface>()
19-
.Name("friendsConnection")
18+
Connection<CharacterInterface>("friendsConnection")
2019
.Description("A list of a character's friends.")
2120
.Bidirectional()
2221
.Resolve(context => context.GetPagedResults<Droid, StarWarsCharacter>(data, context.Source.Friends));

tests/GraphQL.Client.Tests.Common/StarWars/Types/HumanType.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ public HumanType(StarWarsData data)
1414

1515
Field<ListGraphType<CharacterInterface>>("friends").Resolve(context => data.GetFriends(context.Source));
1616

17-
Connection<CharacterInterface>()
18-
.Name("friendsConnection")
17+
Connection<CharacterInterface>("friendsConnection")
1918
.Description("A list of a character's friends.")
2019
.Bidirectional()
2120
.Resolve(context => context.GetPagedResults<Human, StarWarsCharacter>(data, context.Source.Friends));

tests/GraphQL.Integration.Tests/GraphQL.Integration.Tests.csproj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0" />
10+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.4" />
1111
<PackageReference Include="Microsoft.Reactive.Testing" Version="6.0.0" />
1212
</ItemGroup>
1313

@@ -19,9 +19,13 @@
1919
</ItemGroup>
2020

2121
<ItemGroup>
22-
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
23-
<PackageReference Update="xunit" Version="2.6.2" />
24-
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.4">
22+
<PackageReference Update="coverlet.collector" Version="6.0.2">
23+
<PrivateAssets>all</PrivateAssets>
24+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
25+
</PackageReference>
26+
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.9.0" />
27+
<PackageReference Update="xunit" Version="2.7.1" />
28+
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.8">
2529
<PrivateAssets>all</PrivateAssets>
2630
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2731
</PackageReference>

tests/GraphQL.Primitives.Tests/GraphQL.Primitives.Tests.csproj

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.8.0" />
15-
<PackageReference Update="xunit" Version="2.6.2" />
16-
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.4">
14+
<PackageReference Update="coverlet.collector" Version="6.0.2">
15+
<PrivateAssets>all</PrivateAssets>
16+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
17+
</PackageReference>
18+
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="17.9.0" />
19+
<PackageReference Update="xunit" Version="2.7.1" />
20+
<PackageReference Update="xunit.runner.visualstudio" Version="2.5.8">
1721
<PrivateAssets>all</PrivateAssets>
1822
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1923
</PackageReference>

tests/GraphQL.Server.Test/GraphQL.Server.Test.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="GraphQL.MicrosoftDI" Version="7.6.1" />
10-
<PackageReference Include="GraphQL.Server.Transports.AspNetCore" Version="7.6.0" />
11-
<PackageReference Include="GraphQL.Server.Ui.GraphiQL" Version="7.6.0" />
9+
<PackageReference Include="GraphQL.MicrosoftDI" Version="7.8.0" />
10+
<PackageReference Include="GraphQL.Server.Transports.AspNetCore" Version="7.7.1" />
11+
<PackageReference Include="GraphQL.Server.Ui.GraphiQL" Version="7.7.1" />
1212
</ItemGroup>
1313

1414
</Project>

tests/IntegrationTestServer/IntegrationTestServer.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="GraphQL.Server.All" Version="7.6.0" />
14+
<PackageReference Include="GraphQL.Server.All" Version="7.7.1" />
1515
<PackageReference Include="System.Reactive" Version="6.0.0" />
1616
<PackageReference Include="System.Reactive.Compatibility" Version="6.0.0" />
1717
</ItemGroup>

0 commit comments

Comments
 (0)