我已经建立了一个可通过网关访问的阿波罗联盟架构。我想使用官方插件gatsby-source-graphql通过 gatsby 访问它。我遵循了他们的文档并尝试将插件包含在“简单”示例中。
当我yarn build
在我的 gatsby 项目上运行时,我得到以下终端输出:
success onPreInit - 0.048s
success initialize cache - 0.033s
success copy gatsby files - 0.139s
success Compiling Gatsby Functions - 0.239s
success onPreBootstrap - 0.258s
success createSchemaCustomization - 0.003s
ERROR #11321 PLUGIN
"gatsby-source-graphql" threw an error while running the sourceNodes lifecycle:
Source GraphQL API: HTTP error 400 Bad Request
Error: Source GraphQL API: HTTP error 400 Bad Request
- fetch.js:11 exports.fetchWrapper
[yotee.co]/[gatsby-source-graphql]/fetch.js:11:11
- task_queues:96 processTicksAndRejections
node:internal/process/task_queues:96:5
我的 gatsby-config.js 是这样的:
module.exports = {
siteMetadata: {
url: "https://www.XXXX.co",
title: "XXXX",
description: "",
},
plugins: [
{
resolve: 'gatsby-source-graphql',
options: {
typeName: 'Gateway',
fieldName: 'gateway',
url: 'https://XXXXXX'
}
},
"gatsby-plugin-styled-components",
"gatsby-plugin-gatsby-cloud",
"@chakra-ui/gatsby-plugin",
"gatsby-plugin-react-helmet"
],
};
错误“Source GraphQL API: HTTP error 400 Bad Request”非常模糊,我无法得到更详细的消息错误。
我能做些什么来更好地理解这个错误并解决它?