Skip to content

Commit

Permalink
Update to AspNetCore3
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane32 committed Mar 31, 2022
1 parent 5a44c9d commit eb0b9ab
Show file tree
Hide file tree
Showing 44 changed files with 56 additions and 56 deletions.
10 changes: 5 additions & 5 deletions GraphQL.AspNetCore.sln → GraphQL.AspNetCore3.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EndpointRoutingSample", "sr
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PagesSample", "src\Samples\PagesSample\PagesSample.csproj", "{1C67EC05-89BA-4C14-A874-7A0D8A2D564B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphQL.AspNetCore", "src\GraphQL.AspNetCore\GraphQL.AspNetCore.csproj", "{113AA7CB-5B8B-4D0F-9447-CE8DB70D4688}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GraphQL.AspNetCore3", "src\GraphQL.AspNetCore3\GraphQL.AspNetCore3.csproj", "{8DFDAD38-C530-4A90-B1F3-C26491FFA0A7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -75,10 +75,10 @@ Global
{1C67EC05-89BA-4C14-A874-7A0D8A2D564B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C67EC05-89BA-4C14-A874-7A0D8A2D564B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C67EC05-89BA-4C14-A874-7A0D8A2D564B}.Release|Any CPU.Build.0 = Release|Any CPU
{113AA7CB-5B8B-4D0F-9447-CE8DB70D4688}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{113AA7CB-5B8B-4D0F-9447-CE8DB70D4688}.Debug|Any CPU.Build.0 = Debug|Any CPU
{113AA7CB-5B8B-4D0F-9447-CE8DB70D4688}.Release|Any CPU.ActiveCfg = Release|Any CPU
{113AA7CB-5B8B-4D0F-9447-CE8DB70D4688}.Release|Any CPU.Build.0 = Release|Any CPU
{8DFDAD38-C530-4A90-B1F3-C26491FFA0A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8DFDAD38-C530-4A90-B1F3-C26491FFA0A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8DFDAD38-C530-4A90-B1F3-C26491FFA0A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8DFDAD38-C530-4A90-B1F3-C26491FFA0A7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# GraphQL.AspNetCore
# GraphQL.AspNetCore3

[![NuGet](https://img.shields.io/nuget/v/GraphQL.AspNetCore.svg)](https://www.nuget.org/packages/GraphQL.AspNetCore) [![Coverage Status](https://coveralls.io/repos/github/Shane32/GraphQL.AspNetCore/badge.svg?branch=master)](https://coveralls.io/github/Shane32/GraphQL.AspNetCore?branch=master)
[![NuGet](https://img.shields.io/nuget/v/GraphQL.AspNetCore3.svg)](https://www.nuget.org/packages/GraphQL.AspNetCore3) [![Coverage Status](https://coveralls.io/repos/github/Shane32/GraphQL.AspNetCore3/badge.svg?branch=master)](https://coveralls.io/github/Shane32/GraphQL.AspNetCore3?branch=master)

This package is designed for ASP.Net Core 3.1+ to facilitate easy set-up of GraphQL requests
over HTTP. The code is designed to be used as middleware within the ASP.Net Core pipeline,
Expand All @@ -24,7 +24,7 @@ framework in order to use them.

### Typical configuration with HTTP middleware

First add the `GraphQL.AspNetCore` nuget package to your application. It requires
First add the `GraphQL.AspNetCore3` nuget package to your application. It requires
`GraphQL` version 5.0 or later and will default to the newest available 5.x version if none
are installed in your application.

Expand All @@ -50,7 +50,7 @@ Below is a complete sample of a .NET 6 console app that hosts a GraphQL endpoint
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GraphQL.AspNetCore" Version="1.0.0" />
<PackageReference Include="GraphQL.AspNetCore3" Version="1.0.0" />
<PackageReference Include="GraphQL.SystemTextJson" Version="5.0.0" />
</ItemGroup>

Expand All @@ -63,7 +63,7 @@ Below is a complete sample of a .NET 6 console app that hosts a GraphQL endpoint
using GraphQL;
using GraphQL.MicrosoftDI;
using GraphQL.SystemTextJson;
using GraphQL.AspNetCore;
using GraphQL.AspNetCore3;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddGraphQL(b => b
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore;
namespace GraphQL.AspNetCore3;

/// <summary>
/// An action result that formats the <see cref="ExecutionResult"/> as JSON.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<ItemGroup>
<Using Include="GraphQL" />
<Using Include="GraphQL.AspNetCore.WebSockets" />
<Using Include="GraphQL.AspNetCore3.WebSockets" />
<Using Include="GraphQL.DI" />
<Using Include="GraphQL.Execution" />
<Using Include="GraphQL.Transport" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using ServiceLifetime = GraphQL.DI.ServiceLifetime;

namespace GraphQL.AspNetCore;
namespace GraphQL.AspNetCore3;

/// <summary>
/// GraphQL specific extension methods for <see cref="IGraphQLBuilder"/>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore;
namespace GraphQL.AspNetCore3;

/// <summary>
/// Extensions for <see cref="IApplicationBuilder"/> to add <see cref="GraphQLHttpMiddleware{TSchema}"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore;
namespace GraphQL.AspNetCore3;

/// <summary>
/// Extensions for <see cref="IEndpointRouteBuilder"/> to add <see cref="GraphQLHttpMiddleware{TSchema}"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma warning disable CA1716 // Identifiers should not match keywords

namespace GraphQL.AspNetCore;
namespace GraphQL.AspNetCore3;

/// <inheritdoc/>
/// <typeparam name="TSchema">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore;
namespace GraphQL.AspNetCore3;

/// <summary>
/// Configuration options for <see cref="GraphQLHttpMiddleware{TSchema}"/>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore;
namespace GraphQL.AspNetCore3;

/// <summary>
/// Validates that HTTP GET requests only execute queries; not mutations or subscriptions.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore;
namespace GraphQL.AspNetCore3;

/// <summary>
/// Represents a validation error indicating that the requested operation is not valid
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore;
namespace GraphQL.AspNetCore3;

/// <summary>
/// Validates that HTTP POST requests do not execute subscriptions.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore;
namespace GraphQL.AspNetCore3;

/// <summary>
/// Creates a user context from a <see cref="HttpContext"/>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore;
namespace GraphQL.AspNetCore3;

/// <inheritdoc/>
public interface IWebSocketHandler<TSchema> : IWebSocketHandler
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore;
namespace GraphQL.AspNetCore3;

/// <summary>
/// Represents a user context builder based on a delegate.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore.WebSockets;
namespace GraphQL.AspNetCore3.WebSockets;

/// <summary>
/// <para>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore.WebSockets;
namespace GraphQL.AspNetCore3.WebSockets;

/// <summary>
/// Manages a WebSocket message stream.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore.WebSockets.GraphQLWs;
namespace GraphQL.AspNetCore3.WebSockets.GraphQLWs;

/// <summary>
/// Protocol message types defined in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore.WebSockets.GraphQLWs;
namespace GraphQL.AspNetCore3.WebSockets.GraphQLWs;

/// <inheritdoc/>
public class SubscriptionServer : BaseSubscriptionServer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore.WebSockets;
namespace GraphQL.AspNetCore3.WebSockets;

/// <summary>
/// Processes a stream of messages received from a WebSockets client.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore.WebSockets;
namespace GraphQL.AspNetCore3.WebSockets;

/// <summary>
/// Represents a WebSocket connection, dispatching received messages over
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore.WebSockets;
namespace GraphQL.AspNetCore3.WebSockets;

/// <summary>
/// A readable memory stream based on a buffer, with a resettable maximum length.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore.WebSockets;
namespace GraphQL.AspNetCore3.WebSockets;

/// <summary>
/// A list of subscriptions represented by <see cref="IDisposable"/> objects.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma warning disable CA1707 // Identifiers should not contain underscores

namespace GraphQL.AspNetCore.WebSockets.SubscriptionsTransportWs;
namespace GraphQL.AspNetCore3.WebSockets.SubscriptionsTransportWs;

/// <summary>
/// Protocol message types defined in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore.WebSockets.SubscriptionsTransportWs;
namespace GraphQL.AspNetCore3.WebSockets.SubscriptionsTransportWs;

/// <inheritdoc/>
public class SubscriptionServer : BaseSubscriptionServer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore.WebSockets;
namespace GraphQL.AspNetCore3.WebSockets;

/// <summary>
/// Manages a WebSocket connection, dispatching messages to the specified <see cref="IOperationMessageProcessor"/>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore.WebSockets;
namespace GraphQL.AspNetCore3.WebSockets;

/// <inheritdoc cref="WebSocketHandler"/>
public class WebSocketHandler<TSchema> : WebSocketHandler, IWebSocketHandler<TSchema>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore.WebSockets;
namespace GraphQL.AspNetCore3.WebSockets;

/// <summary>
/// Configuration options for a WebSocket connection.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GraphQL.AspNetCore.WebSockets;
namespace GraphQL.AspNetCore3.WebSockets;

internal class WebSocketWriterStream : Stream
{
Expand Down
2 changes: 1 addition & 1 deletion src/Samples/BasicSample/BasicSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\GraphQL.AspNetCore\GraphQL.AspNetCore.csproj" />
<ProjectReference Include="..\..\GraphQL.AspNetCore3\GraphQL.AspNetCore3.csproj" />
<ProjectReference Include="..\ChatSchema\Chat.csproj" />
<PackageReference Include="GraphQL.Server.Ui.Playground" Version="5.2.1" />
<PackageReference Include="GraphQL.SystemTextJson" Version="$(GraphQLVersion)" />
Expand Down
2 changes: 1 addition & 1 deletion src/Samples/BasicSample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using GraphQL;
using GraphQL.AspNetCore;
using GraphQL.AspNetCore3;
using GraphQL.MicrosoftDI;
using GraphQL.SystemTextJson;

Expand Down
4 changes: 2 additions & 2 deletions src/Samples/ControllerSample/ControllerSample.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand All @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\GraphQL.AspNetCore\GraphQL.AspNetCore.csproj" />
<ProjectReference Include="..\..\GraphQL.AspNetCore3\GraphQL.AspNetCore3.csproj" />
<ProjectReference Include="..\ChatSchema\Chat.csproj" />
<PackageReference Include="GraphQL.SystemTextJson" Version="$(GraphQLVersion)" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Samples/ControllerSample/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using GraphQL;
using GraphQL.AspNetCore;
using GraphQL.AspNetCore3;
using GraphQL.Transport;
using GraphQL.Types;
using GraphQL.Validation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\GraphQL.AspNetCore\GraphQL.AspNetCore.csproj" />
<ProjectReference Include="..\..\GraphQL.AspNetCore3\GraphQL.AspNetCore3.csproj" />
<ProjectReference Include="..\ChatSchema\Chat.csproj" />
<PackageReference Include="GraphQL.Server.Ui.Playground" Version="5.2.1" />
<PackageReference Include="GraphQL.SystemTextJson" Version="$(GraphQLVersion)" />
Expand Down
2 changes: 1 addition & 1 deletion src/Samples/EndpointRoutingSample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using GraphQL;
using GraphQL.AspNetCore;
using GraphQL.AspNetCore3;
using GraphQL.MicrosoftDI;
using GraphQL.SystemTextJson;

Expand Down
2 changes: 1 addition & 1 deletion src/Samples/MultipleSchema/MultipleSchema.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\GraphQL.AspNetCore\GraphQL.AspNetCore.csproj" />
<ProjectReference Include="..\..\GraphQL.AspNetCore3\GraphQL.AspNetCore3.csproj" />
<ProjectReference Include="..\ChatSchema\Chat.csproj" />
<PackageReference Include="GraphQL.Server.Ui.Playground" Version="5.2.1" />
<PackageReference Include="GraphQL.SystemTextJson" Version="$(GraphQLVersion)" />
Expand Down
2 changes: 1 addition & 1 deletion src/Samples/MultipleSchema/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GraphQL.AspNetCore;
using GraphQL.AspNetCore3;
using GraphQL.MicrosoftDI;
using GraphQL.SystemTextJson;

Expand Down
4 changes: 2 additions & 2 deletions src/Samples/PagesSample/PagesSample.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand All @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\GraphQL.AspNetCore\GraphQL.AspNetCore.csproj" />
<ProjectReference Include="..\..\GraphQL.AspNetCore3\GraphQL.AspNetCore3.csproj" />
<ProjectReference Include="..\ChatSchema\Chat.csproj" />
<PackageReference Include="GraphQL.SystemTextJson" Version="$(GraphQLVersion)" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Samples/PagesSample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using GraphQL;
using GraphQL.AspNetCore;
using GraphQL.AspNetCore3;
using GraphQL.MicrosoftDI;
using GraphQL.SystemTextJson;

Expand Down
6 changes: 3 additions & 3 deletions src/Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<ItemGroup>
<ProjectReference Include="..\Samples\ChatSchema\Chat.csproj" />
<ProjectReference Include="..\GraphQL.AspNetCore\GraphQL.AspNetCore.csproj" />
<ProjectReference Include="..\GraphQL.AspNetCore3\GraphQL.AspNetCore3.csproj" />
<PackageReference Include="GraphQL.SystemTextJson" Version="$(GraphQLVersion)" />
</ItemGroup>

Expand All @@ -46,8 +46,8 @@
<Using Include="Microsoft.Extensions.DependencyInjection" />
<Using Include="Moq" />
<Using Include="Moq.Protected" />
<Using Include="GraphQL.AspNetCore" />
<Using Include="GraphQL.AspNetCore.WebSockets" />
<Using Include="GraphQL.AspNetCore3" />
<Using Include="GraphQL.AspNetCore3.WebSockets" />
<Using Include="Shouldly" />
<Using Include="System.Text" />
<Using Include="System.Threading" />
Expand Down
2 changes: 1 addition & 1 deletion src/Tests/WebSockets/TestNewSubscriptionServer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GraphQL.AspNetCore.WebSockets.GraphQLWs;
using GraphQL.AspNetCore3.WebSockets.GraphQLWs;

namespace Tests.WebSockets;

Expand Down
2 changes: 1 addition & 1 deletion src/Tests/WebSockets/TestOldSubscriptionServer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GraphQL.AspNetCore.WebSockets.SubscriptionsTransportWs;
using GraphQL.AspNetCore3.WebSockets.SubscriptionsTransportWs;

namespace Tests.WebSockets;

Expand Down
4 changes: 2 additions & 2 deletions src/Tests/WebSockets/WebSocketHandlerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public void CreateSendStream_Old()
_options.ConnectionInitWaitTimeout = Timeout.InfiniteTimeSpan;
var mockSendStream = new Mock<IWebSocketConnection>(MockBehavior.Strict);
var receiveStream = _handler.Do_CreateReceiveStream(mockSendStream.Object, "graphql-transport-ws", _userContext);
receiveStream.ShouldBeOfType<GraphQL.AspNetCore.WebSockets.GraphQLWs.SubscriptionServer>();
receiveStream.ShouldBeOfType<GraphQL.AspNetCore3.WebSockets.GraphQLWs.SubscriptionServer>();
}

[Fact]
Expand All @@ -188,7 +188,7 @@ public void CreateSendStream_New()
_options.ConnectionInitWaitTimeout = Timeout.InfiniteTimeSpan;
var mockSendStream = new Mock<IWebSocketConnection>(MockBehavior.Strict);
var receiveStream = _handler.Do_CreateReceiveStream(mockSendStream.Object, "graphql-ws", _userContext);
receiveStream.ShouldBeOfType<GraphQL.AspNetCore.WebSockets.SubscriptionsTransportWs.SubscriptionServer>();
receiveStream.ShouldBeOfType<GraphQL.AspNetCore3.WebSockets.SubscriptionsTransportWs.SubscriptionServer>();
}

[Fact]
Expand Down

0 comments on commit eb0b9ab

Please sign in to comment.