-
Notifications
You must be signed in to change notification settings - Fork 4
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
Improve error messages for invalid variables (jsonschema) #372
base: master
Are you sure you want to change the base?
Conversation
GitHub actions yielded the following error. The command that failed is
This is likely a linting or type-checking issue with the source code. Update the code the changes and avoid modifying the existing tests. |
GitHub actions yielded the following error. The command that failed is
This is likely a linting or type-checking issue with the source code. Update the code the changes and avoid modifying the existing tests. |
GitHub actions yielded the following error. The command that failed is
Please note that the lines have been wrapped in ``` for better readability. This is likely a linting or type-checking issue with the source code. Update the code the changes and avoid modifying the existing tests. |
Can you extend tests which show new error functionality? |
Can you add test case which actually have non empty expectedError? |
Sweep:cCan you add test case which actually have non empty expectedError? |
GitHub actions yielded the following error. The command that failed is Here are the relevant lines from the logs:
Please note that the relevant lines may vary depending on the specific error or failure you are debugging. There are a lot of errors. This is likely a larger issue with the PR and not a small linting/type-checking issue. This is likely a linting or type-checking issue with the source code. Update the code the changes and avoid modifying the existing tests. |
GitHub actions yielded the following error. The command that failed is
There are a lot of errors. This is likely a larger issue with the PR and not a small linting/type-checking issue. This is likely a linting or type-checking issue with the source code. Update the code the changes and avoid modifying the existing tests. |
GitHub actions yielded the following error. The command that failed is Here are the relevant lines from the logs:
Please note that the relevant lines may vary depending on the specific error or failure you are debugging. There are a lot of errors. This is likely a larger issue with the PR and not a small linting/type-checking issue. This is likely a linting or type-checking issue with the source code. Update the code the changes and avoid modifying the existing tests. |
GitHub actions yielded the following error. The command that failed is
Please note that the relevant lines may vary depending on the specific error you are debugging. There are a lot of errors. This is likely a larger issue with the PR and not a small linting/type-checking issue. This is likely a linting or type-checking issue with the source code. Update the code the changes and avoid modifying the existing tests. |
GitHub actions yielded the following error. The command that failed is
Please note that the relevant lines may vary depending on the specific error you are debugging. There are a lot of errors. This is likely a larger issue with the PR and not a small linting/type-checking issue. This is likely a linting or type-checking issue with the source code. Update the code the changes and avoid modifying the existing tests. |
GitHub actions yielded the following error. The command that failed is
Please note that the relevant lines may vary depending on the specific error you are debugging. There are a lot of errors. This is likely a larger issue with the PR and not a small linting/type-checking issue. This is likely a linting or type-checking issue with the source code. Update the code the changes and avoid modifying the existing tests. |
GitHub actions yielded the following error. The command that failed is
Please note that the relevant lines may vary depending on the specific error you are debugging. There are a lot of errors. This is likely a larger issue with the PR and not a small linting/type-checking issue. This is likely a linting or type-checking issue with the source code. Update the code the changes and avoid modifying the existing tests. |
GitHub actions yielded the following error. The command that failed is
Please note that the relevant lines may vary depending on the specific error you are debugging. There are a lot of errors. This is likely a larger issue with the PR and not a small linting/type-checking issue. This is likely a linting or type-checking issue with the source code. Update the code the changes and avoid modifying the existing tests. |
GitHub actions yielded the following error. The command that failed is
Please note that the relevant lines may vary depending on the specific error you are debugging. There are a lot of errors. This is likely a larger issue with the PR and not a small linting/type-checking issue. This is likely a linting or type-checking issue with the source code. Update the code the changes and avoid modifying the existing tests. |
Revert all changes for this PR and start by modifying the testDefinition constant in the variablevalidation_test.go file, the modification should add a new Grapql Input type object |
Can you modify the vairablevalidation_test.go file, the modification should add a new Graphql input type object |
Hi @kofoworola, I decided to make the following changes:
|
concatenate the new Graphql input object you added. to the testDefinition constant defined in the variablevalidation_test.go |
Hi @kofoworola, I decided to make the following changes:
|
remove the testInputType constant and add an extra field to the TestInput, the field should be of type TestInput, name the field "nested" |
I decided to make the following changes:
|
modify the variablevalidator_test.go file and add a test case. for a query that makes use of the TestInput input type |
I decided to make the following changes:
|
remove changes to every file except the files in the variablevalidator package |
Hi @kofoworola, I decided to make the following changes:
|
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
revert all changes to variablevalidator.go to before this PR was created |
I decided to make the following changes:
|
Description
This PR improves the error messages for invalid variables in the
graphql-go-tools
project. Currently, the error messages generated by theqri-io/jsonschema
library are unclear and do not provide specific information about the property responsible for the error. This PR addresses this issue by modifying the validation logic and JSON schema generation to provide more accurate and informative error messages.Summary of Changes
EnterVariableDefinition
method in theVariableValidator
struct to improve error handling and error messages. The method now provides specific information about the property responsible for the error.EnterVariableDefinition
method to include therequired
property. This allows for validation of required variables and provides more accurate error messages.StopWithExternalErr
method in thevalidatorVisitor
struct to include the specific error message and the position of the variable in the GraphQL request.StopWithInternalErr
method in thevalidatorVisitor
struct to include a generic error message for internal errors during variable validation.Please review and merge this PR to improve the error messages for invalid variables in the
graphql-go-tools
project.Fixes #369.
To checkout this PR branch, run the following command in your terminal:
To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.