Skip to content

Commit

Permalink
Move builder methods to GraphQL namespace (#840)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane32 authored Jun 26, 2022
1 parent a80ad6a commit ce417d9
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 44 deletions.
1 change: 0 additions & 1 deletion samples/Samples.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using GraphQL.Execution;
using GraphQL.MicrosoftDI;
using GraphQL.Samples.Schemas.Chat;
using GraphQL.Server;
using GraphQL.Server.Transports.AspNetCore;
using GraphQL.Server.Ui.Altair;
using GraphQL.Server.Ui.GraphiQL;
Expand Down
1 change: 0 additions & 1 deletion samples/Samples.Server/StartupWithRouting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using GraphQL.Execution;
using GraphQL.MicrosoftDI;
using GraphQL.Samples.Schemas.Chat;
using GraphQL.Server;
using GraphQL.Server.Transports.AspNetCore;
using GraphQL.Server.Ui.Altair;
using GraphQL.Server.Ui.GraphiQL;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace GraphQL.Server;
namespace GraphQL;

/// <summary>
/// Extension methods for <see cref="IGraphQLBuilder"/>.
/// </summary>
public static class GraphQLBuilderExtensions
public static class ServerGraphQLBuilderExtensions
{
/// <summary>
/// Registers the specified <typeparamref name="TUserContextBuilder"/> as a singleton of
Expand Down
1 change: 0 additions & 1 deletion tests/ApiApprovalTests/ApiApprovalTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Authorization.AspNetCore\Authorization.AspNetCore.csproj" />
<ProjectReference Include="..\..\src\Transports.AspNetCore\Transports.AspNetCore.csproj" />
<ProjectReference Include="..\..\src\Ui.Altair\Ui.Altair.csproj" />
<ProjectReference Include="..\..\src\Ui.GraphiQL\Ui.GraphiQL.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
namespace GraphQL.Server
{
public static class GraphQLBuilderExtensions
{
public static GraphQL.DI.IGraphQLBuilder AddAuthorization(this GraphQL.DI.IGraphQLBuilder builder) { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContextBuilder>(this GraphQL.DI.IGraphQLBuilder builder)
where TUserContextBuilder : class, GraphQL.Server.Transports.AspNetCore.IUserContextBuilder { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, System.Threading.Tasks.Task<TUserContext>> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, TUserContext> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, object?, System.Threading.Tasks.Task<TUserContext>> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, object?, TUserContext> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddWebSocketAuthentication(this GraphQL.DI.IGraphQLBuilder builder, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService webSocketAuthenticationService) { }
public static GraphQL.DI.IGraphQLBuilder AddWebSocketAuthentication(this GraphQL.DI.IGraphQLBuilder builder, System.Func<System.IServiceProvider, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService> factory) { }
public static GraphQL.DI.IGraphQLBuilder AddWebSocketAuthentication<TWebSocketAuthenticationService>(this GraphQL.DI.IGraphQLBuilder builder)
where TWebSocketAuthenticationService : class, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService { }
}
}
namespace GraphQL.Server.Transports.AspNetCore
{
public static class AuthorizationHelper
Expand Down Expand Up @@ -368,6 +347,27 @@ namespace GraphQL.Server.Transports.AspNetCore.WebSockets.SubscriptionsTransport
protected override System.Threading.Tasks.Task SendErrorResultAsync(string id, GraphQL.ExecutionResult result) { }
}
}
namespace GraphQL
{
public static class ServerGraphQLBuilderExtensions
{
public static GraphQL.DI.IGraphQLBuilder AddAuthorization(this GraphQL.DI.IGraphQLBuilder builder) { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContextBuilder>(this GraphQL.DI.IGraphQLBuilder builder)
where TUserContextBuilder : class, GraphQL.Server.Transports.AspNetCore.IUserContextBuilder { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, System.Threading.Tasks.Task<TUserContext>> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, TUserContext> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, object?, System.Threading.Tasks.Task<TUserContext>> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, object?, TUserContext> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddWebSocketAuthentication(this GraphQL.DI.IGraphQLBuilder builder, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService webSocketAuthenticationService) { }
public static GraphQL.DI.IGraphQLBuilder AddWebSocketAuthentication(this GraphQL.DI.IGraphQLBuilder builder, System.Func<System.IServiceProvider, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService> factory) { }
public static GraphQL.DI.IGraphQLBuilder AddWebSocketAuthentication<TWebSocketAuthenticationService>(this GraphQL.DI.IGraphQLBuilder builder)
where TWebSocketAuthenticationService : class, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService { }
}
}
namespace Microsoft.AspNetCore.Builder
{
public class GraphQLEndpointConventionBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
namespace GraphQL.Server
{
public static class GraphQLBuilderExtensions
{
public static GraphQL.DI.IGraphQLBuilder AddAuthorization(this GraphQL.DI.IGraphQLBuilder builder) { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContextBuilder>(this GraphQL.DI.IGraphQLBuilder builder)
where TUserContextBuilder : class, GraphQL.Server.Transports.AspNetCore.IUserContextBuilder { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, System.Threading.Tasks.Task<TUserContext>> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, TUserContext> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, object?, System.Threading.Tasks.Task<TUserContext>> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, object?, TUserContext> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddWebSocketAuthentication(this GraphQL.DI.IGraphQLBuilder builder, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService webSocketAuthenticationService) { }
public static GraphQL.DI.IGraphQLBuilder AddWebSocketAuthentication(this GraphQL.DI.IGraphQLBuilder builder, System.Func<System.IServiceProvider, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService> factory) { }
public static GraphQL.DI.IGraphQLBuilder AddWebSocketAuthentication<TWebSocketAuthenticationService>(this GraphQL.DI.IGraphQLBuilder builder)
where TWebSocketAuthenticationService : class, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService { }
}
public static class ServiceCollectionExtensions
{
public static void AddHostApplicationLifetime(this Microsoft.Extensions.DependencyInjection.IServiceCollection services) { }
Expand Down Expand Up @@ -383,6 +365,27 @@ namespace GraphQL.Server.Transports.AspNetCore.WebSockets.SubscriptionsTransport
protected override System.Threading.Tasks.Task SendErrorResultAsync(string id, GraphQL.ExecutionResult result) { }
}
}
namespace GraphQL
{
public static class ServerGraphQLBuilderExtensions
{
public static GraphQL.DI.IGraphQLBuilder AddAuthorization(this GraphQL.DI.IGraphQLBuilder builder) { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContextBuilder>(this GraphQL.DI.IGraphQLBuilder builder)
where TUserContextBuilder : class, GraphQL.Server.Transports.AspNetCore.IUserContextBuilder { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, System.Threading.Tasks.Task<TUserContext>> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, TUserContext> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, object?, System.Threading.Tasks.Task<TUserContext>> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddUserContextBuilder<TUserContext>(this GraphQL.DI.IGraphQLBuilder builder, System.Func<Microsoft.AspNetCore.Http.HttpContext, object?, TUserContext> creator)
where TUserContext : class, System.Collections.Generic.IDictionary<string, object?> { }
public static GraphQL.DI.IGraphQLBuilder AddWebSocketAuthentication(this GraphQL.DI.IGraphQLBuilder builder, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService webSocketAuthenticationService) { }
public static GraphQL.DI.IGraphQLBuilder AddWebSocketAuthentication(this GraphQL.DI.IGraphQLBuilder builder, System.Func<System.IServiceProvider, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService> factory) { }
public static GraphQL.DI.IGraphQLBuilder AddWebSocketAuthentication<TWebSocketAuthenticationService>(this GraphQL.DI.IGraphQLBuilder builder)
where TWebSocketAuthenticationService : class, GraphQL.Server.Transports.AspNetCore.WebSockets.IWebSocketAuthenticationService { }
}
}
namespace Microsoft.AspNetCore.Builder
{
public static class GraphQLHttpApplicationBuilderExtensions
Expand Down

0 comments on commit ce417d9

Please sign in to comment.