Пример #1
0
        public void SetUp()
        {
            this.schema = new GraphQLSchema();

            var rootType   = new RootQueryType();
            var nestedType = new NestedQueryType();

            nestedType.Field("howdy", () => "xzyt");

            var anotherSestedType = new AnotherNestedQueryType();

            anotherSestedType.Field("stuff", () => "a");

            nestedType.Field("anotherNested", () => anotherSestedType);
            rootType.Field("nested", () => nestedType);

            var typeWithAccessor = new CustomObject();

            typeWithAccessor.Field("Hello", e => e.Hello);
            typeWithAccessor.Field("Test", e => e.Test);

            rootType.Field("acessorBasedProp", () => new TestType()
            {
                Hello = "world", Test = "stuff"
            });

            this.schema.AddKnownType(rootType);
            this.schema.AddKnownType(anotherSestedType);
            this.schema.AddKnownType(nestedType);
            this.schema.AddKnownType(typeWithAccessor);
            this.schema.Query(rootType);
        }
Пример #2
0
        public void SetUp()
        {
            this.schema = new GraphQLSchema();
            var nestedType = new NestedQueryType(this.schema);
            var rootType   = new RootQueryType(nestedType, this.schema);

            this.schema.Query(rootType);
        }
        public void SetUp()
        {
            this.schema = new GraphQLSchema();

            var rootType   = new RootQueryType();
            var nestedType = new NestedQueryType();

            nestedType.Field("howdy", () => "xzyt");

            var anotherSestedType = new AnotherNestedQueryType();

            anotherSestedType.Field("stuff", () => "a");

            nestedType.Field("anotherNested", () => anotherSestedType);
            rootType.Field("nested", () => nestedType);

            var typeWithAccessor = new CustomObject();

            typeWithAccessor.Field("Hello", e => e.Hello);
            typeWithAccessor.Field("Test", e => e.Test);

            var anotherTypeWithAccessor = new AnotherCustomObject();

            anotherTypeWithAccessor.Field("Hello", e => e.Hello);
            anotherTypeWithAccessor.Field("World", e => e.World);

            var customInterface = new CustomInterface();

            customInterface.Field("hello", e => e.Hello);

            rootType.Field("acessorBasedProp", () => new TestType()
            {
                Hello = "world", Test = "stuff"
            });
            rootType.Field("testTypes", () => new ITestInterface[] {
                new TestType {
                    Hello = "world", Test = "stuff"
                },
                new AnotherTestType {
                    Hello = "world", World = "hello"
                }
            });

            this.schema.AddKnownType(new TestEnumType());
            this.schema.AddKnownType(rootType);
            this.schema.AddKnownType(anotherSestedType);
            this.schema.AddKnownType(nestedType);
            this.schema.AddKnownType(typeWithAccessor);
            this.schema.AddKnownType(anotherTypeWithAccessor);
            this.schema.AddKnownType(customInterface);
            this.schema.Query(rootType);
        }
Пример #4
0
        public void SetUp()
        {
            this.schema = new GraphQLSchema();
            var rootType             = new RootQueryType(this.schema);
            var nestedTypeNonGeneric = new NestedNonGenericQueryType();
            var nestedType           = new NestedQueryType(nestedTypeNonGeneric);

            this.schema.AddKnownType(rootType);
            this.schema.AddKnownType(nestedTypeNonGeneric);
            this.schema.AddKnownType(nestedType);

            this.schema.Query(rootType);
        }
        public void SetUp()
        {
            this.schema = new GraphQLSchema();
            var rootType   = new RootQueryType(this.schema);
            var nestedType = new NestedQueryType();
            var mutation   = new RootMutationType(this.schema);

            this.schema.AddKnownType(rootType);
            this.schema.AddKnownType(nestedType);
            this.schema.AddKnownType(mutation);

            this.schema.Query(rootType);
            this.schema.Mutation(mutation);
        }
Пример #6
0
        public void SetUp()
        {
            this.schema = new GraphQLSchema();
            var rootType             = new RootQueryType(this.schema);
            var nestedTypeNonGeneric = new NestedNonGenericQueryType();
            var nestedType           = new NestedQueryType(nestedTypeNonGeneric);

            this.schema.AddKnownType(rootType);
            this.schema.AddKnownType(nestedTypeNonGeneric);
            this.schema.AddKnownType(nestedType);
            this.schema.AddKnownType(new InputTestObjectType());
            this.schema.AddKnownType(new TestEnumType());
            this.schema.AddOrReplaceDirective(new DefaultArgumentDirectiveType());

            this.schema.Query(rootType);
        }
Пример #7
0
 public RootQueryType(NestedQueryType nested) : base("RootQueryType", "")
 {
     this.Field("nested", () => nested);
 }
Пример #8
0
 public RootQueryType(NestedQueryType nested, GraphQLSchema schema) : base("RootQueryType", "")
 {
     this.Field("a", () => "world");
     this.Field("b", () => "test");
     this.Field("nested", () => nested);
 }