https://prefect.io logo
Title
b

Bruno Kuasney

11/23/2021, 10:26 AM
Hi, honestly I’m not sure if it’s prefect related, but, when I try to run the graphql query to turn off a specific flow:
mutation {
  set_schedule_inactive(input: {flow_id: "67d364da-375d-4d0f-b151-d46435351c50"}) {
    success
  }
}
I get:
"message": "field \"set_schedule_active\" not found in type: 'mutation_root'"
I’m basically trying to use the query from the documentation here
a

Anna Geller

11/23/2021, 10:35 AM
@Bruno Kuasney I’ve just tried it and it seems to work, see image. 1. What is your Server version? Is your Server version >= Prefect version on your flow? 2. How do you call it - from Python or UI? Could it be something related to expired session or invalid API key? Btw in your query you have set_schedule_inactive and in your error message there is “set_schedule_active not found” 😄 something is funny here. Can you refresh your browser and try the query again? Also, make sure the flow ID is correct
b

Bruno Kuasney

11/23/2021, 10:48 AM
yeah, regarding the “funny thing” is just a copy and paste problem xD but both functions are not working. I’m using the UI just to validate, to then try to use on python. Gonna check this “version” problem. Thx 🙂
👍 1
that’s weird, I’m running “single node” (locally), and I started the server with
prefect server start --version master
and the problem remains the same. 😔 I can confirm the graphql is at least working because the first function is working normally
a

Anna Geller

11/23/2021, 11:03 AM
Can you try running it in the GraphQL playground in the Prefect Server UI? http://localhost:4200/graphql
b

Bruno Kuasney

11/23/2021, 11:10 AM
did it run on this place, but I’m not sure what this place does
a

Anna Geller

11/23/2021, 11:12 AM
did it work? Can you see success? The above link is the GraphQL API playground automatically included in your Prefect Server installation. It’s already authenticated and therefore you can use it directly from your Prefect UI
b

Bruno Kuasney

11/23/2021, 11:14 AM
I mean, “success” is false, but at least is not an error (honestly is first time playing around graphql), so probably this mean is not working as well =S
a

Anna Geller

11/23/2021, 11:15 AM
can you share some screenshots? can you see the scheduled being toggled off now?
b

Bruno Kuasney

11/23/2021, 11:17 AM
here is the query and the result
but the schedule remains the same
a

Anna Geller

11/23/2021, 11:31 AM
@Bruno Kuasney could it be that the flow_id is outdated? I see that you use the Version 2, perhaps you have an ID of Version 1?
b

Bruno Kuasney

11/23/2021, 12:24 PM
srry for the delay, ok, how can I get (or check) this? to get this id I just ran
query {flow(where:{project: {name: {_eq: "Protect"}}, archived: {_eq: false}}) {id}}
ok, found it, lemme try and then I’ll return here
nice! thx! did work, but, only worked by going thought the UI and getting manually the flow id… how can I get the flow_id programatically then?
ok, it kinda “renew” from time in time this flow_id? if yes, then ok, I just need to run both queries sequentially
a

Anna Geller

11/23/2021, 12:34 PM
yes, exactly, you can query first for your unarchived flow to get the ID, and then pass it to the next one. But you can also set the schedule active or inactive during registration:
flow.register(set_schedule_active=False)
b

Bruno Kuasney

11/23/2021, 12:35 PM
hmmm that’s a good one! thx a lot @Anna Geller for the help 🙂
🙌 1