public GraphQLHttpWriter(GraphQLMiddlewareSettings middlewareSettings)
 {
     this.middlewareSettings = middlewareSettings;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Enables a GraphQL using the specified settings
 /// </summary>
 /// <param name="applicationBuilder"></param>
 /// <param name="graphQLMiddlewareSettings">The settings of the <see cref="GraphQLMiddleware"/></param>
 /// <returns></returns>
 public static IApplicationBuilder UseGraphQL(this IApplicationBuilder applicationBuilder, GraphQLMiddlewareSettings graphQLMiddlewareSettings) =>
 applicationBuilder.UseGraphQL(graphQLMiddlewareSettings, new GraphiQLMiddlewareSettings(), new PlaygroundMiddlewareSettings());
Exemplo n.º 3
0
        /// <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);
        }
        /// <summary>
        /// Enables a GraphQLServer using the specified settings
        /// </summary>
        /// <param name="applicationBuilder"></param>
        /// <param name="graphQLSettings">The settings of the Middleware</param>
        /// <returns></returns>
        public static IApplicationBuilder UseGraphQLServer(this IApplicationBuilder applicationBuilder, GraphQLMiddlewareSettings graphQLSettings)
        {
            if (graphQLSettings == null)
            {
                throw new ArgumentNullException(nameof(graphQLSettings));
            }

            applicationBuilder.UseMiddleware <GraphQLMiddleware>(graphQLSettings);
            return(applicationBuilder);
        }