File tree Expand file tree Collapse file tree 3 files changed +9
-62
lines changed
spring-graphql/src/main/java/org/springframework/graphql Expand file tree Collapse file tree 3 files changed +9
-62
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,9 @@ public TraversalControl visitGraphQLFieldDefinition(
110110 return TraversalControl .CONTINUE ;
111111 }
112112
113- private static boolean isUnderSubscriptionOperation (TypeVisitorHelper visitorHelper , TraverserContext <GraphQLSchemaElement > context ) {
113+ private static boolean isUnderSubscriptionOperation (
114+ TypeVisitorHelper visitorHelper , TraverserContext <GraphQLSchemaElement > context ) {
115+
114116 return context .getBreadcrumbs ().stream ()
115117 .filter (GraphQLFieldsContainer .class ::isInstance )
116118 .map (GraphQLFieldsContainer .class ::cast )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2023 the original author or authors.
2+ * Copyright 2002-2024 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
1616
1717package org .springframework .graphql .execution ;
1818
19- import java .util .List ;
20-
2119import graphql .schema .GraphQLNamedType ;
2220import graphql .schema .GraphQLSchema ;
2321
2422/**
25- * Helper for {@link graphql.schema.GraphQLTypeVisitor}s registered via
26- * {@link GraphQlSource.Builder#typeVisitors(List)} that is exposed as a
27- * variable in {@link graphql.util.TraverserContext}.
23+ * Helps {@link graphql.schema.GraphQLTypeVisitor}s to recognize whether a type
24+ * is the subscription type. Exposed as a variable in
25+ * {@link graphql.util.TraverserContext}.
2826 *
2927 * @author Rossen Stoyanchev
3028 * @since 1.2.1
@@ -43,7 +41,8 @@ public interface TypeVisitorHelper {
4341 * @param schema the GraphQL schema to use
4442 */
4543 static TypeVisitorHelper create (GraphQLSchema schema ) {
46- return new DefaultTypeVisitorHelper (schema );
44+ String name = (schema .getSubscriptionType () != null ) ? schema .getSubscriptionType ().getName () : null ;
45+ return (candidate ) -> candidate .getName ().equals (name );
4746 }
4847
4948}
You can’t perform that action at this time.
0 commit comments