Gatsby 正在试用盖茨比主题阿波罗-服务器不可见
开始时有问题吗 采取的步骤:Gatsby 正在试用盖茨比主题阿波罗-服务器不可见,gatsby,react-apollo,Gatsby,React 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
> 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/__;u图形QL
查询可用于site OK,但没有可用的spacex查询。
有遗漏的步骤吗?
(在Ubuntu18.04节点12.14.1,gatsby 2.19.7上)这不是问题:只有在连接服务器端graphql时,服务器才会与其他gatsby模式一起出现,因此这种行为是意料之中的。客户机查询是单独处理的-请参阅和关联中间的YouTube视频,以获得良好的描述