hi guys, how do you tackle the situation when you ...
# orm-help
w
hi guys, how do you tackle the situation when you have textarea with following content
Here it comes " / ' \s /t
without breaking the server. my guess is that i am doing something wrong with the mutation template. which looks like this:
Copy code
return client.mutate({
    mutation: gql`
         mutation {
          updateMyself(
            data: {
              name: "${name}",
              givenName: "${givenName}",
              familyName: "${familyName}",
              username: "${username}",
              email: "${email}",
              description: "${description}", `Here it comes " / ' \s /t`
            }
          ) {
            name
            givenName
            familyName
        
          }
        }
      `,
  })
error is
Copy code
syntaxError.mjs:18 Uncaught (in promise) GraphQLError {message: "Syntax Error: Cannot parse the unexpected character "/".",
thanks 🙂
n
You need to escape it. Or simply use a GraphQL variable instead of interpolating the string inline.
w
thanks @nilan i was reading about it 30 mins ago. i think i'll do it next week 🙂
👍 1