I have deployed a Mutation in a MicroProfile container (WildFly) and I'm able to execute it in the GraphQL UI:
mutation Add {
createOrder(order: {
id: 1,
type: "car"
model: "Ferrari"
price: 500
}
)
{
type
model
price
}
}
However, when I try to execute the same mutation using cURL:
curl \
-X POST \
-H "Content-Type: application/json" \
--data '{ "query": "mutation Add {
createOrder(order: {
id: 1,
type: \"car\"
model: \"Ferrari\"
price: 500
}
)
{
type
model
price
}
}
" }' http://localhost:8080/demo/graphql
However it fails with:
javax.json.stream.JsonParsingException: Unexpected char 10 at (line no=1, column no=27, offset=26)
I haven't found many examples of running Mutation with command line tools like cURL and don't know where the error is. Any help? Thanks