Skip to content

Latest commit

 

History

History
113 lines (77 loc) · 5.43 KB

File metadata and controls

113 lines (77 loc) · 5.43 KB

GraphQLRequest

Overview

Available Operations

submit_graph_ql_request

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.

Example Usage

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)

Parameters

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.

Response

models.SubmitGraphQlRequestResponse

Errors

Error Type Status Code Content Type
models.ProblemDetailsError 400, 401, 403, 404 application/json
models.APIError 4XX, 5XX */*

submit_graph_ql_bulk_query_job

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.

Example Usage

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)

Parameters

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.

Response

models.SubmitGraphQlBulkQueryJobResponse

Errors

Error Type Status Code Content Type
models.ProblemDetailsError 400, 401, 403, 404 application/json
models.APIError 4XX, 5XX */*