graphql - 从 src 文件到源的 GraphQL 查询返回空边数组
问题描述
所以,我跟随这个盖茨比训练营。我在第 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 来尝试使用讲师使用的相同查询来获取数据,这就是它返回的内容:
我还遵循了 gatsby 官方文档,了解如何实现这一目标并获得相同的结果。
关于有什么问题的任何想法?提前致谢
解决方案
好的,所以我决定继续跟随视频,在我安装gatsby-transformer-remark
插件/依赖项并设置它之后,游乐场 ide 这次返回了所需的输出。
推荐阅读
- windows - 24小时屏保——如何处理巨大的视频
- java - MQTT JAVA 客户端程序 - 当我终止服务器时,第二个客户端显示为“不正常地断开连接”
- javascript - 从 Sqlite Expo 中选择的问题。无法通过钩子函数保存查询返回的数组
- python - Python 3 - 使用 .txt 文档字库的刽子手游戏
- javascript - querySelector 有效,但 querySelectorAll 无效
- objective-c - CGEventTapCreate 的 kCGEventTapOptionDefault 不起作用
- xamarin.ios - 如何设置布局约束以允许 UITextview 填充 UIImage 和 UIButton 之间的空间?
- json - 将一个对象添加到多个其他对象并将结果放入数组中
- python - 我怎样才能让程序在我的习惯跟踪器上跟踪完成的天数?
- winforms - webbrowser 控件不能左对齐显示表格文本?