Apollo-feature-requests: setting up multiple mutations

Created on 27 Jul 2018  路  8Comments  路  Source: apollographql/apollo-feature-requests

Migrated from: apollographql/apollo-client#3231

project-apollo-client

Most helpful comment

@hwillson in https://github.com/apollographql/apollo-client/issues/3231#issuecomment-396636426 you mention that you are going to update the docs with a new section about nested/multiple mutations with the <Mutation /> component. When do you expect to publish this section?

All 8 comments

Any news on that ?

@hwillson in https://github.com/apollographql/apollo-client/issues/3231#issuecomment-396636426 you mention that you are going to update the docs with a new section about nested/multiple mutations with the <Mutation /> component. When do you expect to publish this section?

@hwillson - Just looking to see if you have published the updated docs with the new section about nested/multiple mutations with the <Mutation /> component. I looked but I don't see it yet.

Still waiting :c plz, help.

About a month ago I ran across some documentation that might help out. I started to use the compose function and it allows you to use multiple queries and mutations without the nasty nesting.

Go to this link for the documentation -> https://www.apollographql.com/docs/react/api/react-apollo.html#compose. After you check the compose section go to the graphql section, https://www.apollographql.com/docs/react/api/react-apollo.html#graphql, and start reading here to the bottom of the page.

One disadvantage when using the compose function is not having access to the state or any functions in the class. I get around this by setting a new parameter in the react navigation to store the class.

constructor(props) { this.props.navigation.setParams({ thisScreen: this, }); }

@AnselmMarie sure but that's not using the Query and Mutation components.
Yes there are solutions to do multiple queries and mutations (things like react-adopt work also pretty well) but there's still nothing on the appolo's components themselves yet.

@misterbridge yeah but I wanted to comment an option just in case. I tried react-adopt but it didn't work from me. Every time I typed something in a text field it would focus out, https://github.com/pedronauck/react-adopt/issues/29. I think the compose option is way better option than having nested components.

Still waiting for this, please be kind with us :c

Was this page helpful?
0 / 5 - 0 ratings