File tree Expand file tree Collapse file tree 3 files changed +44
-2
lines changed
src/Types/Types/Descriptors/Conventions Expand file tree Collapse file tree 3 files changed +44
-2
lines changed Original file line number Diff line number Diff line change @@ -643,8 +643,9 @@ private bool CanBeHandled(
643
643
return false ;
644
644
}
645
645
646
- if ( member . IsDefined ( typeof ( GraphQLTypeAttribute ) , true ) ||
647
- member . IsDefined ( typeof ( DescriptorAttribute ) , true ) )
646
+ if ( ( member . IsDefined ( typeof ( GraphQLTypeAttribute ) , true ) ||
647
+ member . IsDefined ( typeof ( DescriptorAttribute ) , true ) ) &&
648
+ member is PropertyInfo or MethodInfo )
648
649
{
649
650
return true ;
650
651
}
Original file line number Diff line number Diff line change @@ -2124,6 +2124,35 @@ public async Task Ignore_Object_Lists()
2124
2124
schema . MatchSnapshot ( ) ;
2125
2125
}
2126
2126
2127
+ [ Fact ]
2128
+ public async Task Ignore_Type_Members ( )
2129
+ {
2130
+ var schema = await new ServiceCollection ( )
2131
+ . AddGraphQL ( )
2132
+ . AddQueryType < QueryWithTypeExtension > ( )
2133
+ . AddTypeExtension < QueryWithTypeExtension . SomeClassExtension > ( )
2134
+ . BuildSchemaAsync ( ) ;
2135
+
2136
+ schema . MatchSnapshot ( ) ;
2137
+ }
2138
+
2139
+ [ GraphQLName ( "Query" ) ]
2140
+ public class QueryWithTypeExtension
2141
+ {
2142
+ public SomeClass GetSomeClass ( ) => null ! ;
2143
+
2144
+ [ ExtendObjectType ( "SomeClass" ) ]
2145
+ public class SomeClassExtension
2146
+ {
2147
+ public int SomethingElse { get ; set ; }
2148
+ }
2149
+ }
2150
+
2151
+ public class SomeClass
2152
+ {
2153
+ public int Something { get ; set ; }
2154
+ }
2155
+
2127
2156
public abstract class ResolverBase
2128
2157
{
2129
2158
public int GetValue ( ) => 1024 ;
Original file line number Diff line number Diff line change
1
+ schema {
2
+ query : Query
3
+ }
4
+
5
+ type Query {
6
+ someClass : SomeClass
7
+ }
8
+
9
+ type SomeClass {
10
+ something : Int !
11
+ somethingElse : Int !
12
+ }
You can’t perform that action at this time.
0 commit comments