allow query limit override in get_runs_in_queue
Summary
This extends the graphql endpoint for get_runs_in_queue. Rather than being entirely dependent on the configuration kwarg queued_runs_returned_limit, it also allows the limit to be overwritten in individual calls.
Because the query already uses the limit tag, this should have no effect on query performance.
Importance
From discussions with @madkinsz on slack
Some target applications require Agents that query for a fixed number of flows at a time. While this can be set when using Prefect Server config settings, we'd also like to expose this setting to Prefect Agents (and by extension Prefect Cloud users).
As an example use case, other workflow managements softwares (such as Fireworks) rely on querying/deploying 1 flow at a time in an ad-hoc style. This feature would facilitate transitioning from Fireworks to Prefect and would also enable their use cases.
Checklist
This PR:
- [ ] adds new tests (if appropriate)
- [ ] adds a change file in the
changes/directory (if appropriate)
I haven't added tests for this yet because I'd like to see if this feature would be accepted first.
Sorry this stagnated, I can barely remember the original internal discussion but I do not think we want to support this pattern in Cloud.
As always, thanks for your contributions jacksund.
No worries! I was able to get around my issue thanks to the new queues / agent api in v2. So this feature isn't necessary anymore anyways. :smile: