Release candidate — 1.0.0-rc.6
StitchAPI
Reference

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

On this page