-
-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic argument validation error is thrown with no indication of the field that is causing it #362
Comments
@kfrajtak When I checked that, it was printing full validation info: |
|
Cannot reproduce with
|
I have modified the source code of the
Can you share the code you tested it with? |
It's master branch of this repo, examples->validation. |
Ok. How to run the example? |
Just like any other TypeScript Node project. |
If you think |
|
I've even checked with |
I am sorry, I am not doubting it works, I just want to try to copy the NPM packages to my project ... (I may have made some changes during debugging). Also it does not work
Installation has some issue too
|
Looks like the problem is in Apollo Server when schema stitching is used, see ardatan/graphql-tools#480. |
Hi,
|
@kfrajtak |
No, I run your example. |
Please make consistent testimony. |
I haven't modified anything at all, I just installed the packages and run it. |
The
Apollo server is using the
So if the I would suggest to reuse the errors from the |
I don't use Apollo Server. TypeGraphQL works with Apollo server, GraphQL Yoga, express-graphql and even Apollo Client. It's weird to change the error for compatibility only with one lib. You can create your own global middleware that will catch the error and transform it to the format you want. |
I see. The code can help with the distinction. |
Great! Thanks for patience and help. |
Describe the bug
Given an
InputType
field with validationand a mutation
when I try to sent mutation to the server with a value exceeding the limit, then I get a very generic error that does not indicate which field caused it, the
locations
array is empty:Expected behavior
I would expected to have the information about what caused the failure, i.e. the
location
array containing the information.Enviorment (please complete the following information):
Thanks,
Karel
The text was updated successfully, but these errors were encountered: