Creating service with REF environment variables dont work
mutation ServiceCreate {
serviceCreate(input: {
name: "Service with Variables"
environmentId: "id"
projectId: "id"
variables: {
REDIS_URL: "${{Redis.REDIS_URL}}"
REDISHOST: "${{Redis.REDISHOST}}"
}
}) {
createdAt
deletedAt
icon
id
name
projectId
updatedAt
}
}
it shows up as empty string but when you try to edit it you can see the ref is correct62 Replies
Project ID:
da74a7b7-d8ce-41b1-9c8c-9f59ed8d420f
da74a7b7-d8ce-41b1-9c8c-9f59ed8d420f
if you clicked those check marks then clicked the eye icon, would they then render properly?
Yes they would
interesting, ill see if i can reproduce
Alright thanks
Let me know when you have an update
i can reproduce this, going to tag in @jr here
not that this would cause any issues id just like to note that you should keep your variables separate from the query, like so
Yeah noted
jr will drop by when he has the time
Alright. thanks. Currently building a service and this like a major blocker for me ATM
as a work around, you can call
ServiceCreate
without variables, then call variableCollectionUpsert
with the variables, this has the desired effect of rendering the variables
This is indeed a bug. Thanks for the flag. Calling
variableCollectionUpsert
will work. The reason why is that we convert the service name to an id behind the scenes but that is not happening in the serviceCreate
mutationAlright thanks
Do i need to redeploy the service for the update to take effect?
I wanted the variable to available at service creation but that doesn't seem to be the case
yes you will need to redeploy
1. create service without source and without variables
2. add variables to service
3. add source to service with
serviceConnect
yes it's 3 api calls, but far better than having to restart the serviceThank you.
So i was thinking what if we are able to fetch the variables from the plugin and then poplutate the the createService variables with the actual values instead of REF
not ideal, you always want to use reference variables
Solid. Thanks
@Brody THis add source to service with ServiceInstanceUpdate does't trigger a deployment
the repo has a railway.toml file but that doesn't seem to trigger the deployment
what variables do i need to pass tot trigger the deployments
if i have to use the ServiceInstanceUpdate
my bad
this will trigger a deploy after calling it
use that instead of
ServiceInstanceUpdate
I used this and it was throwing and error about serviceInstance not being found
i just tested it and it worked perfectly
the id is a service id btw
yeah yeah
give me a minute
the error
ServiceInstance not found: {"response":{"errors":[{"message":"ServiceInstance not found","locations":[{"line":2,"column":3}],"path":["serviceConnect"],"extensions":{"code":"INTERNAL_SERVER_ERROR","exception":{"status":404}}}],"data":null,"status":200,"headers":{}},"request":{"query":"mutation ServiceConnect($id: String!, $input: ServiceConnectInput!) {\n serviceConnect(id: $id, input: $input) {\n createdAt\n icon\n id\n name\n projectId\n }\n}","variables":{"id":"233b4357-5130-445c-b1db-f513ebac5981","input":{"branch":"main","repo":"KinfolkVC/cuuro-email-sync-engine"}}}}
@Brody
no need for the ping #🛂|readme #5
ohhh sorry about that
can you show me the query in your code
It actually tiggers
but the response i get does not allow me to move tot the next step in my code
export const ServiceConnect = graphql(
mutation ServiceConnect($id: String!, $input: ServiceConnectInput!) {
serviceConnect(id: $id, input: $input) {
createdAt
icon
id
name
projectId
}
}
);
async connectServiceToSource(serviceId: string, source: string) {
const response = await this.graphQLClient.request(ServiceConnect, {
id: serviceId,
input: {
branch: 'main',
repo: source,
},
});
return response.serviceConnect;
}is your client trying to validate to some schema or something?
i dont think so
well im not sure exactly, but this would just be a code issue
Every other query works fine
except this
just a code issue, im sure youll get it sorted soon
aiit
I just tried it with postman returns same error
This is the post man query returns the exact same error.
thats a different error
Its the same tho
its not the same error lol
slow down and read please
with the correct variables, the mutation works fine
ignore the fact that im using the internal endpoint, it makes no difference
you should keep your variables separate from the query
I did exactly this
no you didnt
please setup postman like how i have it
At the code level i did
I am saying the request triggers the deployement but the response is an error
can you please try to repoduce with the external api,
it makes no difference
but sure
^
what kind of id are you using
the service id
is it correct?
yes it is
jr is in dnd mode
are you on pro?
nope
Currently in talks with the team. We are moving away from AWS.
We are still building and making sure everything is working perfectly before we decide.
the only thing that comes to mind is you being on the trial plan
Hmmm
Just upgraded to hobby plan
let me test again
Same error
Its funny that it actually triggers but returns an error response
we wait for jr
(he is busy cooking up cool new railway features)
Alright cool
Hi Brody
Any update on this
sorry i dont, ill tag jr again next week for you
@jr any ideas what could be going on here?
So just to confirm, the problem is that the
serviceConnect
mutation is returning an error (but it is deploying in the UI)?