Failed to generate types for GraphQL schema
After cloning the repo and updating package.json, running graph codegen --output-dir src/types/ throws an error:
GraphQL schema can't have List's with Nullable members.
Error in 'mints' field of type '[Mint]'.
Suggestion: add an '!' to the member type of the List, change from '[Mint]' to '[Mint!]'
Changing Transaction entities fields from:
mints: [Mint]!
burns: [Burn]!
swaps: [Swap]!
to :
mints: [Mint!]
burns: [Burn!]
swaps: [Swap!]
resolves the issue but complains about possible nullable objects in where the entities fields are used/imported at core.ts and helpers.ts
[Mint]! means that the List itself can't be null, [Mint!] means that the List can be Nullable, but none of its members can, and [Mint!]! means that neither the List's members nor the List itself are Nullable.
This should fix it:
mints: [Mint!]!
burns: [Burn!]!
swaps: [Swap!]!
[Mint]!means that the List itself can't be null,[Mint!]means that the List can be Nullable, but none of its members can, and[Mint!]!means that neither the List's members nor the List itself are Nullable.This should fix it:
mints: [Mint!]! burns: [Burn!]! swaps: [Swap!]!
mints: [Mint!]! burns: [Burn!]! swaps: [Swap!]!
core.ts and helpers.ts will error