You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know this isn't possible since hooks will be seen as a type, but it's the gist of the idea
I've digged around in the source and something like this doesn't seem to be possible. What seems to be possible is creating a sort of root reducer for the mutations (like redux) and making it resolve the mutation based on the context's fieldName. So something like:
From the docs, resolve hooks can be added per field in the schema.
For mutations, we define it through a top level hook object we pass to getSchema.
Is there a way to define mutation hooks inside the schema? Like so:
I know this isn't possible since hooks will be seen as a type, but it's the gist of the idea
I've digged around in the source and something like this doesn't seem to be possible. What seems to be possible is creating a sort of root reducer for the mutations (like redux) and making it resolve the mutation based on the context's fieldName. So something like:
I'd like to know if this is the canonical way to do this, and it'd be great to have examples in the docs for this use case.
The text was updated successfully, but these errors were encountered: