Rar*_*rio 5 javascript node.js typescript apollo graphql
我正在学习 GraphQL 并且即将完成本教程,这在以前从未发生过。
问题是在浏览器中打开 GraphQL Playground 后,GraphQL 服务器不断接收请求,即使没有进行查询或更改。
我看到服务器返回这些响应:
{
"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\""
}
]
}
Run Code Online (Sandbox Code Playgroud)
Dan*_*den 11
这是预期的行为。
GraphQL Playground向您的服务器发出自省查询。它使用该查询的结果为您的查询提供验证和自动完成。Playground 会重复向您的服务器发送该查询(默认情况下每 2 秒一次),以便如果您的架构发生更改,这些更改可以立即反映在 UI 中(尽管目前此功能存在问题)。
您可以调整相关设置(单击 Playground UI 右上角的设置图标)以更改轮询频率或将其完全关闭:
'schema.polling.enable': true, // enables automatic schema polling
'schema.polling.endpointFilter': '*localhost*', // endpoint filter for schema polling
'schema.polling.interval': 2000, // schema polling interval in ms
Run Code Online (Sandbox Code Playgroud)
但是,您看到的行为仅与 Playground 相关,因此它是无害的,不会影响连接到您服务器的任何其他客户端。
归档时间: |
|
查看次数: |
1708 次 |
最近记录: |