File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
spring-graphql/src/main/java/org/springframework/graphql/data/pagination Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 47
47
import org .apache .commons .logging .LogFactory ;
48
48
import reactor .core .publisher .Mono ;
49
49
50
+ import org .springframework .graphql .execution .TypeVisitorHelper ;
50
51
import org .springframework .lang .Nullable ;
51
52
import org .springframework .util .Assert ;
52
53
@@ -79,11 +80,13 @@ private ConnectionFieldTypeVisitor(ConnectionAdapter adapter) {
79
80
public TraversalControl visitGraphQLFieldDefinition (
80
81
GraphQLFieldDefinition fieldDefinition , TraverserContext <GraphQLSchemaElement > context ) {
81
82
83
+ TypeVisitorHelper visitorHelper = context .getVarFromParents (TypeVisitorHelper .class );
82
84
GraphQLCodeRegistry .Builder codeRegistry = context .getVarFromParents (GraphQLCodeRegistry .Builder .class );
85
+
83
86
GraphQLFieldsContainer parent = (GraphQLFieldsContainer ) context .getParentNode ();
84
87
DataFetcher <?> dataFetcher = codeRegistry .getDataFetcher (parent , fieldDefinition );
85
88
86
- if (parent . getName (). equalsIgnoreCase ( "mutation" ) || parent . getName (). equalsIgnoreCase ( "subscription" )) {
89
+ if (visitorHelper != null && visitorHelper . isSubscriptionType ( parent )) {
87
90
return TraversalControl .ABORT ;
88
91
}
89
92
You can’t perform that action at this time.
0 commit comments