diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/FilterInputTypeTests.cs b/src/HotChocolate/Data/test/Data.Filters.Tests/FilterInputTypeTests.cs index 868b7a80767..1929e23e7bd 100644 --- a/src/HotChocolate/Data/test/Data.Filters.Tests/FilterInputTypeTests.cs +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/FilterInputTypeTests.cs @@ -9,18 +9,20 @@ namespace HotChocolate.Data.Tests { public class FilterInputTypeTest - : FilterTestBase + : FilterTestBase { [Fact] public void FilterInputType_DynamicName() { // arrange // act - ISchema schema = CreateSchema(s => s.AddType(new FilterInputType( - d => d - .Name(dep => dep.Name + "Foo") - .DependsOn() - .Field(x => x.Bar)))); + ISchema schema = CreateSchema( + s => s.AddType( + new FilterInputType( + d => d + .Name(dep => dep.Name + "Foo") + .DependsOn() + .Field(x => x.Bar)))); // assert schema.ToString().MatchSnapshot(); @@ -31,10 +33,12 @@ public void FilterInputType_DynamicName_NonGeneric() { // arrange // act - ISchema schema = CreateSchema(s => s.AddType(new FilterInputType( - d => d.Name(dep => dep.Name + "Foo") - .DependsOn(typeof(StringType)) - .Field(x => x.Bar)))); + ISchema schema = CreateSchema( + s => s.AddType( + new FilterInputType( + d => d.Name(dep => dep.Name + "Foo") + .DependsOn(typeof(StringType)) + .Field(x => x.Bar)))); // assert schema.ToString().MatchSnapshot(); @@ -45,10 +49,12 @@ public void FilterInput_AddDirectives_NameArgs() { // arrange // act - ISchema schema = CreateSchema(s => s.AddDirectiveType() - .AddType(new FilterInputType( - d => d.Directive("foo") - .Field(x => x.Bar)))); + ISchema schema = CreateSchema( + s => s.AddDirectiveType() + .AddType( + new FilterInputType( + d => d.Directive("foo") + .Field(x => x.Bar)))); // assert schema.ToString().MatchSnapshot(); @@ -59,12 +65,14 @@ public void FilterInput_AddDirectives_NameArgs2() { // arrange // act - ISchema schema = CreateSchema(s => s.AddDirectiveType() - .AddType(new FilterInputType( - d => d.Directive(new NameString("foo")) - .Field(x => x.Bar) + ISchema schema = CreateSchema( + s => s.AddDirectiveType() + .AddType( + new FilterInputType( + d => d.Directive(new NameString("foo")) + .Field(x => x.Bar) + ) ) - ) ); // assert @@ -76,10 +84,11 @@ public void FilterInput_AddDirectives_DirectiveNode() { // arrange // act - ISchema schema = CreateSchema(s => s.AddDirectiveType() - .AddType( - new FilterInputType( - d => d.Directive(new DirectiveNode("foo")).Field(x => x.Bar)))); + ISchema schema = CreateSchema( + s => s.AddDirectiveType() + .AddType( + new FilterInputType( + d => d.Directive(new DirectiveNode("foo")).Field(x => x.Bar)))); // assert schema.ToString().MatchSnapshot(); @@ -90,10 +99,13 @@ public void FilterInput_AddDirectives_DirectiveClassInstance() { // arrange // act - ISchema schema = CreateSchema(s => s.AddDirectiveType() - .AddType(new FilterInputType(d => d - .Directive(new FooDirective()) - .Field(x => x.Bar)))); + ISchema schema = CreateSchema( + s => s.AddDirectiveType() + .AddType( + new FilterInputType( + d => d + .Directive(new FooDirective()) + .Field(x => x.Bar)))); // assert schema.ToString().MatchSnapshot(); @@ -104,10 +116,13 @@ public void FilterInput_AddDirectives_DirectiveType() { // arrange // act - ISchema schema = CreateSchema(s => s.AddDirectiveType() - .AddType(new FilterInputType(d => d - .Directive() - .Field(x => x.Bar)))); + ISchema schema = CreateSchema( + s => s.AddDirectiveType() + .AddType( + new FilterInputType( + d => d + .Directive() + .Field(x => x.Bar)))); // assert schema.ToString().MatchSnapshot(); @@ -118,8 +133,10 @@ public void FilterInput_AddDescription() { // arrange // act - ISchema schema = CreateSchema(s => s.AddType(new FilterInputType( - d => d.Description("Test").Field(x => x.Bar)))); + ISchema schema = CreateSchema( + s => s.AddType( + new FilterInputType( + d => d.Description("Test").Field(x => x.Bar)))); // assert schema.ToString().MatchSnapshot(); @@ -130,8 +147,97 @@ public void FilterInput_AddName() { // arrange // act - ISchema schema = CreateSchema(s => s.AddType(new FilterInputType( - d => d.Name("Test").Field(x => x.Bar)))); + ISchema schema = CreateSchema( + s => s.AddType( + new FilterInputType( + d => d.Name("Test").Field(x => x.Bar)))); + + // assert + schema.ToString().MatchSnapshot(); + } + + [Fact] + public void FilterInputType_ImplicitBinding() + { + // arrange + // act + ISchema schema = SchemaBuilder.New() + .ModifyOptions(x => x.DefaultBindingBehavior = BindingBehavior.Explicit) + .AddFiltering() + .AddType(new ObjectType(x => x.Field(x => x.Bar))) + .AddQueryType( + c => + c.Name("Query") + .Field("foo") + .Type>() + .Resolver("bar") + .UseFiltering(x => x.BindFieldsImplicitly())) + .Create(); + + // assert + schema.ToString().MatchSnapshot(); + } + + [Fact] + public void FilterInputType_ImplicitBinding_BindFields() + { + // arrange + // act + ISchema schema = SchemaBuilder.New() + .ModifyOptions(x => x.DefaultBindingBehavior = BindingBehavior.Explicit) + .AddFiltering() + .AddType(new ObjectType(x => x.Field(x => x.Bar))) + .AddQueryType( + c => + c.Name("Query") + .Field("foo") + .Type>() + .Resolver("bar") + .UseFiltering(x => x.BindFields(BindingBehavior.Implicit))) + .Create(); + + // assert + schema.ToString().MatchSnapshot(); + } + + [Fact] + public void FilterInputType_ExplicitBinding() + { + // arrange + // act + ISchema schema = SchemaBuilder.New() + .ModifyOptions(x => x.DefaultBindingBehavior = BindingBehavior.Implicit) + .AddFiltering() + .AddQueryType( + c => + c.Name("Query") + .Field("foo") + .Type>() + .Resolver("bar") + .UseFiltering(x => x.BindFieldsExplicitly().Field(y => y.Qux))) + .Create(); + + // assert + schema.ToString().MatchSnapshot(); + } + + [Fact] + public void FilterInputType_ExplicitBinding_BindFields() + { + // arrange + // act + ISchema schema = SchemaBuilder.New() + .ModifyOptions(x => x.DefaultBindingBehavior = BindingBehavior.Implicit) + .AddFiltering() + .AddQueryType( + c => + c.Name("Query") + .Field("foo") + .Type>() + .Resolver("bar") + .UseFiltering( + x => x.BindFields(BindingBehavior.Explicit).Field(y => y.Qux))) + .Create(); // assert schema.ToString().MatchSnapshot(); @@ -149,13 +255,22 @@ public class FooDirectiveType } } - public class FooDirective { } + public class FooDirective + { + } public class Foo { public string Bar { get; set; } } + public class Bar + { + public string Baz { get; set; } + + public string Qux { get; set; } + } + public class Query { [GraphQLNonNullType] @@ -165,10 +280,13 @@ public class Query public class Book { public int Id { get; set; } + [GraphQLNonNullType] public string Title { get; set; } + public int Pages { get; set; } public int Chapters { get; set; } + [GraphQLNonNullType] public Author Author { get; set; } } @@ -177,6 +295,7 @@ public class Author { [GraphQLType(typeof(NonNullType))] public int Id { get; set; } + [GraphQLNonNullType] public string Name { get; set; } } diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding.snap b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding.snap new file mode 100644 index 00000000000..f17ce22f99b --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding.snap @@ -0,0 +1,36 @@ +schema { + query: Query +} + +type Bar { + baz: String! + qux: String! +} + +type Query { + foo(where: BarFilterInput): Bar +} + +input BarFilterInput { + and: [BarFilterInput!] + or: [BarFilterInput!] + qux: StringOperationFilterInput +} + +input StringOperationFilterInput { + and: [StringOperationFilterInput!] + or: [StringOperationFilterInput!] + eq: String + neq: String + contains: String + ncontains: String + in: [String] + nin: [String] + startsWith: String + nstartsWith: String + endsWith: String + nendsWith: String +} + +"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text." +scalar String diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding_BindFields.snap b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding_BindFields.snap new file mode 100644 index 00000000000..f17ce22f99b --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding_BindFields.snap @@ -0,0 +1,36 @@ +schema { + query: Query +} + +type Bar { + baz: String! + qux: String! +} + +type Query { + foo(where: BarFilterInput): Bar +} + +input BarFilterInput { + and: [BarFilterInput!] + or: [BarFilterInput!] + qux: StringOperationFilterInput +} + +input StringOperationFilterInput { + and: [StringOperationFilterInput!] + or: [StringOperationFilterInput!] + eq: String + neq: String + contains: String + ncontains: String + in: [String] + nin: [String] + startsWith: String + nstartsWith: String + endsWith: String + nendsWith: String +} + +"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text." +scalar String diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding.snap b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding.snap new file mode 100644 index 00000000000..57b13c5d743 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding.snap @@ -0,0 +1,35 @@ +schema { + query: Query +} + +type Foo { + bar: String! +} + +type Query { + foo(where: FooFilterInput): Foo +} + +input FooFilterInput { + and: [FooFilterInput!] + or: [FooFilterInput!] + bar: StringOperationFilterInput +} + +input StringOperationFilterInput { + and: [StringOperationFilterInput!] + or: [StringOperationFilterInput!] + eq: String + neq: String + contains: String + ncontains: String + in: [String] + nin: [String] + startsWith: String + nstartsWith: String + endsWith: String + nendsWith: String +} + +"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text." +scalar String diff --git a/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding_BindFields.snap b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding_BindFields.snap new file mode 100644 index 00000000000..57b13c5d743 --- /dev/null +++ b/src/HotChocolate/Data/test/Data.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding_BindFields.snap @@ -0,0 +1,35 @@ +schema { + query: Query +} + +type Foo { + bar: String! +} + +type Query { + foo(where: FooFilterInput): Foo +} + +input FooFilterInput { + and: [FooFilterInput!] + or: [FooFilterInput!] + bar: StringOperationFilterInput +} + +input StringOperationFilterInput { + and: [StringOperationFilterInput!] + or: [StringOperationFilterInput!] + eq: String + neq: String + contains: String + ncontains: String + in: [String] + nin: [String] + startsWith: String + nstartsWith: String + endsWith: String + nendsWith: String +} + +"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text." +scalar String diff --git a/src/HotChocolate/Filters/src/Types.Filters/FilterInputTypeDescriptor.cs b/src/HotChocolate/Filters/src/Types.Filters/FilterInputTypeDescriptor.cs index 82c65639035..c58f62598c3 100644 --- a/src/HotChocolate/Filters/src/Types.Filters/FilterInputTypeDescriptor.cs +++ b/src/HotChocolate/Filters/src/Types.Filters/FilterInputTypeDescriptor.cs @@ -153,6 +153,7 @@ public IFilterInputTypeDescriptor Directive() if (type == typeof(string)) { var field = new StringFilterFieldDescriptor(Context, property); + field.BindFilters(Definition.Fields.BindingBehavior); definition = field.CreateDefinition(); return true; } @@ -162,6 +163,7 @@ public IFilterInputTypeDescriptor Directive() var field = new BooleanFilterFieldDescriptor( Context, property); + field.BindFilters(Definition.Fields.BindingBehavior); definition = field.CreateDefinition(); return true; } @@ -171,6 +173,7 @@ public IFilterInputTypeDescriptor Directive() var field = new ComparableFilterFieldDescriptor( Context, property); + field.BindFilters(Definition.Fields.BindingBehavior); definition = field.CreateDefinition(); return true; } @@ -194,6 +197,7 @@ public IFilterInputTypeDescriptor Directive() field = new ArrayFilterFieldDescriptor(Context, property, elementType); } + field.BindFilters(Definition.Fields.BindingBehavior); definition = field.CreateDefinition(); return true; } @@ -204,6 +208,7 @@ public IFilterInputTypeDescriptor Directive() Context, property, property.PropertyType); + field.BindFilters(Definition.Fields.BindingBehavior); definition = field.CreateDefinition(); return true; } diff --git a/src/HotChocolate/Filters/test/Types.Filters.Tests/FilterInputTypeTest.cs b/src/HotChocolate/Filters/test/Types.Filters.Tests/FilterInputTypeTest.cs index 4a3f93537a9..bcfe3440d00 100644 --- a/src/HotChocolate/Filters/test/Types.Filters.Tests/FilterInputTypeTest.cs +++ b/src/HotChocolate/Filters/test/Types.Filters.Tests/FilterInputTypeTest.cs @@ -9,19 +9,20 @@ namespace HotChocolate.Types.Filters public class FilterInputTypeTest : TypeTestBase { - [Fact] public void FilterInputType_DynamicName() { // arrange // act - ISchema schema = CreateSchema(s => s.AddType( - new FilterInputType(d => d - .Name(dep => dep.Name + "Foo") - .DependsOn() - .Filter(x => x.Bar) - .BindFiltersExplicitly() - .AllowEquals()))); + ISchema schema = CreateSchema( + s => s.AddType( + new FilterInputType( + d => d + .Name(dep => dep.Name + "Foo") + .DependsOn() + .Filter(x => x.Bar) + .BindFiltersExplicitly() + .AllowEquals()))); // assert schema.ToString().MatchSnapshot(); @@ -32,13 +33,15 @@ public void FilterInputType_DynamicName_NonGeneric() { // arrange // act - ISchema schema = CreateSchema(s => s.AddType( - new FilterInputType(d => d - .Name(dep => dep.Name + "Foo") - .DependsOn(typeof(StringType)) - .Filter(x => x.Bar) - .BindFiltersExplicitly() - .AllowEquals()))); + ISchema schema = CreateSchema( + s => s.AddType( + new FilterInputType( + d => d + .Name(dep => dep.Name + "Foo") + .DependsOn(typeof(StringType)) + .Filter(x => x.Bar) + .BindFiltersExplicitly() + .AllowEquals()))); // assert @@ -50,13 +53,16 @@ public void FilterInput_AddDirectives_NameArgs() { // arrange // act - ISchema schema = CreateSchema(s => s - .AddDirectiveType() - .AddType(new FilterInputType(d => d - .Directive("foo") - .Filter(x => x.Bar) - .BindFiltersExplicitly() - .AllowEquals()))); + ISchema schema = CreateSchema( + s => s + .AddDirectiveType() + .AddType( + new FilterInputType( + d => d + .Directive("foo") + .Filter(x => x.Bar) + .BindFiltersExplicitly() + .AllowEquals()))); // assert schema.ToString().MatchSnapshot(); @@ -67,13 +73,16 @@ public void FilterInput_AddDirectives_NameArgs2() { // arrange // act - ISchema schema = CreateSchema(s => s - .AddDirectiveType() - .AddType(new FilterInputType(d => d - .Directive(new NameString("foo")) - .Filter(x => x.Bar) - .BindFiltersExplicitly() - .AllowEquals()))); + ISchema schema = CreateSchema( + s => s + .AddDirectiveType() + .AddType( + new FilterInputType( + d => d + .Directive(new NameString("foo")) + .Filter(x => x.Bar) + .BindFiltersExplicitly() + .AllowEquals()))); // assert schema.ToString().MatchSnapshot(); @@ -84,13 +93,16 @@ public void FilterInput_AddDirectives_DirectiveNode() { // arrange // act - ISchema schema = CreateSchema(s => s - .AddDirectiveType() - .AddType(new FilterInputType(d => d - .Directive(new DirectiveNode("foo")) - .Filter(x => x.Bar) - .BindFiltersExplicitly() - .AllowEquals()))); + ISchema schema = CreateSchema( + s => s + .AddDirectiveType() + .AddType( + new FilterInputType( + d => d + .Directive(new DirectiveNode("foo")) + .Filter(x => x.Bar) + .BindFiltersExplicitly() + .AllowEquals()))); // assert schema.ToString().MatchSnapshot(); @@ -101,13 +113,16 @@ public void FilterInput_AddDirectives_DirectiveClassInstance() { // arrange // act - ISchema schema = CreateSchema(s => s - .AddDirectiveType() - .AddType(new FilterInputType(d => d - .Directive(new FooDirective()) - .Filter(x => x.Bar) - .BindFiltersExplicitly() - .AllowEquals()))); + ISchema schema = CreateSchema( + s => s + .AddDirectiveType() + .AddType( + new FilterInputType( + d => d + .Directive(new FooDirective()) + .Filter(x => x.Bar) + .BindFiltersExplicitly() + .AllowEquals()))); // assert schema.ToString().MatchSnapshot(); @@ -118,13 +133,16 @@ public void FilterInput_AddDirectives_DirectiveType() { // arrange // act - ISchema schema = CreateSchema(s => s - .AddDirectiveType() - .AddType(new FilterInputType(d => d - .Directive() - .Filter(x => x.Bar) - .BindFiltersExplicitly() - .AllowEquals()))); + ISchema schema = CreateSchema( + s => s + .AddDirectiveType() + .AddType( + new FilterInputType( + d => d + .Directive() + .Filter(x => x.Bar) + .BindFiltersExplicitly() + .AllowEquals()))); // assert schema.ToString().MatchSnapshot(); @@ -135,12 +153,15 @@ public void FilterInput_AddDescription() { // arrange // act - ISchema schema = CreateSchema(s => s - .AddType(new FilterInputType(d => d - .Description("Test") - .Filter(x => x.Bar) - .BindFiltersExplicitly() - .AllowEquals()))); + ISchema schema = CreateSchema( + s => s + .AddType( + new FilterInputType( + d => d + .Description("Test") + .Filter(x => x.Bar) + .BindFiltersExplicitly() + .AllowEquals()))); // assert schema.ToString().MatchSnapshot(); @@ -151,12 +172,15 @@ public void FilterInput_AddName() { // arrange // act - ISchema schema = CreateSchema(s => s - .AddType(new FilterInputType(d => d - .Name("Test") - .Filter(x => x.Bar) - .BindFiltersExplicitly() - .AllowEquals()))); + ISchema schema = CreateSchema( + s => s + .AddType( + new FilterInputType( + d => d + .Name("Test") + .Filter(x => x.Bar) + .BindFiltersExplicitly() + .AllowEquals()))); // assert schema.ToString().MatchSnapshot(); @@ -168,10 +192,99 @@ public void FilterAttribute_NonNullType() // arrange // act ISchema schema = SchemaBuilder.New() - .AddQueryType(d => d - .Name("Test") - .Field(x => x.Books()) - .UseFiltering()) + .AddQueryType( + d => d + .Name("Test") + .Field(x => x.Books()) + .UseFiltering()) + .Create(); + + // assert + schema.ToString().MatchSnapshot(); + } + + [Fact] + public void FilterInputType_ImplicitBinding() + { + // arrange + // act + ISchema schema = SchemaBuilder.New() + .ModifyOptions(x => x.DefaultBindingBehavior = BindingBehavior.Explicit) + .AddType(new ObjectType(x => x.Field(x => x.Bar))) + .AddQueryType( + c => + c.Name("Query") + .Field("foo") + .Type>() + .Resolver("bar") + .UseFiltering(x => x.BindFieldsImplicitly())) + .Create(); + + // assert + schema.ToString().MatchSnapshot(); + } + + [Fact] + public void FilterInputType_ImplicitBinding_BindFields() + { + // arrange + // act + ISchema schema = SchemaBuilder.New() + .ModifyOptions(x => x.DefaultBindingBehavior = BindingBehavior.Explicit) + .AddType(new ObjectType(x => x.Field(x => x.Bar))) + .AddQueryType( + c => + c.Name("Query") + .Field("foo") + .Type>() + .Resolver("bar") + .UseFiltering(x => x.BindFields(BindingBehavior.Implicit))) + .Create(); + + // assert + schema.ToString().MatchSnapshot(); + } + + [Fact] + public void FilterInputType_ExplicitBinding() + { + // arrange + // act + ISchema schema = SchemaBuilder.New() + .ModifyOptions(x => x.DefaultBindingBehavior = BindingBehavior.Implicit) + .AddQueryType( + c => + c.Name("Query") + .Field("foo") + .Type>() + .Resolver("bar") + .UseFiltering( + x => x.BindFields(BindingBehavior.Explicit) + .Filter(y => y.Baz) + .AllowContains())) + .Create(); + + // assert + schema.ToString().MatchSnapshot(); + } + + [Fact] + public void FilterInputType_ExplicitBinding_BindFields() + { + // arrange + // act + ISchema schema = SchemaBuilder.New() + .ModifyOptions(x => x.DefaultBindingBehavior = BindingBehavior.Implicit) + .AddQueryType( + c => + c.Name("Query") + .Field("foo") + .Type>() + .Resolver("bar") + .UseFiltering( + x => x.BindFields(BindingBehavior.Explicit) + .Filter(y => y.Baz) + .AllowContains())) .Create(); // assert @@ -190,13 +303,22 @@ public class FooDirectiveType } } - public class FooDirective { } + public class FooDirective + { + } public class Foo { public string Bar { get; set; } } + public class Bar + { + public string Baz { get; set; } + + public string Qux { get; set; } + } + public class Query { [GraphQLNonNullType(false, false)] @@ -206,14 +328,14 @@ public class Query public class Book { public int Id { get; set; } - + [GraphQLNonNullType] public string Title { get; set; } - + public int Pages { get; set; } - + public int Chapters { get; set; } - + [GraphQLNonNullType] public Author Author { get; set; } } @@ -222,7 +344,7 @@ public class Author { [GraphQLType(typeof(NonNullType))] public int Id { get; set; } - + [GraphQLNonNullType] public string Name { get; set; } } diff --git a/src/HotChocolate/Filters/test/Types.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding.snap b/src/HotChocolate/Filters/test/Types.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding.snap new file mode 100644 index 00000000000..a67bb86dcb6 --- /dev/null +++ b/src/HotChocolate/Filters/test/Types.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding.snap @@ -0,0 +1,30 @@ +schema { + query: Query +} + +type Bar { + baz: String + qux: String +} + +type Query { + foo(where: BarFilter): Bar +} + +input BarFilter { + AND: [BarFilter!] + OR: [BarFilter!] + baz_contains: String + baz: String + baz_not: String + baz_not_contains: String + baz_starts_with: String + baz_not_starts_with: String + baz_ends_with: String + baz_not_ends_with: String + baz_in: [String] + baz_not_in: [String] +} + +"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text." +scalar String diff --git a/src/HotChocolate/Filters/test/Types.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding_BindFields.snap b/src/HotChocolate/Filters/test/Types.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding_BindFields.snap new file mode 100644 index 00000000000..a67bb86dcb6 --- /dev/null +++ b/src/HotChocolate/Filters/test/Types.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ExplicitBinding_BindFields.snap @@ -0,0 +1,30 @@ +schema { + query: Query +} + +type Bar { + baz: String + qux: String +} + +type Query { + foo(where: BarFilter): Bar +} + +input BarFilter { + AND: [BarFilter!] + OR: [BarFilter!] + baz_contains: String + baz: String + baz_not: String + baz_not_contains: String + baz_starts_with: String + baz_not_starts_with: String + baz_ends_with: String + baz_not_ends_with: String + baz_in: [String] + baz_not_in: [String] +} + +"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text." +scalar String diff --git a/src/HotChocolate/Filters/test/Types.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding.snap b/src/HotChocolate/Filters/test/Types.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding.snap new file mode 100644 index 00000000000..c61f6874b19 --- /dev/null +++ b/src/HotChocolate/Filters/test/Types.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding.snap @@ -0,0 +1,29 @@ +schema { + query: Query +} + +type Foo { + bar: String +} + +type Query { + foo(where: FooFilter): Foo +} + +input FooFilter { + AND: [FooFilter!] + OR: [FooFilter!] + bar: String + bar_not: String + bar_contains: String + bar_not_contains: String + bar_starts_with: String + bar_not_starts_with: String + bar_ends_with: String + bar_not_ends_with: String + bar_in: [String] + bar_not_in: [String] +} + +"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text." +scalar String diff --git a/src/HotChocolate/Filters/test/Types.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding_BindFields.snap b/src/HotChocolate/Filters/test/Types.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding_BindFields.snap new file mode 100644 index 00000000000..c61f6874b19 --- /dev/null +++ b/src/HotChocolate/Filters/test/Types.Filters.Tests/__snapshots__/FilterInputTypeTest.FilterInputType_ImplicitBinding_BindFields.snap @@ -0,0 +1,29 @@ +schema { + query: Query +} + +type Foo { + bar: String +} + +type Query { + foo(where: FooFilter): Foo +} + +input FooFilter { + AND: [FooFilter!] + OR: [FooFilter!] + bar: String + bar_not: String + bar_contains: String + bar_not_contains: String + bar_starts_with: String + bar_not_starts_with: String + bar_ends_with: String + bar_not_ends_with: String + bar_in: [String] + bar_not_in: [String] +} + +"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text." +scalar String