如何在Atlas App Services Servema中为连字符字段编写解析器?

发布于 2025-02-11 02:39:37 字数 587 浏览 2 评论 0原文

我有一个在MongoDB Atlas上运行的应用程序服务,我想知道如何使用自定义解析器摆脱连字段,因为我无法在GraphQl中查询它,因为它会导致语法错误。

我在下面发现了一个类似的问题,但是我想知道如何在地图集中实现同等标准。

如何处理GraphQl Schema中的字形定义

"stuff": {
      "bsonType": "object",
      "properties": {
        "hyphenated-field-is-causing-problems": {
          "bsonType": "object",
          "properties": {
            "data": {
              "bsonType": "string"
            }
        }    
    }
}

I have an App Service running on MongoDB Atlas, I'd like to know how I can get rid of a hyphenated field using a custom resolver, as I can't query it in GraphQL since it causes a syntax error.

I found a similar problem linked below, but I'd like to know how to implement the equivalent in Atlas.

How to handle hyphens in GraphQL Schema definitions

"stuff": {
      "bsonType": "object",
      "properties": {
        "hyphenated-field-is-causing-problems": {
          "bsonType": "object",
          "properties": {
            "data": {
              "bsonType": "string"
            }
        }    
    }
}

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

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

发布评论

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

评论(1

给不了的爱 2025-02-18 02:39:37

回答了我自己的问题。事实证明,如果您省略了连字符,则可以使用相同。

query {
    stuff {
      hyphenatedfieldiscausingproblems {
        data
      }
    }
  }
}

Answered my own question. Turns out if you omit the hyphens, it works the same.

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