如何使用 playground 而不是 graph-i-ql?
Gatsby Docs - 使用 GraphQL Playground
我已经尝试了几种方法来加载 playground 而不是 graph-i-ql、更新 xcode、使用不同的浏览器、全局安装的 playground、重新启动等。在我的鱼壳中运行 graph-i-ql 后,我的项目仍在 http://localhost:8000/___graphql 加载 graph-i-ql gatsby develop
。
我的 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"
}
}
使用 npm run develop
而不是 gatsby develop
从 package.json 运行脚本命令
在我的脚本中编写它的方式npm run develop
运行GATSBY_GRAPHQL_IDE=playground
运行gatsby develop
这会导致操场加载而不是 graph-i-ql。
谢谢德里克·阮