1

I have these types:

    type Poll @entity {
        id: ID!
        hash: String!
        contributions: [Contribution!]! @derivedFrom(field: "poll")
    }

    type Contribution @entity {
        id: ID!
        contributorAddress: Bytes!
        poll: Poll!
    }

I need to query a poll filtered by the contribution contributorAddress but it seems that I'm only able to do it with the contribution ID.

Here are the mappings:

    poll.contributions = new Array<string>(0)

    let contributions = poll.contributions
    contributions.push(contribution.id)
    poll.contributions = contributions

Thanks

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.