= Customer.some_scope end end GraphQL app/graphql/types/query_type.rb module Types class QueryType < Types::BaseObject field :customers, [CustomerType], null: true def customers @customers = Customer.some_scope end end end
| json.name c.name json.email c.email ... end ↑ 該当のリクエスト専用の定義のため再利用不 可 GraphQL app/graphql/types/customer_type.r b module Types class CustomerType < Types::BaseObject field :name, String field :email, String end end ↑ 該当のリクエスト専用の定義ではないので再 利用可能(ActiveRecordの定義同様)