如何在mulesoft中使用HTTP请求器致电GraphQl API
我需要在m子4中消耗GraphQl API。 我在DataWeave中的JSON代码下方起草,然后使用HTTP请求者发布有效载荷。 但是仍然返回无效语法,我可能知道可以将数据发布到GraphQl API 在m子4中?以下代码中的语法错误是什么?
%dw 2.0
output application/json
---
{
query: "query{
test (first: 10, status: \"ACTIVE\" ) {
edges {
node {
id
ref
type
status
attributes {
name
value
type
}
}
}
}"
}
I need to consume a graphQL API in Mule 4.
i draft below json code in dataweave, then use HTTP requestor to post the payload.
but still return Invalid Syntax, may i know is it possible to post data to graphQL API
in Mule 4? what's syntax error in below code?
%dw 2.0
output application/json
---
{
query: "query{
test (first: 10, status: \"ACTIVE\" ) {
edges {
node {
id
ref
type
status
attributes {
name
value
type
}
}
}
}"
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,可以将数据发布到mule 4中的GraphQl API。您遇到的错误可能是因为您在查询中缺少闭合括号。尝试一下
Yes it is possible to post data to GraphQL API in Mule 4. The Error that you are getting is probably because you are missing a closing parenthesis in your query. Try this