Replies: 2 comments
-
Try using the Prefect 1: Something like this to get a project name: from prefect import Client
client = Client()
query = {
"query": {
"flow": {
"id": True,
"name: True,
"project": {
"name": True
}
}
}
}
client.graphql(query)
from prefect.client import Client
from prefect.utilities.graphql import with_args
client = Client()
query = {
"query": {
with_args(
"flow",
{
"where": {"project": {"name": {"_eq": "Demo"}}}
}
): {
"name": True,
"id": True
}
}
}
client.graphql(query) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you very much.
It helped me.
…On Wed, Oct 28, 2020 at 7:14 PM Josh Meek ***@***.***> wrote:
Try using the Prefect Client to grab information from the GraphQL API.
1: Something like this to get a project name:
from prefect import Client
client = Client()
query = {
"query": {
"flow": {
"id": True,
"name: True,
"project": {
"name": True
}
}
}
}
client.graphql(query)
1. For performing queries like this the library has some utility
functions for composing graphql queries in python:
from prefect.client import Clientfrom prefect.utilities.graphql import with_args
client = Client()
query = {
"query": {
with_args(
"flow",
{
"where": {"project": {"name": {"_eq": "Demo"}}}
}
): {
"name": True,
"id": True
}
}
}
client.graphql(query)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3579 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD7QN23N2C6Y3A4TFKBTEDLSNAN4LANCNFSM4TB7H7UQ>
.
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
joshmeek
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello prefect community,
I have two questions:
query = prefect.utilities.graphql.parse_graphql({
'query': {
'flow': {
'id',
'name',
'project_name' <----------- what is the field name for fetching project name for flow?
}
}
})
Beta Was this translation helpful? Give feedback.
All reactions