简体   繁体   English

使用 gatsby-source-graphql 时,GraphIQL 资源管理器未在 Gatsby 中显示

[英]GraphIQL explorer not showing in Gatsby when using gatsby-source-graphql

I'm new to Gatsby and have set up the aws-appsync-gatsby-sample project.我是 Gatsby 的新手,并且已经设置了aws-appsync-gatsby-sample项目。 The GraphQL data correctly renders in the local site as seen here: GraphQL 数据在本地站点中正确呈现,如下所示:

在此处输入图像描述

However, I want to use the GraphIQL explorer to learn how to further manipulate the GraphIQL queries but the "explorer" option that Gatsby typically displays is no longer showing.但是,我想使用 GraphIQL 资源管理器来学习如何进一步操作 GraphIQL 查询,但 Gatsby 通常显示的“资源管理器”选项不再显示。 Is it because Im using gatsby-source-graphql ?是因为我使用gatsby-source-graphql吗?

How to I access the GraphIQL explorer to play with this AppSync API data please?如何访问 GraphIQL 资源管理器以使用此 AppSync API 数据? Alternatively, is there another way to access the GraphIQL explorer on my Mac, or online, to access my data?或者,是否有另一种方法可以在我的 Mac 上或在线访问 GraphIQL 资源管理器以访问我的数据?

Thanks for any help.谢谢你的帮助。

I'm not familiar with gatsby but I'm an engineer on the AppSync team.我不熟悉 gatsby,但我是 AppSync 团队的工程师。

As long as you point your GraphiQL app correctly to your AppSync API endpoint, it will work.只要您将 GraphiQL 应用程序正确指向 AppSync API 端点,它就可以工作。 AppSync GraphQL endpoints are no different than other GraphQL endpoints. AppSync GraphQL 端点与其他 GraphQL 端点没有什么不同。

The fastest way to get GraphiQL talking to your AppSync API is:让 GraphiQL 与您的 AppSync API 对话的最快方法是:

  1. copy the API URL from the Settings pane in the AWS AppSync Console into GraphiQL.将 API URL 从 AWS AppSync 控制台的设置窗格复制到 GraphiQL。 It should look like https://abcdef.appsync-api.us-west-2.amazonaws.com/graphql它应该看起来像https://abcdef.appsync-api.us-west-2.amazonaws.com/graphql
  2. In GraphiQL, add a X-API-KEY HTTP request header, and use for value an API key you created from the AppSync Console settings pane.在 GraphiQL 中,添加X-API-KEY HTTP 请求 header,并使用您从 AppSync 控制台设置窗格中创建的 API 密钥作为值。 It should start with da2-xxxxxx .它应该以da2-xxxxxx开头。
  3. You should now see the documentation explorer populated, proving the introspection request succeeded.您现在应该看到填充了文档资源管理器,证明自省请求成功。

I was able to fix this by downloading the latest version of gatsby我可以通过下载最新版本的 gatsby 来解决这个问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM