public GraphQLController()
        {
            _executer = new DocumentExecuter();

            _container = new SimpleContainer();
            _container.Singleton(new StarWarsData());
            _container.Register<StarWarsQuery>();
            _container.Register<HumanType>();
            _container.Register<DroidType>();
            _container.Register<CharacterInterface>();
            _container.Singleton(() => new StarWarsSchema(type => (GraphType) _container.Get(type)));

            _schema = _container.Get<StarWarsSchema>();
        }
        public GraphQLController(
            IDocumentExecuter executer,
            IDocumentWriter writer,
            StarWarsSchema schema)
        {
            _executer = executer;
            _writer = writer;
            _schema = schema;

            _namedQueries = new Dictionary<string, string>
            {
                ["a-query"] = @"query foo { hero { name } }"
            };
        }
예제 #3
0
 public GraphQLController(IDocumentExecuter documentExecuter, ISchema schema)
 {
     _documentExecuter = documentExecuter;
     _schema           = schema;
 }
 public GraphQlController(ISchema schema, IDocumentExecuter executer)
 {
     this.schema   = schema;
     this.executer = executer;
 }
예제 #5
0
 public GraphQLController(IDocumentExecuter documentExecuter, ISchema schema)
 {
     this.documentExecuter = documentExecuter;
     this.schema           = schema;
 }
예제 #6
0
 public RequestExecutor(IDocumentExecuter executer, IDocumentWriter writer)
 {
     _executer = executer;
     _writer   = writer;
 }
예제 #7
0
 public ConfigController(ISchema schema, IDocumentExecuter documentExecuter, IConfiguration configuration)
     : base(schema, documentExecuter, configuration)
 {
 }
예제 #8
0
 public GraphQLController(IDocumentExecuter executer, ISchema schema, DataLoaderDocumentListener dataLoaderDocumentListener = null)
 {
     this.executer = executer;
     this.schema   = schema;
     this.dataLoaderDocumentListener = dataLoaderDocumentListener;
 }
예제 #9
0
 public MainController(ISchema schema, IDocumentExecuter documentExecuter)
 {
     _schema           = schema;
     _documentExecuter = documentExecuter;
 }
예제 #10
0
 public ApplicationExecuter(IServiceProvider serviceProvider, TSchema schema, IDocumentExecuter documentExecuter, IOptions <GraphQLOptions> options, IEnumerable <IDocumentExecutionListener> listeners, IEnumerable <IValidationRule> validationRules)
     : base(schema, documentExecuter, options, listeners, validationRules)
 {
     _serviceProvider = serviceProvider;
 }
예제 #11
0
 public GraphQLController(IDocumentExecuter documentExecuter, ISchema schema, IDocumentWriter writer)
 {
     _documentExecuter = documentExecuter;
     _schema           = schema;
     _writer           = writer;
 }
 public GraphQLController(ISchema schema, IDocumentExecuter documentExecuter)
 {
     this._documentExecuter = documentExecuter;
     this._schema           = schema;
 }
 public GraphQLController(GraphQLQuery GraphQLQuery, IDocumentExecuter DocumentExecuter, ISchema Schema)
 {
     graphQLQuery     = GraphQLQuery;
     documentExecuter = DocumentExecuter;
     schema           = Schema;
 }
 public GraphQLController(ISchema schema, IDocumentExecuter executer, IDocumentWriter writer)
 {
     this.schema   = schema;
     this.executer = executer;
     this.writer   = writer;
 }
