I want to send double quote(") and back slash(\ ) in Graphql request and want to get it back in response.
Please check bellow example:
mutation M {
signUp
(
name: "Harsha Vardhan"
username: "Harsha143",
email: "[email protected]",
description: "Cool "boy" \n And good looking."
)
{
_id,
name
username,
email,
description
}
In above Mutation I want to send double quotes and back slash in description. Please guide me to overcome this.
Thanks in advance.
Names in GraphQL are case‐sensitive. That is to say name , Name , and NAME all refer to different names.
GraphQL works by sending operations to an endpoint. There are three types of operations: queries, mutations, and subscriptions.
The operation name is pretty much up to you on what you want to call it. However, you do need it when you pass in query / mutation parameters like so: // GraphQL Query query Welcome ($data: String!) { echo (email: $data) { name } } // GraphQL Variables { "data": "[email protected]" }
A GraphQL fragment lets you build multiple fields, and include them in multiple queries. You can think of it as functions in programming languages, that are reusable units. A GraphQL Fragment is a reusable unit of a GraphQL query, which creates a shared piece of query logic.
You should try to escape those characters like so
mutation M {
signUp
(
name: "Harsha Vardhan"
username: "Harsha143",
email: "[email protected]",
description: "Cool \"boy\" \\n And good looking."
)
{
_id,
name
username,
email,
description
}
Hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With