webiny-js
webiny-js copied to clipboard
GraphQL - `createCategory` Mutation Throwing an Incorrect Error Message
Version
5.29.0
Operating System
/
Browser
/
What steps will reproduce the bug?
Just try issuing the following mutation, and you should be able to see the error message on the right:

What is the expected behavior?
We should not get this system-level error. We should get the error message thrown from the CreateDataModel model (packages/api-page-builder/src/graphql/crud/categories.crud.ts:195).
What do you see instead?
The error is shown in the screenshot.
Additional information
No response
Possible solution
This is basically happening because of the incorrect order of operations here.

The fix needs to be applied here. We need to switch the order of operations.