class singer_sdk.GraphQLStream[source]

Abstract base class for API-type streams.

GraphQL streams inherit from the class GraphQLStream, which in turn inherits from the RESTStream class. GraphQL streams are very similar to REST API-based streams, but instead of specifying a path and url_params, developers override the GraphQL query text.

prepare_request_payload(context, next_page_token)[source]

Prepare the data payload for the GraphQL API request.

Developers generally should generally not need to override this method. Instead, developers set the payload by properly configuring the query attribute.

  • context (dict | None) – Stream partition or context dictionary.

  • next_page_token (_TToken | None) – Token, page number or any request argument to request the next page of data.


Dictionary with the body to use for the request.


ValueError – If the query property is not set in the request body.

Return type:

dict | None

property query: str[source]

Set or return the GraphQL query string.


NotImplementedError – If the derived class doesn’t define this property.

property records_jsonpath: str[source]

Get the JSONPath expression to extract records from an API response.


JSONPath expression string

rest_method = 'POST'[source]

HTTP method to use for requests. Defaults to “GET”.