langchain.utilities.graphql.GraphQLAPIWrapper¶

class langchain.utilities.graphql.GraphQLAPIWrapper(*, custom_headers: Optional[Dict[str, str]] = None, graphql_endpoint: str, gql_client: Any = None, gql_function: Callable[[str], Any])[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 if the input data cannot be parsed to form a valid model.

param custom_headers: Optional[Dict[str, str]] = None¶
param graphql_endpoint: str [Required]¶
run(query: str) str[source]¶

Run a GraphQL query and get the results.

validator validate_environment  »  all fields[source]¶

Validate that the python package exists in the environment.

model Config[source]¶

Bases: object

Configuration for this pydantic object.

extra = 'forbid'¶

Examples using GraphQLAPIWrapper¶