mirror of
https://github.com/Shchoholiev/shopping-assistant-api.git
synced 2025-04-04 16:49:36 +00:00
27 lines
845 B
C#
27 lines
845 B
C#
using ShoppingAssistantApi.Api.Queries;
|
|
using ShoppingAssistantApi.Api.Mutations;
|
|
|
|
namespace ShoppingAssistantApi.Api.ApiExtentions;
|
|
|
|
public static class GraphQlExtention
|
|
{
|
|
public static IServiceCollection AddGraphQl(this IServiceCollection services)
|
|
{
|
|
services
|
|
.AddGraphQLServer()
|
|
.AddQueryType()
|
|
.AddTypeExtension<UsersQuery>()
|
|
.AddTypeExtension<RolesQuery>()
|
|
.AddTypeExtension<WishlistsQuery>()
|
|
.AddMutationType()
|
|
.AddTypeExtension<AccessMutation>()
|
|
.AddTypeExtension<UsersMutation>()
|
|
.AddTypeExtension<RolesMutation>()
|
|
.AddTypeExtension<WishlistsMutation>()
|
|
.AddAuthorization()
|
|
.InitializeOnStartup(keepWarm: true);
|
|
|
|
return services;
|
|
}
|
|
}
|