7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/graphql/stitching/composer/validate_resolvers.rb', line 7
def perform(supergraph, composer)
supergraph.schema.types.each do |type_name, type|
next unless type.kind.object? || type.kind.interface?
next if supergraph.schema.query == type || supergraph.schema.mutation == type
next if type.graphql_name.start_with?("__")
subgraph_types_by_location = composer.subgraph_types_by_name_and_location[type_name]
next unless subgraph_types_by_location.length > 1
resolvers = supergraph.resolvers[type_name]
if resolvers&.any?
validate_as_resolver(supergraph, type, subgraph_types_by_location, resolvers)
elsif type.kind.object?
validate_as_shared(supergraph, type, subgraph_types_by_location)
end
end
end
|