private IGraphQlExecutor Create(GraphQlOptions options)
        {
            var serviceProvider = serviceProviderFactory.GetServiceProvider(options);

            return(new GraphQlExecutor(serviceProvider, astGenerator, new GraphQlExecutionOptions()
            {
                Query = options.Query,
                Mutation = options.Mutation,
                Subscription = options.Subscription,
                Directives = options.Directives.Select(directiveType => serviceProvider.GetDirective(directiveType)).ToImmutableList(),
                TypeResolver = serviceProvider.GetTypeResolver()
            }, loggerFactory));
        }
        public static IApplicationBuilder UseGraphQl(this IApplicationBuilder builder, GraphQlOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            return(builder.UseMiddleware <GraphQlMiddleware>(Options.Create(options)));
        }
 public static void AddIntrospection(this GraphQlOptions options)
 {
     options.Query = typeof(IntrospectionQuery <>).MakeGenericType(options.Query !);
 }