GraphQLAPIWrapper#

class langchain_community.utilities.graphql.GraphQLAPIWrapper[source]#

Bases: BaseModel

Wrapper around GraphQL API.

To use, you should have the gql python package installed. This wrapper will use the GraphQL API to conduct queries.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

param custom_headers: Dict[str, str] | None = None#
param fetch_schema_from_transport: bool | None = None#
param graphql_endpoint: str [Required]#
run(query: str) str[source]#

Run a GraphQL query and get the results.

Parameters:

query (str)

Return type:

str