This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 787
withMutation should support loading/error/called/data states #2952
Comments
This was referenced Apr 11, 2019
I prefer using HOC over components and hooks. With HOC, I can easily separate query/mutate logic from view, especially using with decorators @graphql(MY_CANDIDATES_AND_PRIMARY, { name: "myCandidatesQuery" })
@graphql(CANDIDATES, { name: "candidatesQuery" })
@graphql(UPDATE_CANDIDATES, { name: "updateCandidatesMutation" })
class CandidatesListScreen extends Component {
//...
} However, I can't get why there is no variables provided like queries. |
I have the same problem when wrapping my components with |
Thanks you!
…On Wed, Jun 12, 2019 at 4:50 AM slikts ***@***.***> wrote:
Yes; it is (was) a regression and is fixed by #3008
<#3008> (not sure in
which release the changes are in).
Closing this ticket as a duplicate of #1967
<#1967>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2952?email_source=notifications&email_token=AAHIAKS3GW42HR22MF6KNTLP2DBHVA5CNFSM4HFDCS62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXP3ZDI#issuecomment-501202061>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHIAKRAMZJOVXTCLY2YV53P2DBHVANCNFSM4HFDCS6Q>
.
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Previous (closed) issues: #421 #1842
The
graphql()
(andwithMutation()
) HOCs currently have a surprising limitation in that the mutation results aren't passed by them, which isn't explained by the docs, and there also isn't an obvious reason for it. The natural expectation from reading the docs would be that HOCs and components would have feature parity (despite HOCs having fallen by the wayside to render props and more recently hooks) and would just be alternative APIs for the same functionality, especially sincegraphql()
delegates to components under the hood. In other words, passing mutation results inwithMutation()
would follow the principle of least surprise.The answer also shouldn't be "just use components or hooks"; the reason to pick HOCs currently is that components suffer from "wrapper hell" unless a helper library like react-adopt is used, and that hooks are still immature.
The text was updated successfully, but these errors were encountered: