Skip to content

Error for array of address field.  #949

@realchoubey

Description

@realchoubey

With Array of address field graph-cli generate field as [Bytes] which fails while codegen.

On fixing [Bytes] to [Bytes!] in conversion file we are getting error below error as array of bytes cannot be directly assigned to array of address.

ERROR TS2322: Type '~lib/array/Array<~lib/@graphprotocol/graph-ts/common/numbers/Address>' is not assignable to type '~lib/array/Array<~lib/@graphprotocol/graph-ts/common/collections/Bytes>'.

Suggestion:
As we don't have support directly from thegraph for address type attributes (We get validation error), we need to generate code which will loop-over the array fields.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions