Hi guys, what is the new spec for the .graphcoolrc...
# prisma-whats-new
l
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
0.7.0-beta.5
of the CLI
n
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
.graphcoolrc
will have to be managed manually. Documentation for it is coming in the next 2 hours!
👍 3
l
What is the new way of defining environment variables for the targets? Is it still possible?
n
I’m not sure, maybe @tim can help with this. Did you try it in the way it was before?
l
Yes, but if i do the CLI gives me this error
target.split is not a function
n
ok, jus talked to tim who implemented it. it should work in the way how it was before (which is similar to
graphcool.yml
). it’s probably a bug if it doesn’t work right now
l
I think there is a misunderstanding. I am talking about environment variables defined globally on the targets in the
.graphcoolrc
file. I knew that this was possible before with environments.
t
@lcatallo thanks for bringing this up! What do you exactly mean with globally defined env vars? Because the old
.graphcoolrc
didn't handle any environment variables
l
In the previous documentation there was an example of .graphcoolrc like this
Copy code
environments:
  staging:
    projectId: xxxxxxxxxx
    envVars:
      WEBHOOK_URL: <http://www.example.com/webhook>
Is it possible to declare env variables this way with targets?
t
So what you found there was a proposal, but has not been implemented. What actually has been implemented is
${opt:target}
, 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!
l
${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! 🦜