1

如何使用游乐场而不是 graph-i-ql?

gatsby 文档 - 使用 graphql 游乐场

我尝试了几种方法来加载 Playground 而不是 graph-i-ql,更新了 xcode,使用了不同的浏览器,全局安装的 Playground,重新启动等。我的项目仍在http://localhost 加载 graph-i-ql:gatsby develop在我的鱼壳中运行后8000/___graphql 。

我的 github 仓库

{
  "name": "gatsby-bootcamp",
  "private": true,
  "description": "Gatsby Bootcamp by Andrew Mead",
  "version": "0.1.0",
  "license": "MIT",
  "scripts": {
    "build": "gatsby build",
    "develop": "GATSBY_GRAPHQL_IDE=playground gatsby develop",
    "format": "prettier --write src/**/*.{js,jsx}",
    "start": "npm run develop",
    "serve": "gatsby serve",
    "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\""
  },
  "dependencies": {
    "babel-plugin-styled-components": "^1.10.0",
    "gatsby": "^2.3.16",
    "gatsby-cli": "^2.5.9",
    "gatsby-plugin-styled-components": "^3.0.7",
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "styled-components": "^4.2.0"
  },
  "devDependencies": {
    "graphql-playground": "^1.3.17",
    "prettier": "^1.17.0"
  }
}
4

1 回答 1

1

使用npm run develop而不是gatsby develop运行 package.json 中的脚本命令

它在我的脚本中编写的方式在npm run develop运行GATSBY_GRAPHQL_IDE=playground之前运行gatsby develop这会导致 Playground 加载而不是 graph-i-ql。

谢谢德里克·阮

于 2019-05-02T10:46:41.673 回答