ExUtcp.Transports.Graphql.Schema (ex_utcp v0.3.2)

Copy Markdown View Source

GraphQL schema introspection and tool extraction utilities.

Summary

Functions

Builds a GraphQL mutation from tool name and arguments.

Builds a GraphQL query from tool name and arguments.

Builds a GraphQL subscription from tool name and arguments.

Extracts tools from a GraphQL schema introspection result.

Parses GraphQL response and extracts tool results.

Validates a GraphQL query string.

Functions

build_mutation(tool_name, args)

@spec build_mutation(String.t(), map()) :: String.t()

Builds a GraphQL mutation from tool name and arguments.

build_query(tool_name, args)

@spec build_query(String.t(), map()) :: String.t()

Builds a GraphQL query from tool name and arguments.

build_subscription(tool_name, args)

@spec build_subscription(String.t(), map()) :: String.t()

Builds a GraphQL subscription from tool name and arguments.

extract_tools(schema)

@spec extract_tools(map()) :: [map()]

Extracts tools from a GraphQL schema introspection result.

parse_response(response)

@spec parse_response(map()) :: {:ok, map()} | {:error, term()}

Parses GraphQL response and extracts tool results.

validate_query(query_string)

@spec validate_query(String.t()) :: {:ok, String.t()} | {:error, term()}

Validates a GraphQL query string.