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

Codegen fails when a GQL string contains ' #288

Open
affanshahid opened this issue Mar 16, 2024 · 0 comments
Open

Codegen fails when a GQL string contains ' #288

affanshahid opened this issue Mar 16, 2024 · 0 comments

Comments

@affanshahid
Copy link

Generating a client against the following valid query (Note: I am running this against Hasura):

mutation addPerson {
  insert_person_one(object: { username: "Foo's bar" }) {
    id
  }
}

Results in the following error:

 File "src/black/parsing.py", line 90, in lib2to3_parse
black.parsing.InvalidInput: Cannot parse: 15:15:             """s bar"}) {\n''    id\n''  }\n''}\n')

It seems codegen replaces the ' with a """ for some reason.

Changing the query to:

mutation addPerson {
  insert_person_one(object: { username: "Foo bar" }) {
    id
  }
}

Works just fine

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