graphql - 如何解决 gatsby-source-graphql 的问题
问题描述
我试图连接gatsby-source-graphql
我的 gatsby JS 项目。但我有错误
Cannot query field "alladventures" on type "Query"
。
这是我的 gatsby-config 代码和我的 API: https ://api.services.activelyme.com/graphql/playground
resolve: `gatsby-source-graphql`,
options: {
// This type will contain remote schema Query type
typeName: `ALLADVENTURES`,
// This is the field under which it's accessible
fieldName: `alladventures`,
// URL to query from
url: `https://api.services.activelyme.com/graphql`,
},
},
这是我的组件代码
graphql`
query {
alladventures {
adventures {
title
}
}
site {
siteMetadata {
title
description
author
norwayItems {
item {
status {
category
date
season
}
title
location
userName
description1
dates
show {
regular_price
promotional_price
}
rating {
stars
review
adventures
}
mainImage
guideImage
link
}
}
}
}
}
`
)
Schema must contain uniquely named types but contains multiple types named "Query".
Error: Schema must contain uniquely named types but contains multiple types named "Query".
我必须展示冒险。但我每次都会出错。
如果我将此示例与此 API 一起使用,则一切正常 https://www.gatsbyjs.org/docs/third-party-graphql/
解决方案
推荐阅读
- laravel - 找不到 Orchestra 测试台
- java - 递归搜索房间数组列表中的路径
- workflow - 如何将 UIPath Workflow 转换为 Activity 或创建自定义 Activity?
- java - 如何修复android中的“无法访问android.support.v4.app.ActivityCompat not found的ActivityCompat类文件”错误?
- java - 如何在 Java 编程中修复“线程“主”java.lang.ArrayIndexOutOfBoundsException 中的异常”
- forms - 如何使用 redux-form 清除所有字段(不重置)?
- wpf - WPF数据网格导出到excel编码问题
- python - 如何使用python写入命令行
- powershell - Powershell无需继承即可获得文件夹权限
- batch-file - 创建一个变量列表,以便将它们与 .bat 中的命令一起使用