Hi everyone — I’m trying to use `prefect.Client` t...
# ask-community
b
Hi everyone — I’m trying to use
prefect.Client
to run a graphql query, but I’m not sure how to pass filters to it… I’m using a workaround where I pass the whole query as a string but the curly braces “{” everyone are making passing variables hard, so I’m wondering if there’s a better way
k
I think this example might help. You can pass in parameters this way:
Copy code
response = client.graphql("""
         mutation($flow_group_id: UUID!, $params: JSON!) {
           set_flow_group_schedule (input: {
              flow_group_id: $flow_group_id, 
               cron_clocks: [{cron: "0 9 * * *", parameter_defaults: $params}]}) {
             success
             error
           }
         }
     """,
    variables={"flow_group_id": "795512b7-c9f7-4231-8d6b-c80dbd87231d", "params": {"x": 1}})