【问题标题】:Apollo GraphQL Deprecation WarningsApollo GraphQL 弃用警告
【发布时间】:2020-09-13 03:40:07
【问题描述】:

我收到很多弃用警告。我不确定我为什么会得到它。谁能指导我。

我用 koa node js 框架为 apollo graph ql 创建了一个样板。我计划在我的下一个项目中使用图形 ql 订阅。但是,这些警告或错误让我感到困惑。这是我的 git https://github.com/sumitbhavra/graphql-koa.git

{
          "name": "include",
          "description": "Directs the executor to include this field or fragment only when the `if` argument is true.",
          "locations": [
            "FIELD",
            "FRAGMENT_SPREAD",
            "INLINE_FRAGMENT"
          ],
          "args": [
            {
              "name": "if",
              "description": "Included when true.",
              "type": {
                "kind": "NON_NULL",
                "name": null,
                "ofType": {
                  "kind": "SCALAR",
                  "name": "Boolean",
                  "ofType": null
                }
              },
              "defaultValue": null
            }
          ]
        },
        {
          "name": "deprecated",
          "description": "Marks an element of a GraphQL schema as no longer supported.",
          "locations": [
            "FIELD_DEFINITION",
            "ENUM_VALUE"
          ],
          "args": [
            {
              "name": "reason",
              "description": "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",
              "type": {
                "kind": "SCALAR",
                "name": "String",
                "ofType": null
              },
              "defaultValue": "\"No longer supported\""
            }
          ]
        }

【问题讨论】:

    标签: node.js graphql apollo


    【解决方案1】:

    这不是弃用警告。这是一个自省结果,其中包含有关 @deprecated 指令的信息,可在类型定义中使用该指令将单个字段或枚举值标记为已弃用。

    【讨论】:

      猜你喜欢
      • 2018-04-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-11
      • 2021-07-12
      • 2017-08-22
      • 2011-09-29
      相关资源
      最近更新 更多