Yaak Logo
Yaak
Feedback/Import from Curl: Support ANSI-C quoting

Import from Curl: Support ANSI-C quoting

Daniel Breiner·7 days ago
ReleasedFeature RequestBugImprovement

When debugging GraphQL requests from Firefox, it uses ANSI-C quoting to escape special characters in the gql body. This dollar-prefixed string ($') breaks the import in Yaak.

Reproduction: Import this curl:

curl 'https://gui-api-alpha.recombee.net/graphql?o=AccountScreenUpdateCurrentUserMutation' \
  -X POST \
  -H 'content-type: application/json' \
  --data-raw $'{"operationName":"AccountScreenUpdateCurrentUserMutation","query":"mutation AccountScreenUpdateCurrentUserMutation($input: CurrentAdminInput) {\\n  updateCurrentAdmin(input: $input) {\\n    id\\n    lastLoginAt\\n    email\\n    fullName\\n    createdAt\\n    ultimateAdminPermissions\\n    picture\\n    role\\n    __typename\\n  }\\n  __typename\\n}","variables":{"input":{"fullName":"Daniel Breiner","role":"ENGINEER"}}}'

vs. the same curl without ANSI-C quoting $', which works correctly:

curl 'https://gui-api-alpha.recombee.net/graphql?o=AccountScreenUpdateCurrentUserMutation' \
  -X POST \
  -H 'content-type: application/json' \
  --data-raw '{"operationName":"AccountScreenUpdateCurrentUserMutation","query":"mutation AccountScreenUpdateCurrentUserMutation($input: CurrentAdminInput) {\\n  updateCurrentAdmin(input: $input) {\\n    id\\n    lastLoginAt\\n    email\\n    fullName\\n    createdAt\\n    ultimateAdminPermissions\\n    picture\\n    role\\n    __typename\\n  }\\n  __typename\\n}","variables":{"input":{"fullName":"Daniel Breiner","role":"ENGINEER"}}}'

In the examples above, I stripped away the special character ! so it’s easier to reproduce, but this is why Firefox uses ANSI-C. Without its support, it is not possible to directly import curls copied from Firefox. Here is the same example with an encoded ! character (used to mark nonnullable field in gql)

curl 'https://gui-api-alpha.recombee.net/graphql?o=AccountScreenUpdateCurrentUserMutation' \
  -X POST \
  -H 'content-type: application/json' \
  --data-raw $'{"operationName":"AccountScreenUpdateCurrentUserMutation","query":"mutation AccountScreenUpdateCurrentUserMutation($input: CurrentAdminInput\041) {\\n  updateCurrentAdmin(input: $input) {\\n    id\\n    lastLoginAt\\n    email\\n    fullName\\n    createdAt\\n    ultimateAdminPermissions\\n    picture\\n    role\\n    __typename\\n  }\\n  __typename\\n}","variables":{"input":{"fullName":"Daniel Breiner","role":"ENGINEER"}}}'

ANSI-C Quoting - bash reference: https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html

Loving Yaak, thank you for your work.

macOSv2026.1.2

Comments (3)

Sign in to leave a comment.

Gregory SchierReleased
Daniel BreinerOP

Amazing! Thank you 😃, nice coincidence. I just tried it and it works great.

Gregory Schier

Awesome, thanks for confirming!

Type to search feedback...