graphprotocol / graph-client

The Graph library for building GraphQL-based dapps in a decentralized way.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`any` in Scalars output for Bytes, BigInt, BigDecimal

kasparkallas opened this issue · comments

I ran the examples and got any for Bytes, BigInt, BigDecimal in the Scalars. Is this normal? I'd prefer my scalar value to be unambiguous and clearly serializable/deserializable.

Before using graph-client, I generated the output myself using graphql-code-generator and set the output for these types as string which worked well. Is it possible as a user of graphql-client to tweak the internal code generator config to set different values to the scalars? And possibly tweak other aspects of the output as well.

Yes you can configure codegen like below;

codegen:
  scalars:
    BigInt: string
    Bytes: string
    BigDecimal: string

Also you can see the discussion here why we don't set anything for those by default;
#90

@ardatan Love it, will work great for me, thanks!

@ardatan any chance that we can transform a bigint to a BigInt, BigDecimal to BigDecimal etc?