I'm currently using graphql-cli from Prisma to download the schema from endpoint. But, even after I deploy the changes I made to my schema, which gets deployed successfully, whenever I try to download the schema, I get project prisma - No changes
. And the generated prisma.graphql
is left unchanged.
I use the following command to download the schema:
graphql get-schema -p prisma --dotenv config/dev.env
dev.env
is simply to get PRISMA_ENDPOINT=http://localhost:4466/
environment variable.
I tried to generate prisma.graphql
in a different way by having the following in prisma.yml
:
endpoint: ${env:PRISMA_ENDPOINT}
datamodel: datamodel.prisma
generate:
- generator: graphql-schema
output: ./generated/
And executed prisma generate
, but I get the error:
▸ [WARNING] in /Users/F/Documents/d/server/prisma/prisma.yml: A valid environment ▸ variable to satisfy the declaration 'env:PRISMA_ENDPOINT' could not be found.
Tried stopping and recreating Docker as well as deleting the node_module
and re-installing, but to no avail.
My package.json
:
{
"name": "graphql-basics",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node dist/index.js",
"heroku-postbuild": "babel src --out-dir dist --copy-files",
"dev": "env-cmd ./config/dev.env nodemon src/index.js --ext js,graphql --exec babel-node",
"test": "env-cmd ./config/test.env jest --watch --runInBand",
"get-schema": "graphql get-schema -p prisma --dotenv config/dev.env"
},
"jest": {
"globalSetup": "./tests/jest/globalSetup.js",
"globalTeardown": "./tests/jest/globalTeardown.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"@babel/polyfill": "^7.0.0",
"babel-cli": "^6.26.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0",
"bcryptjs": "^2.4.3",
"cross-fetch": "^2.2.2",
"env-cmd": "^8.0.2",
"google-auth-library": "^4.2.3",
"graphql-cli": "^3.0.14",
"graphql-yoga": "^1.14.10",
"jsonwebtoken": "^8.3.0",
"prisma-binding": "^2.1.1"
},
"devDependencies": {
"babel-plugin-transform-es2015-destructuring": "^6.23.0",
"jest": "^23.5.0",
"nodemon": "^1.17.5"
},
"resolutions": {
"graphql": "^14.5.8"
}
}