Skip to content
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

JSONObject: Unexpected error if literal is not an object #2285

Open
1 of 4 tasks
tjenkinson opened this issue Mar 9, 2024 · 0 comments
Open
1 of 4 tasks

JSONObject: Unexpected error if literal is not an object #2285

tjenkinson opened this issue Mar 9, 2024 · 0 comments

Comments

@tjenkinson
Copy link
Contributor

Issue workflow progress

Progress of the issue based on the Contributor Workflow

  • 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox

Make sure to fork this template and run yarn generate in the terminal.

Please make sure the GraphQL Scalars package version under package.json matches yours.


Describe the bug
Currently if you provide a param that should be a JSONObject but it is not an object the error is not handled nicely.

To Reproduce
Add a JSONObject param and do something like

query {
   accounts(myArg: "Not an object") {
   }
}

Expected behavior
A nice error message

Actual behaviour

Expected value of type \"JSONObject\", found \"Not an object\"; Cannot read properties of undefined (reading 'forEach')

Environment:

  • OS: Mac
  • GraphQL Scalars Version: 1.22.5
  • NodeJS: Cloudflare worker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant