diff --git a/app/graphql/types/base_object.rb b/app/graphql/types/base_object.rb index ec72a58db..f40e3c489 100644 --- a/app/graphql/types/base_object.rb +++ b/app/graphql/types/base_object.rb @@ -12,7 +12,7 @@ def self.links_field(field_name_and_link_type, graphql_field_type) define_method(field_name_and_link_type.to_sym) do Edition .live - .joins(document: { reverse_links: :link_set }) + .includes(document: { reverse_links: :link_set }) .where( document: { locale: "en" }, link_set: { content_id: object.content_id }, diff --git a/app/graphql/types/ministers_index_type.rb b/app/graphql/types/ministers_index_type.rb index 4b54d6d81..a2fec9be3 100644 --- a/app/graphql/types/ministers_index_type.rb +++ b/app/graphql/types/ministers_index_type.rb @@ -61,7 +61,7 @@ class MinistersIndexPersonLinks < Types::BaseObject def role_appointments Edition .live - .joins( + .includes( document: { reverse_links: { # role -> role_appointment link_set: {