Describe the bug
‼ Your token is invalid. It might have expired or you might be using a token from a different project.: {"response":{"errors":[{"message":"Your token is invalid. It might have expired or you might be using a token from a different project.","code":3015...
This issue occurs when deploying to dev on prisma-eu1.
To Reproduce
npm i -g [email protected]prisma deploy --env-file variables.envExpected behavior
hooks:
post-deploy:
- graphql get-schema -p prisma
Screenshots

Versions (please complete the following information):
prisma-eu1 (MySQL). Production Heroku (Prisma 1.32.0-beta/PostgresSQL)prisma CLI: [e.g. prisma/1.32.0-beta (darwin-x64) node-v9.5.0]Windows 10 Pro prisma-binding - 2.2.14Additional context
This issue does not occur when deploying to production (Heroku, with prisma instance updated to 1.32.0-beta-heroku)

Looks like you are using a secret in development in your prisma config. That is why it is asking for a token.
I will recommend not to use graphql cli now as it uses introspection for this. Instead use the prisma cli itself to generate the graphql schema.
Add this to your prisma.yml
generate:
- generator: graphql-schema
output: ./path/to/your/schema.graphql
After this run prisma generate to generate your schema.
@pantharshit00 Many thanks for the update.
I updated my package scripts so:
"deploy": "prisma deploy --env-file variables.env&& prisma generate --env-file variables.env&&...",
replaced the hooks: section of my prisma.yml file with the generate: section you referenced, and finally npm run deploy.
All is working fine now.
Closing as this is resolved now :)
Most helpful comment
Looks like you are using a secret in development in your prisma config. That is why it is asking for a token.
I will recommend not to use graphql cli now as it uses introspection for this. Instead use the prisma cli itself to generate the graphql schema.
Add this to your prisma.yml
After this run
prisma generateto generate your schema.