ariadne-codegen
ariadne-codegen copied to clipboard
Codegen fails when a GQL string contains `'`
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