Replies: 1 comment 1 reply
-
from prefect import Client
from prefect.utilities.graphql import with_args
project_name = "asfsafasfa"
query = {
"query": {
with_args("project", {"where": {"name": {"_eq": project_name}}}): {"id": True}
}
}
client = Client()
result = client.graphql(query)
if result.data.project:
print("Exists!")
else:
print("Does not exist!") |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
BKuasney
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to check if a project already exists using a python command before I
client.create_project(project_name="bla")
?I know I can kinda check this on the terminal by using
create project 'bla' --skip-if-exists
, but, there is a way to check this using python?Beta Was this translation helpful? Give feedback.
All reactions