diff options
Diffstat (limited to 'app/graphql/resolvers/concerns/looks_ahead.rb')
-rw-r--r-- | app/graphql/resolvers/concerns/looks_ahead.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/graphql/resolvers/concerns/looks_ahead.rb b/app/graphql/resolvers/concerns/looks_ahead.rb index 644b2a11460..b548dc1e175 100644 --- a/app/graphql/resolvers/concerns/looks_ahead.rb +++ b/app/graphql/resolvers/concerns/looks_ahead.rb @@ -33,10 +33,14 @@ module LooksAhead end def filtered_preloads - selection = node_selection + nodes = node_selection + + return [] unless nodes + + selected_fields = nodes.selections.map(&:name) preloads.each.flat_map do |name, requirements| - selection&.selects?(name) ? requirements : [] + selected_fields.include?(name) ? requirements : [] end end |