@@ -62,25 +62,31 @@ public override object ParseDictionary(IDictionary<string, object> value)
6262 { "_not_ends_with" , ( S , description ) => S [ "{0} does not end with the string" , description ] } ,
6363 } ;
6464
65- public virtual void AddScalarFilterFields < TGraphType > ( string fieldName , string description )
65+ public void AddScalarFilterFields < TGraphType > ( string fieldName , string description )
66+ => AddScalarFilterFields < TGraphType > ( fieldName , description , null , null , null ) ;
67+
68+ public virtual void AddScalarFilterFields < TGraphType > ( string fieldName , string description , string aliasName , string contentPart , string contentField )
6669 {
67- AddScalarFilterFields ( typeof ( TGraphType ) , fieldName , description ) ;
70+ AddScalarFilterFields ( typeof ( TGraphType ) , fieldName , description , aliasName , contentPart , contentField ) ;
6871 }
6972
70- public virtual void AddScalarFilterFields ( Type graphType , string fieldName , string description )
73+ public void AddScalarFilterFields ( Type graphType , string fieldName , string description )
74+ => AddScalarFilterFields ( graphType , fieldName , description , null , null , null ) ;
75+
76+ public virtual void AddScalarFilterFields ( Type graphType , string fieldName , string description , string aliasName , string contentPart , string contentField )
7177 {
7278 if ( ! typeof ( ScalarGraphType ) . IsAssignableFrom ( graphType ) &&
7379 ! typeof ( IInputObjectGraphType ) . IsAssignableFrom ( graphType ) )
7480 {
7581 return ;
7682 }
7783
78- AddEqualityFilters ( graphType , fieldName , description ) ;
84+ AddEqualityFilters ( graphType , fieldName , description , aliasName , contentPart , contentField ) ;
7985
8086 if ( graphType == typeof ( StringGraphType ) )
8187 {
82- AddMultiValueFilters ( graphType , fieldName , description ) ;
83- AddStringFilters ( graphType , fieldName , description ) ;
88+ AddMultiValueFilters ( graphType , fieldName , description , aliasName , contentPart , contentField ) ;
89+ AddStringFilters ( graphType , fieldName , description , aliasName , contentPart , contentField ) ;
8490 }
8591 else if ( graphType == typeof ( DateTimeGraphType ) ||
8692 graphType == typeof ( DateGraphType ) ||
@@ -92,36 +98,39 @@ public virtual void AddScalarFilterFields(Type graphType, string fieldName, stri
9298 graphType == typeof ( FloatGraphType ) ||
9399 graphType == typeof ( BigIntGraphType ) )
94100 {
95- AddMultiValueFilters ( graphType , fieldName , description ) ;
96- AddNonStringFilters ( graphType , fieldName , description ) ;
101+ AddMultiValueFilters ( graphType , fieldName , description , aliasName , contentPart , contentField ) ;
102+ AddNonStringFilters ( graphType , fieldName , description , aliasName , contentPart , contentField ) ;
97103 }
98104 }
99105
100- private void AddEqualityFilters ( Type graphType , string fieldName , string description )
106+ private void AddEqualityFilters ( Type graphType , string fieldName , string description , string aliasName , string contentPart , string contentField )
101107 {
102- AddFilterFields ( graphType , EqualityOperators , fieldName , description ) ;
108+ AddFilterFields ( graphType , EqualityOperators , fieldName , description , aliasName , contentPart , contentField ) ;
103109 }
104110
105- private void AddStringFilters ( Type graphType , string fieldName , string description )
111+ private void AddStringFilters ( Type graphType , string fieldName , string description , string aliasName , string contentPart , string contentField )
106112 {
107- AddFilterFields ( graphType , StringComparisonOperators , fieldName , description ) ;
113+ AddFilterFields ( graphType , StringComparisonOperators , fieldName , description , aliasName , contentPart , contentField ) ;
108114 }
109115
110- private void AddNonStringFilters ( Type graphType , string fieldName , string description )
116+ private void AddNonStringFilters ( Type graphType , string fieldName , string description , string aliasName , string contentPart , string contentField )
111117 {
112- AddFilterFields ( graphType , NonStringValueComparisonOperators , fieldName , description ) ;
118+ AddFilterFields ( graphType , NonStringValueComparisonOperators , fieldName , description , aliasName , contentPart , contentField ) ;
113119 }
114120
115- private void AddMultiValueFilters ( Type graphType , string fieldName , string description )
121+ private void AddMultiValueFilters ( Type graphType , string fieldName , string description , string aliasName , string contentPart , string contentField )
116122 {
117- AddFilterFields ( graphType , MultiValueComparisonOperators , fieldName , description ) ;
123+ AddFilterFields ( graphType , MultiValueComparisonOperators , fieldName , description , aliasName , contentPart , contentField ) ;
118124 }
119125
120126 private void AddFilterFields (
121127 Type graphType ,
122128 IDictionary < string , Func < IStringLocalizer , string , string > > filters ,
123129 string fieldName ,
124- string description )
130+ string description ,
131+ string aliasName ,
132+ string contentPart ,
133+ string contentField )
125134 {
126135 foreach ( var filter in filters )
127136 {
@@ -130,7 +139,9 @@ private void AddFilterFields(
130139 Name = fieldName + filter . Key ,
131140 Description = filter . Value ( S , description ) ,
132141 Type = graphType ,
133- } ) ;
142+ } . WithAliasNameMetaData ( aliasName )
143+ . WithContentPartMetaData ( contentPart )
144+ . WithContentFieldMetaData ( contentField ) ) ;
134145 }
135146 }
136147}
0 commit comments