Skip to main content

Crate mockql_core

Crate mockql_core 

Source
Expand description

mockql-core provides the building blocks behind mockql.

It analyzes GraphQL operations for @mock directives, builds provider prompts, optionally executes upstream GraphQL requests, and merges partial mock responses back into standard GraphQL Response.

Structs§

ClaudeCliProvider
Anthropic Claude CLI provider.
CodexCliProvider
OpenAI Codex CLI provider.
GeminiCompatibleHttpProvider
Gemini Compatible Endpoint HTTP provider.
GithubCopilotHttpProvider
GitHub Copilot HTTP provider.
GraphQLRequest
A standard GraphQL JSON request.
GraphQLResponse
A standard GraphQL JSON response.
MockResponsePrompt
Prompt payload sent to a mock provider.
MockService
Plans and executes GraphQL operations that may contain @mock directives.
MockServiceRequest
Inputs required to fully execute a request.
OpenCodeCliProvider
Anomaly OpenCode CLI provider.
ResponseMerger
Merges two [MergeableResponse] objects that have disjoint non-object keys.
SchemaFilter
Filters a schema down to the types and fields referenced by an operation.
SchemaTypes
The set of filtered types required to describe an operation.

Enums§

CliProvider
Supported local CLI providers.
HttpProvider
Supported HTTP provider variants.
IntrospectionError
Errors raised while resolving a schema through GraphQL introspection.
MockPlan
Execution strategy selected for a request after planning.
ProviderConfig
Supported provider transport configurations.
ProviderError
Errors raised while serializing prompts or invoking mock providers.
ResponseMergerError
Errors raised while merging partial GraphQL responses.
ResponseValidationError
Errors raised while preparing or validating generated response data.
SchemaFilterError
Errors raised while collecting the schema subset needed by an operation.
SchemaLoadError
Errors raised while resolving the active GraphQL schema.
SerializationFormat
Output format used when serializing structured prompt sections.
ServiceError
Errors raised while planning or executing a request.
SplitError
Errors raised while analyzing how an operation should be split.
UpstreamError
Errors raised while building or executing upstream GraphQL requests.

Constants§

DEBUG_KEY
Nested debug key stored inside MOCK_RESPONSE_EXTENSION_KEY.
MOCK_RESPONSE_EXTENSION_KEY
Extension key used to store mock-response metadata.
REASONING_KEY
Key used to store model reasoning for a generated response.
SCHEMA_EXTENSION_KEY
Key used to carry a schema extension payload in GraphQL extensions.

Traits§

MinifyExt
Converts schema types into the compact prompt format used by mockql.

Functions§

generate_mock_response
Dispatches a mock response prompt to a provider.
load_schema
Loads a validated schema from a local SDL file or from introspection.
to_schema_with_mock_directive
Parses and validates schema SDL, injecting the built-in @mock directive when absent.

Type Aliases§

Header
A typed HTTP header pair.