Hi guys, what is the new spec for the .graphcoolrc...
# prisma-whats-new
Hi guys, what is the new spec for the .graphcoolrc file? It seems like the one in the documentation is outdated 😕 https://docs-next.graph.cool/reference/graphcool-cli/.graphcoolrc-zoug8seen4 I'm using the version
of the CLI
It’s indeed outdated! We’re deprecating the concept of environments and replacing it with targets. We’re also completely removing the
graphcool env
command, so
will have to be managed manually. Documentation for it is coming in the next 2 hours!
👍 3
What is the new way of defining environment variables for the targets? Is it still possible?
I’m not sure, maybe @tim can help with this. Did you try it in the way it was before?
Yes, but if i do the CLI gives me this error
target.split is not a function
ok, jus talked to tim who implemented it. it should work in the way how it was before (which is similar to
). it’s probably a bug if it doesn’t work right now
I think there is a misunderstanding. I am talking about environment variables defined globally on the targets in the
file. I knew that this was possible before with environments.
@lcatallo thanks for bringing this up! What do you exactly mean with globally defined env vars? Because the old
didn't handle any environment variables
In the previous documentation there was an example of .graphcoolrc like this
Copy code
    projectId: xxxxxxxxxx
      WEBHOOK_URL: <http://www.example.com/webhook>
Is it possible to declare env variables this way with targets?
So what you found there was a proposal, but has not been implemented. What actually has been implemented is
, which you can use in your graphcool.yml to have target depended environment variables. The reasoning behind that was to keep the .graphcoolrc clean and simple and to have all env var definitions in the graphcool.yml
Besides that I recommend to you bringing that up in the forum, because it is actually a very important topic to have the ability to define proper env vars!
${opt:target} is exactly what I need, I was using the old ${opt:stage} and the cli got mad at me. I thought of using the env var just as a workaround. Thanks! You saved my day! 🦜