public CoolStoreSchema(ICoolStoreResolverService resolverService)
        {
            var schema    = FromIdlAsync().Result;
            var resolvers = new CoolStoreResolvers(resolverService);

            CoolStore = SchemaTools.MakeExecutableSchemaWithIntrospection(
                schema,
                resolvers,
                resolvers).Result;
        }
Esempio n. 2
0
        public CoolStoreSchema(IHttpContextAccessor httpContext, ICoolStoreResolverService resolverService)
        {
            _httpContext = httpContext;
            var schema        = IdlSchema.CreateAsync().Result;
            var schemaBuilder = new SchemaBuilder(schema);
            var resolvers     = new CoolStoreResolvers(resolverService);

            CoolStore = SchemaTools.MakeExecutableSchemaWithIntrospection(
                schemaBuilder,
                resolvers,
                resolvers, new Dictionary <string, CreateDirectiveVisitor>
            {
                ["authorize"] = AuthorizeVisitor()
            });
        }