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 can not parse objects with string keys #288

Open
ilovett opened this issue Aug 28, 2020 · 2 comments
Open

JSONObject can not parse objects with string keys #288

ilovett opened this issue Aug 28, 2020 · 2 comments

Comments

@ilovett
Copy link

ilovett commented Aug 28, 2020

Considering that a JSON Object can have keys can have non alpha numerical characters like . or -, those should be wrapped in a string in javascript.

I would assume that passing JSONObject input where: { "dot.path.thing": { name: 123 }} should still pass as valid input JSONObject, but the parser throws this error:

Syntax Error GraphQL request (3:30) Expected Name, found String

I'm assuming it's some kind of limitation though... Must all JSONObject keys be Name ?

@taion
Copy link
Owner

taion commented Aug 28, 2020

I don't think I actually have any control over this at all. I think it's just whatever the graphql-js AST parser does.

@YeomansIII
Copy link

Has anyone found a solution to this? I am trying to store a JSON Schema in my database via a graphql mutation, but JSON Schema's inherently have keys that start with "$" like "$schema" and "$ref".

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

3 participants