예제 #15
0
        public TestBase()
        {
            var services = new ServiceCollection();

            // Services
            services.AddMvc();


            // GraphQL
            services.AddSingleton <IDependencyResolver>(s => new FuncDependencyResolver(s.GetRequiredService));

            _executer = new DocumentExecuter();
            _writer   = new DocumentWriter(indent: true);

            services.AddGraphQL(o =>
            {
                o.ExposeExceptions        = true;
                o.ComplexityConfiguration = new GraphQL.Validation.Complexity.ComplexityConfiguration {
                    MaxDepth = 15
                };
            })
            .AddGraphTypes(ServiceLifetime.Singleton);
            services.AddSingleton <ISchema, RootSchema>();

            services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>();


            // Database
            _db = new DatabaseContext(DatabaseContextMock <DatabaseContext> .InMemoryDatabase());


            // Global objects
            _jobClientMock = new Mock <IBackgroundJobClient>();
            _jobClientMock.Setup(x => x.Create(It.IsAny <Job>(), It.IsAny <EnqueuedState>()));

            _fixture = new Fixture();
            _fixture.Behaviors.OfType <ThrowingRecursionBehavior>().ToList()
            .ForEach(b => _fixture.Behaviors.Remove(b));
            _fixture.Behaviors.Add(new OmitOnRecursionBehavior());


            IContainer container = new Container(cfg =>
            {
                cfg.For <IBackgroundJobClient>().Use(_jobClientMock.Object);
                cfg.For <ISchema>().Use <RootSchema>();
                cfg.For <DatabaseContext>().Use(_db);
                cfg.For(typeof(ILogger <>)).Use(typeof(NullLogger <>));
                cfg.Populate(services);
            });

            _schema = container.GetInstance <ISchema>();

            _jsonSerializerSettings = new JsonSerializerSettings
            {
                ContractResolver = new DefaultContractResolver
                {
                    NamingStrategy = new CamelCaseNamingStrategy()
                },
                Formatting = Formatting.Indented
            };
        }
 public GraphQLController(IDocumentExecuter documentExecuter, ISchema schema, IEnumerable <IValidationRule> validationRules)
 {
     _documentExecuter = documentExecuter;
     _schema           = schema;
     _validationRules  = validationRules;
 }
 public CalendarGraphQLController(IDocumentExecuter documentExecuter, ICalendarSchema schema)
 {
     _documentExecuter = documentExecuter;
     _schema           = schema;
 }
 public CustomerController(ISchema schema, IDocumentExecuter executer)
 {
     _schema   = schema;
     _executer = executer;
 }
예제 #19
0
 public GraphQLController(IDocumentExecuter documentExecuter, LiveScoreSchema schema, IServiceProvider provider)
 {
     _provider         = provider;
     _documentExecuter = documentExecuter;
     _schema           = schema;
 }
예제 #20
0
 public GraphQLController(ISchema schema, IDocumentExecuter documentExecuter, ILogService logService, IConfiguration configuration)
     : base(schema, documentExecuter, logService, configuration)
 {
 }
예제 #21
0
 public GraphQlController(GraphQLQuery graphQLQuery, IDocumentExecuter documentExecuter, ISchema schema)
 {
     _graphQLQuery     = graphQLQuery;
     _documentExecuter = documentExecuter;
     _schema           = schema;
 }
예제 #22
0
 public GraphQLController(IDocumentExecuter executer, IDocumentWriter writer)
 {
     _executer = executer;
     _writer   = writer;
 }
 public GraphQueryExecuter(IDocumentExecuter documentExecuter, ISchema schemaQ)
 {
     executer = documentExecuter;
     schema   = schemaQ;
 }
예제 #24
0
 public GraphQLMiddleware(RequestDelegate next, GraphQLSettings settings, IDocumentWriter writer, IDocumentExecuter executor)
 {
     _next     = next;
     _settings = settings;
     _writer   = writer;
     _executor = executor;
 }
예제 #25
0
 public GraphQLExecutor(ISchema schema, IDocumentExecuter executor)
 {
     _schema   = schema;
     _executor = executor;
 }
예제 #26
0
 public GraphQLController(ISchema schema,
                          IDocumentExecuter executer)
 {
     _schema   = schema;
     _executer = executer;
 }
예제 #27
0
 public GraphQLController(ISchema schema, IDocumentExecuter documentExecuter)
     : base()
 {
     _schema           = schema;
     _documentExecuter = documentExecuter;
 }
예제 #28
0
 public MarketingController(IDocumentExecuter documentExecuter, ISchema schema)
 {
     _documentExecuter = documentExecuter;
     _schema           = schema;
 }
예제 #29
0
 public GraphQLMiddleware(RequestDelegate next, GraphQLSettings settings, IDocumentExecuter executer, IDocumentWriter writer) =>
 (_next, _settings, _executer, _writer) = (next, settings, executer, writer);
예제 #30
0
 public GraphQLController(IDocumentExecuter documentExecuter, ISchema schema, ILogger logger)
 {
     _documentExecuter = documentExecuter;
     _schema           = schema;
     _logger           = logger;
 }
 public GraphQLController(ISchema schema, IDocumentExecuter documentExecuter)
 {
     m_schema           = schema;
     m_documentExecuter = documentExecuter;
 }
예제 #32
0
 public GraphQLController(IDocumentExecuter documentExecuter, ISchema schema, DataLoaderDocumentListener dataLoaderListener)
 {
     _dataLoaderListener = dataLoaderListener;
     _documentExecuter   = documentExecuter;
     _schema             = schema;
 }
예제 #33
0
 public GraphQLController()
 {
     _schema = Startup.Schema;
     _executer = new DocumentExecuter();
 }