Skip to content

Commit 618d200

Browse files
authored
Bump GraphQL version and ASP.Net Core version for .NET Framework (#91)
* Bump GraphQL and ASP.NET Core versions * update
1 parent c0fe073 commit 618d200

File tree

8 files changed

+46
-11
lines changed

8 files changed

+46
-11
lines changed

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<VersionPrefix>7.1.0-preview</VersionPrefix>
4+
<VersionPrefix>8.0.0-preview</VersionPrefix>
55
<LangVersion>12.0</LangVersion>
66
<Copyright>Shane Krueger</Copyright>
77
<Authors>Shane Krueger</Authors>
@@ -20,7 +20,7 @@
2020
<ImplicitUsings>true</ImplicitUsings>
2121
<Nullable>enable</Nullable>
2222
<IsPackable>false</IsPackable>
23-
<GraphQLVersion>8.2.1</GraphQLVersion>
23+
<GraphQLVersion>8.8.0</GraphQLVersion>
2424
<NoWarn>$(NoWarn);IDE0056;IDE0057;NU1902;NU1903</NoWarn>
2525
<NuGetAuditMode>direct</NuGetAuditMode>
2626
</PropertyGroup>

src/GraphQL.AspNetCore3/GraphQL.AspNetCore3.csproj

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0;netcoreapp2.1;netcoreapp3.1;net5.0</TargetFrameworks>
@@ -17,13 +17,20 @@
1717
<PackageReference Include="GraphQL.SystemTextJson" Version="$(GraphQLVersion)" />
1818
</ItemGroup>
1919

20-
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netcoreapp2.1'">
20+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
21+
<PackageReference Include="Microsoft.AspNetCore" Version="2.3.0" />
22+
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="2.3.0" />
23+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.3.0" />
24+
<PackageReference Include="Microsoft.AspNetCore.WebSockets" Version="2.3.0" />
25+
</ItemGroup>
26+
27+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
2128
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.7" />
2229
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="2.1.2" />
2330
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.3" />
2431
<PackageReference Include="Microsoft.AspNetCore.WebSockets" Version="2.1.7" />
2532
</ItemGroup>
26-
33+
2734
<ItemGroup>
2835
<Using Include="GraphQL" />
2936
<Using Include="GraphQL.AspNetCore3.Errors" />

src/GraphQL.AspNetCore3/GraphQLHttpMiddleware.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ public GraphQLHttpMiddleware(
3535
IDocumentExecuter<TSchema> documentExecuter,
3636
IServiceScopeFactory serviceScopeFactory,
3737
GraphQLHttpMiddlewareOptions options,
38+
#pragma warning disable CS0618 // Type or member is obsolete
3839
IHostApplicationLifetime hostApplicationLifetime)
40+
#pragma warning restore CS0618 // Type or member is obsolete
3941
: base(next, serializer, documentExecuter, serviceScopeFactory, options, hostApplicationLifetime)
4042
{
4143
}
@@ -64,7 +66,9 @@ public class GraphQLHttpMiddleware : IUserContextBuilder
6466
private readonly IEnumerable<IValidationRule> _postCachedDocumentValidationRules;
6567
private readonly IGraphQLTextSerializer _serializer;
6668
private readonly RequestDelegate _next;
69+
#pragma warning disable CS0618 // Type or member is obsolete
6770
private readonly IHostApplicationLifetime _hostApplicationLifetime;
71+
#pragma warning restore CS0618 // Type or member is obsolete
6872
private readonly GraphQLHttpMiddlewareOptions _options;
6973

7074
private const string QUERY_KEY = "query";
@@ -90,7 +94,9 @@ public GraphQLHttpMiddleware(
9094
IDocumentExecuter documentExecuter,
9195
IServiceScopeFactory serviceScopeFactory,
9296
GraphQLHttpMiddlewareOptions options,
97+
#pragma warning disable CS0618 // Type or member is obsolete
9398
IHostApplicationLifetime hostApplicationLifetime)
99+
#pragma warning restore CS0618 // Type or member is obsolete
94100
{
95101
_next = next ?? throw new ArgumentNullException(nameof(next));
96102
_serializer = serializer ?? throw new ArgumentNullException(nameof(serializer));
@@ -896,11 +902,6 @@ protected virtual Task WriteJsonResponseAsync<TResult>(HttpContext context, Http
896902
return _serializer.WriteAsync(context.Response.Body, result, context.RequestAborted);
897903
}
898904

899-
private static readonly IEnumerable<string> _supportedSubProtocols = new List<string>(new[] {
900-
WebSockets.GraphQLWs.SubscriptionServer.SubProtocol,
901-
WebSockets.SubscriptionsTransportWs.SubscriptionServer.SubProtocol,
902-
}).AsReadOnly();
903-
904905
/// <summary>
905906
/// Gets a list of WebSocket sub-protocols supported.
906907
/// </summary>

src/Samples/Net48Sample/Net48Sample.csproj

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' != 'true'">
44
<TargetFramework>netcoreapp2.1</TargetFramework>
@@ -12,6 +12,17 @@
1212

1313
<ItemGroup>
1414
<PackageReference Include="GraphQL.NewtonsoftJson" Version="$(GraphQLVersion)" />
15+
</ItemGroup>
16+
17+
<ItemGroup Condition="'$(TargetFramework)' == 'net48'">
18+
<PackageReference Include="Microsoft.AspNetCore" Version="2.3.0" />
19+
<PackageReference Include="Microsoft.AspNetCore.CookiePolicy" Version="2.3.0" />
20+
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="2.3.0" />
21+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.3.0" />
22+
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.3.0" />
23+
</ItemGroup>
24+
25+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
1526
<PackageReference Include="Microsoft.AspNetCore" Version="2.1.7" />
1627
<PackageReference Include="Microsoft.AspNetCore.CookiePolicy" Version="2.1.14" />
1728
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="2.1.1" />

src/Tests/Middleware/AuthorizationTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ public async Task WebSocket_NotAuthorized()
145145

146146
private class MyMiddleware : GraphQLHttpMiddleware<ISchema>
147147
{
148+
#pragma warning disable CS0618 // Type or member is obsolete
148149
public MyMiddleware(RequestDelegate next, IGraphQLTextSerializer serializer, IDocumentExecuter<ISchema> documentExecuter, IServiceScopeFactory serviceScopeFactory, IHostApplicationLifetime hostApplicationLifetime)
150+
#pragma warning restore CS0618 // Type or member is obsolete
149151
: base(next, serializer, documentExecuter, serviceScopeFactory, new(), hostApplicationLifetime)
150152
{
151153
}

src/Tests/Middleware/FileUploadTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ public class MyMiddleware : GraphQLHttpMiddleware<MySchema>
6363
{
6464
private readonly IGraphQLTextSerializer _serializer;
6565

66+
#pragma warning disable CS0618 // Type or member is obsolete
6667
public MyMiddleware(RequestDelegate next, IGraphQLTextSerializer serializer, IDocumentExecuter<MySchema> documentExecuter, IServiceScopeFactory serviceScopeFactory, GraphQLHttpMiddlewareOptions options, IHostApplicationLifetime hostApplicationLifetime)
68+
#pragma warning restore CS0618 // Type or member is obsolete
6769
: base(next, serializer, documentExecuter, serviceScopeFactory, options, hostApplicationLifetime)
6870
{
6971
_serializer = serializer;

src/Tests/Middleware/MiscTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ public void Constructors()
1818
var options = new GraphQLHttpMiddlewareOptions();
1919
var executer = Mock.Of<IDocumentExecuter<ISchema>>();
2020
var scopeFactory = Mock.Of<IServiceScopeFactory>();
21+
#pragma warning disable CS0618 // Type or member is obsolete
2122
var appLifetime = Mock.Of<IHostApplicationLifetime>();
23+
#pragma warning restore CS0618 // Type or member is obsolete
2224
Should.Throw<ArgumentNullException>(() => new GraphQLHttpMiddleware<ISchema>(null!, serializer, executer, scopeFactory, options, appLifetime));
2325
Should.Throw<ArgumentNullException>(() => new GraphQLHttpMiddleware<ISchema>(next, null!, executer, scopeFactory, options, appLifetime));
2426
Should.Throw<ArgumentNullException>(() => new GraphQLHttpMiddleware<ISchema>(next, serializer, null!, scopeFactory, options, appLifetime));
@@ -46,7 +48,9 @@ public async Task SchemaSpecificBuilders()
4648
Mock.Of<IDocumentExecuter<Schema>>(MockBehavior.Strict),
4749
Mock.Of<IServiceScopeFactory>(MockBehavior.Strict),
4850
new GraphQLHttpMiddlewareOptions(),
51+
#pragma warning disable CS0618 // Type or member is obsolete
4952
Mock.Of<IHostApplicationLifetime>(MockBehavior.Strict));
53+
#pragma warning restore CS0618 // Type or member is obsolete
5054
var builder = new Mock<IUserContextBuilder<Schema>>(MockBehavior.Strict);
5155
var d = new Dictionary<string, object?> { { "test", "test" } };
5256
builder.Setup(x => x.BuildUserContextAsync(It.IsAny<HttpContext>(), It.IsAny<object?>())).ReturnsAsync(d);
@@ -60,7 +64,9 @@ public async Task SchemaSpecificBuilders()
6064
private class MyMiddleware<TSchema> : GraphQLHttpMiddleware<TSchema>
6165
where TSchema : ISchema
6266
{
67+
#pragma warning disable CS0618 // Type or member is obsolete
6368
public MyMiddleware(RequestDelegate next, IGraphQLTextSerializer serializer, IDocumentExecuter<TSchema> executer, IServiceScopeFactory scopeFactory, GraphQLHttpMiddlewareOptions options, IHostApplicationLifetime hostApplicationLifetime)
69+
#pragma warning restore CS0618 // Type or member is obsolete
6470
: base(next, serializer, executer, scopeFactory, options, hostApplicationLifetime)
6571
{
6672
}
@@ -115,11 +121,13 @@ public void WebSocketSubProtocolNotSupportedError_Message()
115121

116122
public class MyMiddleware : GraphQLHttpMiddleware<ISchema>
117123
{
124+
#pragma warning disable CS0618 // Type or member is obsolete
118125
public MyMiddleware() : this(Mock.Of<IHostApplicationLifetime>(MockBehavior.Strict))
119126
{
120127
}
121128

122129
public MyMiddleware(IHostApplicationLifetime hostApplicationLifetime) : base(
130+
#pragma warning restore CS0618 // Type or member is obsolete
123131
_ => throw new NotSupportedException(),
124132
Mock.Of<IGraphQLTextSerializer>(MockBehavior.Strict),
125133
Mock.Of<IDocumentExecuter<ISchema>>(MockBehavior.Strict),

src/Tests/Middleware/WebSocketTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ private class TestMiddleware : GraphQLHttpMiddleware
110110
{
111111
private readonly string[] _subprotocols;
112112

113+
#pragma warning disable CS0618 // Type or member is obsolete
113114
public TestMiddleware(RequestDelegate next, string[] subprotocols) : base(next, new GraphQLSerializer(), Mock.Of<IDocumentExecuter>(MockBehavior.Strict), Mock.Of<IServiceScopeFactory>(MockBehavior.Strict), new GraphQLHttpMiddlewareOptions(), Mock.Of<IHostApplicationLifetime>(MockBehavior.Strict))
115+
#pragma warning restore CS0618 // Type or member is obsolete
114116
{
115117
_subprotocols = subprotocols;
116118
}
@@ -161,12 +163,14 @@ private class TestMiddleware2 : GraphQLHttpMiddleware
161163
{
162164
private readonly Tuple<CancellationTokenSource, TaskCompletionSource<bool>> _tuple;
163165

166+
#pragma warning disable CS0618 // Type or member is obsolete
164167
public TestMiddleware2(RequestDelegate next, IGraphQLTextSerializer serializer, IDocumentExecuter<ISchema> documentExecuter, IServiceScopeFactory serviceScopeFactory, GraphQLHttpMiddlewareOptions options, Tuple<CancellationTokenSource, TaskCompletionSource<bool>> tuple)
165168
: this(next, serializer, documentExecuter, serviceScopeFactory, options, Mock.Of<IHostApplicationLifetime>(MockBehavior.Strict), tuple)
166169
{
167170
}
168171

169172
private TestMiddleware2(RequestDelegate next, IGraphQLTextSerializer serializer, IDocumentExecuter<ISchema> documentExecuter, IServiceScopeFactory serviceScopeFactory, GraphQLHttpMiddlewareOptions options, IHostApplicationLifetime hostApplicationLifetime, Tuple<CancellationTokenSource, TaskCompletionSource<bool>> tuple)
173+
#pragma warning restore CS0618 // Type or member is obsolete
170174
: base(next, serializer, documentExecuter, serviceScopeFactory, options, hostApplicationLifetime)
171175
{
172176
Mock.Get(hostApplicationLifetime).Setup(x => x.ApplicationStopping).Returns(tuple.Item1.Token);

0 commit comments

Comments
 (0)