Skip to content

Commit 9933b69

Browse files
committed
feat(types): add resolvers for transactions_count and token_transfers_count fields
1 parent d4a1c83 commit 9933b69

File tree

1 file changed

+12
-2
lines changed
  • apps/block_scout_web/lib/block_scout_web/graphql/schema

1 file changed

+12
-2
lines changed

apps/block_scout_web/lib/block_scout_web/graphql/schema/types.ex

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,18 @@ defmodule BlockScoutWeb.GraphQL.Schema.Types do
218218
field(:contract_code, :data)
219219
field(:nonce, :integer)
220220
field(:gas_used, :integer)
221-
field(:transactions_count, :integer)
222-
field(:token_transfers_count, :integer)
221+
222+
field :transactions_count, :integer do
223+
resolve(fn address, _, _ ->
224+
{:ok, address.transactions_count}
225+
end)
226+
end
227+
228+
field :token_transfers_count, :integer do
229+
resolve(fn address, _, _ ->
230+
{:ok, address.token_transfers_count}
231+
end)
232+
end
223233

224234
field :btc_address, :string do
225235
resolve(&BlockScoutWeb.GraphQL.Resolvers.Address.get_btc_address/3)

0 commit comments

Comments
 (0)