You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
yankydoo
changed the title
Escape characters within a string cause an error
Escape characters within a string cause an error in client preset
Feb 22, 2024
Which packages are impacted by your issue?
@graphql-codegen/client-preset
Describe the bug
Hey!
I'm using the client preset and I'm running into an error with a query like this:
The output is as follows:
I've provided a minimal reproduction here:
https://stackblitz.com/edit/github-odqmc9?file=package.json
The problem doesn't seem to be the dollar sign though, but escaped strings in general. When removing the dollar sign, the error message changes to:
Workaround
During writing of this bug report I found the following workaround:
Changing the string from
"{\"$orderby\":{\"username\":\"asc\"}}"
to"""{"$orderby":{"lastname":"asc", "firstname":"asc"}}"""
does not cause the error.Your Example Website or App
https://stackblitz.com/edit/github-odqmc9?file=package.json
Steps to Reproduce the Bug or Issue
run
yarn generate
Expected behavior
As a user, I expect that an escaped double quotation in a string is processed correctly
Screenshots or Videos
No response
Platform
graphql
version: ^16.2.0@graphql-codegen/add
: ^5.0.0@graphql-codegen/cli
: ^4.0.1@graphql-codegen/typescript
: 4.0.1@graphql-codegen/typescript-operations
: 4.0.1@graphql-codegen/client-preset
: 4.2.3Codegen Config File
Additional context
No response
The text was updated successfully, but these errors were encountered: