Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move builder methods to GraphQL namespace #840

Merged
merged 2 commits into from
Jun 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" />
Copy link
Member Author

@Shane32 Shane32 Jun 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really have no idea how the last set of build checks passed in #803 without this being removed. (!!!) The file doesn't exist anymore.

<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