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
It leads to a bug where useUpdate({input: {id: "foo", data: {...}}}) doesn't work (when specifying id explicitely).
On the example of "update", I think we should do this:
remove the check for the document presence in performMutationCheck => that's the responsbility of the mutator
remove the call to "getMutationDocument" => that's the responsibility of the mutator as well to check the document existence
keep passing either "selector" or "dataId" to the mutator in the mutation
The mutations are there: packages/graphql/server/resolvers/defaultMutationResolvers.ts
The mutator there: packages/graphql/server/resolvers/mutators.ts
The path is like this:
request > mutation > mutator > database
So in the MVC model, mutation is a Controller (it simply checks authorization, convert the input into a data selector, and that's it) and mutator a Model (it communicates more closely with the db, checking document existence and updating it).
Describe the bug
We have a function to get the document to update in default mutations, but also in the mutators:
getMutationDocument
)Shouldn't we remove the one in the default mutation?
The text was updated successfully, but these errors were encountered: