我想在 Graphql 请求中发送双引号(")和反斜杠(\),并希望将其取回作为响应。
请检查以下示例:
mutation M {
signUp
(
name: "Harsha Vardhan"
username: "Harsha143",
email: "harshavardhan@sample.com",
description: "Cool "boy" \n And good looking."
)
{
_id,
name
username,
email,
description
}
在上面的 Mutation 中,我想在描述中发送双引号和反斜杠。请指导我克服这个问题。
提前致谢。
最佳答案
你应该尝试像这样转义这些字符
mutation M {
signUp
(
name: "Harsha Vardhan"
username: "Harsha143",
email: "harshavardhan@sample.com",
description: "Cool \"boy\" \\n And good looking."
)
{
_id,
name
username,
email,
description
}
希望有帮助!
关于graphql - 在 Graphql 请求中发送双引号和反斜杠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37709250/