【发布时间】:2020-05-25 02:22:44
【问题描述】:
入门有问题 https://github.com/apollographql/gatsby-theme-apollo/tree/master/packages/gatsby-theme-apollo
采取的步骤:
> gatsby new atest
> cd atest
> npm install gatsby-theme-apollo @apollo/client
> make new directory: atest/src/gatsby-theme-apollo
> make new file in directory: client.js
> copy paste content from instructions without change:
import fetch from 'isomorphic-fetch';
import {ApolloClient, HttpLink, InMemoryCache} from '@apollo/client';
const client = new ApolloClient({
cache: new InMemoryCache(),
link: new HttpLink({
uri: 'https://api.spacex.land/graphql/',
fetch
})
})
在浏览器中:检查 spacex api 是否已启动 终端:盖茨比开发 浏览器:导航到 localhost:8000/___graphql
查询可用于站点 OK 但是,没有可用的 spacex 查询。 缺少任何步骤吗? (在 ubuntu 18.04 节点 12.14.1,gatsby 2.19.7)
【问题讨论】:
标签: gatsby react-apollo