webiny-js icon indicating copy to clipboard operation
webiny-js copied to clipboard

GraphQL - `createCategory` Mutation Throwing an Incorrect Error Message

Open adrians5j opened this issue 3 years ago • 0 comments

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:

Snipaste_2022-06-09_11-50-28

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.

image

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

adrians5j avatar Jun 09 '22 13:06 adrians5j