【发布时间】:2021-01-24 21:12:53
【问题描述】:
所以,我正在关注 this Gatsby 训练营。我在第 10 节,讲师将展示如何从文件系统中获取内容。我安装了插件/依赖项以使用 gatsby (gatsby-source-filesystem) 访问文件系统,并将必要的配置添加到 gatsby-config.js 文件中。看起来是这样的:
/**
* Configure your Gatsby site with this file.
*
* See: https://www.gatsbyjs.com/docs/gatsby-config/
*/
module.exports = {
/* Your site config here */
siteMetadata: {
title: 'GSRdevelopment',
author: 'Gustavo Rios'
},
plugins: [
'gatsby-plugin-sass',
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'src',
path: `${__dirname}/src/`
}
}
],
}
我终于使用 Playground graphql ide 尝试使用讲师使用的相同查询来获取数据,这就是它返回的内容:
我也关注了the gatsby official documentation on how to achieve this,得到了同样的结果。
有什么想法吗?提前致谢
【问题讨论】: