- submit_graph_ql_request - Submit a valid GraphQL query or mutation
- submit_graph_ql_bulk_query_job - Submit a valid bulk GraphQL query job
This generic operation can be used to execute any valid GraphQL request. The results are returned directly when the request is complete. To explore the available GraphQL operations, see the GraphQL Schema Explorer.
import os
from ttd_workflows import Workflows
with Workflows(
ttd_auth=os.getenv("WORKFLOWS_TTD_AUTH", ""),
) as workflows:
res = workflows.graph_ql_request.submit_graph_ql_request(request={
"request": "<value>",
"variables": {
},
"beta_features": "<value>",
})
assert res.object is not None
# Handle response
print(res.object)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.GraphQLRequestInput | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.SubmitGraphQlRequestResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models.ProblemDetailsError | 400, 401, 403, 404 | application/json |
| models.APIError | 4XX, 5XX | */* |
This generic operation can be used to execute any valid bulk GraphQL query. To determine the job's status, completion percentage, and URL for download (once the job results are ready), query the GraphQL Bulk Job Status endpoint. For information on bulk GraphQL query syntax, see GraphQL API Bulk Operations.
import os
from ttd_workflows import Workflows
with Workflows(
ttd_auth=os.getenv("WORKFLOWS_TTD_AUTH", ""),
) as workflows:
res = workflows.graph_ql_request.submit_graph_ql_bulk_query_job(request={
"query": "<value>",
"callback_input": {
"callback_url": "https://sociable-quinoa.info/",
"callback_headers": None,
},
"beta_features": "<value>",
})
assert res.graph_ql_bulk_job_response is not None
# Handle response
print(res.graph_ql_bulk_job_response)| Parameter | Type | Required | Description |
|---|---|---|---|
request |
models.GraphQlQueryJobInput | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.SubmitGraphQlBulkQueryJobResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models.ProblemDetailsError | 400, 401, 403, 404 | application/json |
| models.APIError | 4XX, 5XX | */* |