Skip to main content

operation

Context Objects

class Context(BaseModel)

Context provides a way to pass arbitrary data to resolvers on the context

Extensions Objects

class Extensions(BaseModel)

Extensions is a map of additional metadata that can be used by the links in the chain

Operation Objects

class Operation(BaseModel)

A GraphQL operation.

An Operation is a GraphQL operation that can be executed by a GraphQL client. It is a combination of a query, variables, and headers, as well as a context that can be used to pass additional information to the link chain and extensions that can be used to pass additional information to the server.

GraphQLResult Objects

class GraphQLResult(BaseModel)

GraphQLResult is the result of a GraphQL operation.

GraphQLException Objects

class GraphQLException(Exception)

GraphQLException is the base exception for all GraphQL errors.

opify

def opify(query: Union[str, DocumentNode],
variables: Dict[str, Any] = None,
headers: Dict[str, Any] = None,
operation_name: Optional[str] = None,
**kwargs) -> Operation

Opify takes a query, variables, and headers and returns an Operation.

Arguments:

  • query Union[str, DocumentNode] - The query string or the DocumentNode.
  • variables Dict[str, Any], optional - The variables. Defaults to None.
  • headers Dict[str, Any], optional - Additional headers. Defaults to None.
  • operation_name Optional[str], optional - The operation_name to be exceuted. Defaults to None.

Returns:

  • Operation - A GraphQL operation