gpt4 book ai didi

graphql-js - 如何在 Gatsby JS 中查询外部 GraphQL 端点?

转载 作者:行者123 更新时间:2023-12-04 14:54:34 27 4
gpt4 key购买 nike

我没有看到任何明确的方法来查询外部 GraphQL 端点(即 https://somewebsite.com/graphql )以获取数据。有没有其他人这样做过,你是怎么做到的?

我认为它需要您构建一个自定义插件,但这对于如此简单的需求来说似乎有点过分。我已经搜索了文档,但这个问题并没有真正得到解决。 🤔

最佳答案

在 Gatsby V2 中,您不需要创建自己的插件。

你需要的是一个名为 gatsby-source-graphql 的插件

gatsby-source-graphql uses schema stitching to combine the schema of a third-party API with the Gatsby schema.



您可以找到更多信息 here.

关于graphql-js - 如何在 Gatsby JS 中查询外部 GraphQL 端点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48780658/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com