https://prefect.io logo
d

Daniel Nilsen

02/11/2022, 7:40 AM
Hi! Im trying to start a run though gql. I am using this mutation where the input is a variable: Anyone know what the type is supposed to be for the input?
Copy code
mutation MyMutation($input: any) {
    create_flow_run(
      input: $input
    ) {
      id
    }
  }
k

Kevin Kho

02/11/2022, 8:13 AM
There is an example usage here
d

Daniel Nilsen

02/11/2022, 8:15 AM
thanks but I need the input to be a variable 🤔 Is there an example of that?
k

Kevin Kho

02/11/2022, 8:18 AM
Kind of. The source code of
client.create_flow_run()
here
Or really you can just use that method?
The input will be a pain to construct I think because it will be JSON. Think like RunConfig
d

Daniel Nilsen

02/11/2022, 8:53 AM
ah thanks! That was what I was looking for:)
This input is a bit pain indeed. I am trying to construct it with nested strings. I am getting an error:
"dictionary update sequence element #0 has length 1; 2 is required"
do you know what that means?
the input variable looks like this:
Copy code
{
  "input": {
    "flow_id": "3668605b-e14d-4afd-bec8-1de691faaa28",
    "parameters": "{\"project\": \"xxx\", \"jsonata\": \" { \"name\": first_name } \"}"
  }
}
I managed to get it to work btw:p
k

Kevin Kho

02/11/2022, 1:49 PM
Lol glad you got it figured out
Actually, this is a good topic for Discourse, our new knowledge base. Would you be willing to post your solution there because handling that JSON input is always tricky. This will help me link other people to it
upvote 1
3 Views