GraphQl查询的正确语法

发布于 2025-02-10 13:40:31 字数 687 浏览 2 评论 0 原文

我正在与OBJKT API合作以删除一些数据

文档 - Explorer- https://data.objkt.com/explore/

这是我第一次使用GraphQl而且我很难正确编写查询的语法:

var data = '{"query":"event(where: {creator_address: {_eq: "tz1SmSqHY1nfy4Wyw9igVow4okezFB4ztXG2"}})"}';

我收到的错误是:

{"errors":[{"extensions":{"path":"$","code":"invalid-json"},"message":"Error in $: Failed reading: satisfy. Expecting ',' or '}' at 'tz1SmSqHY1nfy4Wyw9igVow4okezFB4ztXG2}})}'"}]}

我不明白在哪里放置或}

。发送正确格式的查询?

谢谢!

I'm working with the OBJKT API to pull some data

Documentation - https://data.objkt.com/docs/
Explorer - https://data.objkt.com/explore/

This is my first time using GraphQL and i'm having trouble writing the syntax for the query properly:

var data = '{"query":"event(where: {creator_address: {_eq: "tz1SmSqHY1nfy4Wyw9igVow4okezFB4ztXG2"}})"}';

The error I receive is:

{"errors":[{"extensions":{"path":"
quot;,"code":"invalid-json"},"message":"Error in $: Failed reading: satisfy. Expecting ',' or '}' at 'tz1SmSqHY1nfy4Wyw9igVow4okezFB4ztXG2}})}'"}]}

I don't understand where to place the , or } .. I've tried escaping the double quotes surrounding tz1SmSqHY1nfy4Wyw9igVow4okezFB4ztXG2 but no luck

How can I send a properly formatted query?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

草莓酥 2025-02-17 13:40:31

尝试一下,这应该对您有用
您只需要在其中放置额外的括号

var data = '{"query":"event({where: {creator_address: {_eq: "tz1SmSqHY1nfy4Wyw9igVow4okezFB4ztXG2"}}})"}';

try this, this should work for you
you just need to place extra pair of parenthesis inside where

var data = '{"query":"event({where: {creator_address: {_eq: "tz1SmSqHY1nfy4Wyw9igVow4okezFB4ztXG2"}}})"}';
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文