https://prefect.io logo
Title
p

Philip MacMenamin

08/18/2020, 5:42 PM
How do I spec params in gql while trying to run a job? eg if I have a params called input_loc and submission_id, how do I define those args in gql?
mutation {
  create_flow_run(
    input: {
      flow_id: "dcbbfc94-5643-453c-941a-0efa8505df66"
      parameters: {"input_loc": "test"}
    }
  ) {
    id
  }
}
as in, normally I'd just drop something like this JSON into the GUI
{
  "files": [
    "fname.txt",
    "fname2.txt"
  ],
  "input_loc": "/test_job_loc/",
  "submission_id": "test_job_id"
}
j

Jenny

08/18/2020, 6:17 PM
Hi @Philip MacMenamin - let me check that for you.
p

Philip MacMenamin

08/18/2020, 6:18 PM
thanks Jenny - I'm sure it's a dumb question, it's just I'm not getting the exact syntax. this is where I was looking https://docs.prefect.io/orchestration/concepts/flow_runs.html#scheduling-a-flow-run
👍 1
j

Jenny

08/18/2020, 6:49 PM
Hi @Philip MacMenamin - took a bit of json-figuring but here's an example:
mutation {
  create_flow_run(input: {
    flow_id: "xxxxxxxxx",
    parameters: "{\"a\":2}"
    }
  ) {
    id
  }
}
I'll make a note to add that to the docs - at least to help me remember for next time!
👍 1
p

Philip MacMenamin

08/18/2020, 6:50 PM
ok, so you're having to escape every " ?
and then wrap the whole thing in "'s - ok. I see. I'll test
yup, that's the one. Thanks!
👍 1