Files
xDataService/Interfaces/IXGraphQLHelper.cs
T
2024-01-25 04:41:17 +03:30

75 lines
3.1 KiB
C#

using GraphQL.Server;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
namespace xDataService.Interfaces {
/// <summary>
/// this is a helper class which provides all requirements to providing GraphQL
/// based data manipulating mechanism ...
/// </summary>
public interface IXGraphQLHelper {
/// <summary>
/// Register all GraphQL Enum Types ...
/// Enum Types use to Map string values to Enum values in propper way and vise versa in GraphQL ...
/// must extended from EnumerationGraphType ...
/// </summary>
void AddXGraphEnumTypes (IServiceCollection services);
/// <summary>
/// Register all GraphQL Object Types ...
/// GraphQL works based on Types, so for representing each data you have to define a Type ...
/// must extended from ObjectGraphType<T> or XBaseGraphObjectType<TKey>
/// </summary>
void AddXGraphObjectTypes (IServiceCollection services);
/// <summary>
/// Register all GraphQL Input Types ...
/// InputTypes represent recieving data structure in GraphQL for doing mutations ...
/// must extended from InputObjectGraphType<T> ...
/// </summary>
void AddXGraphInputTypes (IServiceCollection services);
/// <summary>
/// Register all GraphQL Queries ...
/// Queries in GraphQL used to provide data fetch and retrieve mechanism ...
/// extended from ObjectGraphType ...
/// </summary>
void AddXGraphQueries (IServiceCollection services);
/// <summary>
/// Register all GraphQL Mutations ...
/// Mutations is an Action types in GraphQL which data changed through them, like as Add, Update, Delete ...
/// must extends from ObjectGraphType ...
/// </summary>
void AddXGraphMutations (IServiceCollection services);
/// <summary>
/// Register all GraphQL Subscriptions ...
/// Subscriptions are listeners to specific events on data in GraphQL ...
/// must extended from ObjectGraphType and implements IXBaseRepositoryEvents<TEntity> ...
/// </summary>
void AddXGraphSubscriptions (IServiceCollection services);
/// <summary>
/// Register all GraphQL Schemas ...
/// each available Entity in Database must described to GraphQL with all Graph based stuffs such as :
/// Queries, Types and etc, this must done through an Schema class.
/// must extended from Schema ...
/// </summary>
void AddXGraphSchemas (IServiceCollection services);
/// <summary>
/// Add Schemas to GraphQL Builder ...
/// here you must add all registered Schemas to GraphQLBuilder ...
/// </summary>
/// <param name="builder"></param>
/// <returns></returns>
IGraphQLBuilder AddXGraphTypes (IGraphQLBuilder builder);
/// <summary>
/// Use all Registered Schemas by GraphQL<T> and and GraphQLWebSockets<T> ...
/// </summary>
/// <param name="app"></param>
void UseXGraph (IApplicationBuilder app);
}
}