Skip to main content

Module graphql

Module graphql 

Source
Expand description

GraphQL introspection → CLI commands → execute.

Introspection results are cached like OpenAPI ($SKIFF_CACHE_DIR). Use --fields to override the auto-built selection set.

Constants§

GRAPHQL_INTROSPECTION_QUERY
Fixed introspection query (parity with Python mcp2cli).

Functions§

build_graphql_document
Build document + variables from parsed CLI args.
build_selection_set
Auto-generate a selection set (depth 2 = scalars + one nested object level). INTERFACE/UNION fields emit __typename (+ interface scalar fields when present).
execute_graphql
Execute a GraphQL operation and print the result.
extract_graphql_commands
Convert introspection __schema into CLI commands.
graphql_type_string
Reconstruct GraphQL type notation, e.g. [String!]!.
graphql_type_to_python
Map GraphQL type → (CLI ParamType, required, choices).
load_graphql_schema
POST introspection query to a GraphQL endpoint, with caching.
unwrap_type
Unwrap NON_NULL/LIST wrappers. Returns (named_type, is_non_null, is_list).
validate_required_graphql_args
After flags + stdin merge, ensure NON_NULL GraphQL args are present.