I'm trying to run Graphql Playground in Gatsby.
My config:
"scripts": {
"develop": "GATSBY_GRAPHQL_IDE=playground gatsby develop",
"start": "gatsby develop",
"build": "gatsby build",
"serve": "gatsby serve",
"clean": "gatsby clean"
},
"dependencies": {
"babel-plugin-styled-components": "^2.0.7",
"dotenv": "^16.0.3",
"gatsby": "^5.0.0",
"gatsby-plugin-styled-components": "^6.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"styled-components": "^5.3.6"
}
I run
npm run develop. But it does not work getting into playground mode.
I tried installing dotenv.
added
require('dotenv').config({
path: `.env.${process.env.NODE_ENV}`,
});
to gatsby-config.js.
Then assigned GATSBY_GRAPHQL_IDE=playground into env.development.
Ran npm run develop.
Still no luck.
I also tried running simple GATSBY_GRAPHQL_IDE=playground gatsby develop. Didn't help either.
It actually worked after changing Gatsby version to ^4.21.1 and running npm install.
What could be the problem? Is Playground still present in 5.0.0?
Playground was removed from version 5.
From here