hasura / hasura/graphql-engine

Escaping double-quotes in Request Transform produces an error in Hasura v2.2.0

Open
#8,182 0 comments 5 reactions 0 assignees View on GitHub
k/bug
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Version Information

Server Version:
CLI Version (for CLI related issue): v2.2.0

### Environment

K8S

### What is the expected behaviour?

Previously in Hasura v2.1.1, I had created an Hasura Action with a "Request Transform". I am now unable to upgrade to Hasura v2.2.0 because this Hasura Action is now erroring with the following message (simplified example to show the error in v2.2.0):

![image](https://user-images.githubusercontent.com/55542413/154146429-a8237410-acf6-42b3-a7c1-46b2a91624d3.png)

I'm basically escaping the double-quotes (`\"test\"`), which worked before in v2.1.1. Not using the escaped double-quotes work, however this is not valid JSON for the targeted action.

Am I missing something? Is there another way to escape double-quotes?

### Keywords

Action, Request Transform, Request Body, LexError

### What is the current behaviour?

The Request Transform containing escaped double-quotes gives out a LexError

### How to reproduce the issue?

See above

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Request Transform failure in Hasura v2.2.0 using escaped double-quotes in an Action request body, and compare it with v2.1.1. Trace the LexError reported for this transform and verify that valid JSON escaping works without errors while unescaped invalid JSON remains rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.