Skip to content

graph init --index-events should generate List's with non-nullable types #812

@evaporei

Description

@evaporei

As reported here, if graph init (with --index-events) is provided a similar ABI to this one, it will generate a schema.ts like this:

type AccessProofConditionFulfilled @entity {
  id: ID!
  _agreementId: Bytes! # bytes32
  _origHash: BigInt! # uint256
  _buyer: [BigInt]! # uint256[2]
  _provider: [BigInt]! # uint256[2]
  _cipher: [BigInt]! # uint256[2]
  _proof: Bytes! # bytes
  _conditionId: Bytes! # bytes32
}

The List types should have non-nullable members instead of nullable ones, this isn't allowed anymore since the AS update. During code generation, types such as uint256[] should be converted to [BigInt!]!.

File to change: https://github.com/graphprotocol/graph-cli/blob/master/src/scaffold/schema.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions