Skip to content

Conversation

r-marques
Copy link

@r-marques r-marques commented Jan 11, 2022

Description

There is a discrepancy between how the graphql types are generated during scaffolding and how they are read during code generation.

If I have an abi like this https://github.com/nevermined-io/contracts/blob/5b8680b3c581ec50877ed8451c623c8480ac000d/artifacts/AccessProofCondition.mumbai.json#L3-L52 and using the cli to run graph init with --index-events it will generate the following schema.

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
}

Now during code generation when the uint256[] types are converted from graphql it complains that lists cannot have nullable types.

Changing a default is probably not the best idea but I'm glad to help if someone points me in the right direction

@evaporei
Copy link
Contributor

You're right, this makes sense, however even though it's on the same file, PR #802 it's not about the same issue.

I'll merge and release that one and take this bug report as an issue to resolve (that I intend on working right now).

@evaporei
Copy link
Contributor

To solve the issue, this file should be changed instead. So that schema.graphql gets generated correctly.

I've created an issue to track this: #808

@YaroShkvorets
Copy link
Collaborator

Implemented in #1058

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants