fix balances query n+1
This commit is contained in:
@@ -7,7 +7,11 @@ module Types
|
||||
graphql_name "Balance"
|
||||
|
||||
field :id, ID, null: false
|
||||
field :currency, CurrencyType, null: false
|
||||
field :amount, String, null: false
|
||||
|
||||
field :currency, CurrencyType, null: false
|
||||
def currency
|
||||
dataloader.with(Sources::ActiveRecord, Currency).load(object.currency_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user