Gatsby JS-博客路径文件不是使用gatsby源文件系统生成的

时间:2020-08-22 09:24:02

标签: reactjs gatsby

我正在尝试在gatsby上创建博客,但我在这里找不到文件路径;这是我的package.json文件

{
  "name": "gatsby-starter-default",
  "private": true,
  "description": "A simple starter to get up and developing quickly with Gatsby",
  "version": "0.1.0",
  "author": "Kyle Mathews <mathews.kyle@gmail.com>",
  "dependencies": {
    "@fullpage/react-fullpage": "^0.1.17",
    "fullpage-react": "^3.1.0",
    "gatsby": "^2.23.12",
    "gatsby-image": "^2.4.9",
    "gatsby-plugin-catch-links": "^2.3.11",
    "gatsby-plugin-manifest": "^2.4.14",
    "gatsby-plugin-offline": "^3.2.13",
    "gatsby-plugin-react-helmet": "^3.3.6",
    "gatsby-plugin-sharp": "^2.6.14",
    "gatsby-source-filesystem": "^2.3.24",
    "gatsby-transformer-remark": "^2.8.28",
    "gatsby-transformer-sharp": "^2.5.7",
    "prop-types": "^15.7.2",
    "react": "^16.12.0",
    "react-anchor-link-smooth-scroll": "^1.0.12",
    "react-dom": "^16.12.0",
    "react-full-page": "^0.1.9",
    "react-helmet": "^6.1.0",
    "styled-components": "^5.1.1"
  },
  "devDependencies": {
    "prettier": "2.0.5"
  },
  "keywords": [
    "gatsby"
  ],
  "license": "0BSD",
  "scripts": {
    "build": "gatsby build",
    "develop": "gatsby develop",
    "format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
    "start": "npm run develop",
    "serve": "gatsby serve",
    "clean": "gatsby clean",
    "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/gatsbyjs/gatsby-starter-default"
  },
  "bugs": {
    "url": "https://github.com/gatsbyjs/gatsby/issues"
  }
}

然后当我运行gatsby development并检查grapql查询时,我应该获得一个文件路径,而不是一个奇怪的字符串

这是查询

query MyQuery {
  allFile {
    edges {
      node {
        id
      }
    }
  }
}

这就是我得到的

 "edges": [
        {
          "node": {
            "id": "b22733e1-b0a1-5caa-baac-d6ec79cbaecc"
          }
        },//more like this

但是我需要获取,或者我看到我的导师正在获取文件的路径,例如:D:/dropbox/course/pages/about.js

感谢您的帮助!

0 个答案:

没有答案