我正在尝试构建一个 GraphQL 服务器,并且我正在尝试使用 GraphiQL Chrome 扩展来使用它。
一旦我将端点设置为我的服务器http://localhost:3000/graphql,GraphiQL 就会发送一个空查询:
Request URL:http://localhost:3000/graphql
Request Method:POST
Status Code:200 OK
Remote Address:[::1]:3000
Referrer Policy:no-referrer-when-downgrade
我让它返回一个空响应,但随后,我在 Chrome 中收到了这个 JavaScript 错误:
react.min.js:14 Uncaught TypeError: Cannot read property 'length' of undefined
at GraphiQL.autoCompleteLeafs (chrome-extension://fkkiamalmpiidkljmicmjfbieiclmeij/ext/graphiql/graphiql.js:1060:33)
at GraphiQL._runEditorQuery (chrome-extension://fkkiamalmpiidkljmicmjfbieiclmeij/ext/graphiql/graphiql.js:1131:13)
at Object.r (chrome-extension://fkkiamalmpiidkljmicmjfbieiclmeij/ext/react.min.js:14:10134)
at i (chrome-extension://fkkiamalmpiidkljmicmjfbieiclmeij/ext/react.min.js:12:21911)
at Object.u [as executeDispatchesInOrder] (chrome-extension://fkkiamalmpiidkljmicmjfbieiclmeij/ext/react.min.js:12:22122)
at p (chrome-extension://fkkiamalmpiidkljmicmjfbieiclmeij/ext/react.min.js:12:18475)
at f (chrome-extension://fkkiamalmpiidkljmicmjfbieiclmeij/ext/react.min.js:12:18601)
at Array.forEach (native)
at r (chrome-extension://fkkiamalmpiidkljmicmjfbieiclmeij/ext/react.min.js:15:26156)
at Object.processEventQueue (chrome-extension://fkkiamalmpiidkljmicmjfbieiclmeij/ext/react.min.js:12:19721)
在那之后,GraphiQL 就完全不起作用了。我可以输入任何查询,单击播放按钮,它所做的只是重复错误: