示例#1
0
 public NestedQueryType(NestedNonGenericQueryType nestedTypeNonGeneric) : base("NestedQueryType", "")
 {
     this.Field(instance => instance.Id);
     this.Field(instance => instance.StringField);
     this.Field(instance => instance.StringArray);
     this.Field("enumField", instance => instance.Enum);
     this.Field("nested", (int id) => nestedTypeNonGeneric);
     this.Field("defaultField", (IContext <TestObject> context, string argument) => $"{context.Instance.StringField}+{argument}")
     .WithDefaultValue("argument", "defaultArgument");
 }
示例#2
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);
        }
示例#3
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);
        }
示例#4
0
 public NestedQueryType(NestedNonGenericQueryType nestedTypeNonGeneric) : base("NestedQueryType", "")
 {
     this.Field(instance => instance.Id);
     this.Field(instance => instance.StringField);
     this.Field("nested", () => nestedTypeNonGeneric);
 }