/// <summary> /// Enables a GraphQL using the specified settings /// </summary> /// <param name="applicationBuilder"></param> /// <param name="graphQLMiddlewareSettings">The settings of the <see cref="GraphQLMiddleware"/></param> /// <param name="graphiQLMiddlewareSettings">The settings of the <see cref="GraphiQLMiddleware"/></param> /// <param name="playgroundMiddlewareSettings">The settings of the <see cref="PlaygroundMiddleware"/></param> /// <returns></returns> public static IApplicationBuilder UseGraphQL(this IApplicationBuilder applicationBuilder, GraphQLMiddlewareSettings graphQLMiddlewareSettings, GraphiQLMiddlewareSettings graphiQLMiddlewareSettings, PlaygroundMiddlewareSettings playgroundMiddlewareSettings) { if (graphQLMiddlewareSettings == null) { throw new ArgumentNullException(nameof(graphQLMiddlewareSettings)); } if (graphiQLMiddlewareSettings == null) { throw new ArgumentNullException(nameof(graphiQLMiddlewareSettings)); } if (playgroundMiddlewareSettings == null) { throw new ArgumentNullException(nameof(playgroundMiddlewareSettings)); } applicationBuilder.UseGraphQLServer(graphQLMiddlewareSettings); applicationBuilder.UseGraphiQLServer(graphiQLMiddlewareSettings); applicationBuilder.UsePlaygroundServer(playgroundMiddlewareSettings); return(applicationBuilder); }
public GraphiQLPageModel(GraphiQLMiddlewareSettings settings) { this.settings = settings; }
/// <summary> /// Enables a GraphiQLServer using the specified settings /// </summary> /// <param name="applicationBuilder"></param> /// <param name="settings">The settings of the Middleware</param> /// <returns></returns> public static IApplicationBuilder UseGraphiQLServer(this IApplicationBuilder applicationBuilder, GraphiQLMiddlewareSettings settings) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } applicationBuilder.UseMiddleware <GraphiQLMiddleware>(settings); return(applicationBuilder); }