stitch()
Signatures for stitch() and graphql().
The authoring surface: the exports that produce a stitch. For what goes inside the config object, see Reference → Config types.
stitch()
stitch<T>(config) takes a path string or a partial config and returns a
Stitch<T>. Compose shared configuration via the extends key.
import { } from 'stitchapi';
const = <{ : string }>({
: 'https://api.example.com/me',
});graphql()
graphql<T>(config) is a thin wrapper over stitch() for GraphQL-over-HTTP: it POSTs
{ query, variables } and picks data. The config must carry a document.
import { } from 'stitchapi';
const = <{ : { : string } }>({
: 'https://api.example.com/graphql',
: 'query { viewer { id } }',
});See Guide → graphql for usage.
See also
Search the docs over MCP
Connect an agent to the hosted docs MCP — search_docs finds the relevant sections, get_doc reads a full page — for context-frugal retrieval when loading the whole corpus is more than you need.
Auth strategies
bearer, apiKey, basic, cookieSession, oauth2, and the env(), optionalEnv(), secretsFile(), and secretFrom() resolvers.