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

Docs don't show resolveDependees #15

Open
rhlsthrm opened this issue Aug 5, 2019 · 0 comments
Open

Docs don't show resolveDependees #15

rhlsthrm opened this issue Aug 5, 2019 · 0 comments

Comments

@rhlsthrm
Copy link

rhlsthrm commented Aug 5, 2019

The docs do not show an example of resolveDependees. I am getting an error when trying to create a resolver the following way:

const poolShareValue = pipeResolvers(
  resolveDependees(['totalPoolShares', 'poolValue']),
  ([totalPoolShares, poolValue]) => {
    const ethPerShare = totalPoolShares.toNumber() > 0 ? parseFloat(utils.formatEther(poolValue)) / totalPoolShares.toNumber() : 0; // in eth
    const value = utils.parseEther(ethPerShare.toString()); // in wei
    return value
  }
)

When I tried to set poolShareValue as a resolver, my app throws an error:

Uncaught Error: Error!: Error: Network error: Cannot read property '_fields' of undefined
    at Object.children (Pool.js:129)
    at finish (react-apollo.esm.js:434)
    at Query.render (react-apollo.esm.js:441)
    at finishClassComponent (react-dom.development.js:15320)
    at updateClassComponent (react-dom.development.js:15275)
    at beginWork (react-dom.development.js:16265)
    at performUnitOfWork (react-dom.development.js:20285)
    at workLoop (react-dom.development.js:20326)
    at HTMLUnknownElement.callCallback (react-dom.development.js:147)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:196)
    at invokeGuardedCallback (react-dom.development.js:250)
    at replayUnitOfWork (react-dom.development.js:19509)
    at renderRoot (react-dom.development.js:20439)
    at performWorkOnRoot (react-dom.development.js:21363)
    at performWork (react-dom.development.js:21273)
    at performSyncWork (react-dom.development.js:21247)
    at requestWork (react-dom.development.js:21102)
    at scheduleWork (react-dom.development.js:20915)
    at Object.enqueueForceUpdate (react-dom.development.js:11633)
    at Query.push../node_modules/react/cjs/react.development.js.Component.forceUpdate (react.development.js:355)
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

No branches or pull requests

1 participant