Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variants: Cannot read property of undefined + Maximum call stack exceeded #467

Open
ondratra opened this issue Dec 12, 2021 · 0 comments
Open
Assignees
Labels
bug Something isn't working low-prio

Comments

@ondratra
Copy link
Contributor

During the development of Olympia council mappings, I encountered another problem(s) with variants that might or might not be related to known problems #396 or #444.

Assuming schema:

# workaround for https://github.com/Joystream/hydra/issues/434
type VariantNone @variant {
  _phantom: Int
}

type ReferendumStageVoting @variant {
  # ...

  startedAtBlock: BigInt!

  # unfortunately this field creates `Maximum call stack size exceeded` when saving electionRound
  #electionRound: ElectionRound!
}

type ReferendumStageRevealing @variant {
  # ...

  startedAtBlock: BigInt!

  intermediateWinners: [ReferendumStageRevealingOptionResult!]!

  # unfortunately this field creates `Maximum call stack size exceeded` when saving electionRound
  #electionRound: ElectionRound!
}

union ReferendumStage = ReferendumStageVoting | ReferendumStageRevealing | VariantNone

type ReferendumStageRevealingOptionResult @entity {
  # ...

  votePower: BigInt!

  referendumStageRevealing: ReferendumStage!

  # unfortunately this field creates `Maximum call stack size exceeded` when saving electionRound
  #electionRound: ElectionRound!
}

type ElectionRound @entity {
  # ...

  cycleId: Int!

  referendumStageVoting: ReferendumStage!
  referendumStageRevealing: ReferendumStage!
}

When trying to use a simple query when at least some related records exist in the database:

electionRounds { id }

an error occurs:

Cannot read property 'intermediateWinnersIds' of undefined

Also, after uncommenting electionRound relations on ReferendumStage* entities/variants, Maximum call stack size exceeded error occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low-prio
Projects
None yet
Development

No branches or pull requests

2 participants