webiny / webiny-js

Open-source serverless enterprise CMS. Includes a headless CMS, page builder, form builder, and file manager. Easy to customize and expand. Deploys to AWS.
https://www.webiny.com
Other
7.4k stars 614 forks source link

GraphQL - `createCategory` Mutation Throwing an Incorrect Error Message #2471

Closed adrians5j closed 1 year ago

adrians5j commented 2 years ago

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.

Avi98 commented 1 year ago

If no one is looking into it. Can I take this up

adrians5j commented 1 year ago

Sry @Avi98, it was actually already solved by @neatbyte-vnobis.

Didn't even notice this issue wasn't closed. :O

But thanks for the good will @Avi98 🙂 🍻