type
GraphQlError
export type GraphQlError = {
readonly message: string,
readonly path?: $ReadOnlyArray<string | number>,
};A GraphQL error as a server reports it.
API reference
The Relay environment, without the boilerplate, for the Unified Toolchain for Flow.
Written from the source by uf doc when this site was built: the signature and the comment above each export, grouped by the specifier a program imports it from.
@uniflowed/graphqltype
GraphQlErrorexport type GraphQlError = {
readonly message: string,
readonly path?: $ReadOnlyArray<string | number>,
};A GraphQL error as a server reports it.
class
GraphQlResponseErrorexport class GraphQlResponseError extends Error { ... }Raised when a response carries errors.
type
EnvironmentOptionsexport type EnvironmentOptions = {
/** Where operations are posted. */
readonly endpoint: string,
/**
* The fetch client to post with.
*
* Explicit rather than reaching for a global: uf does not override
* `globalThis.fetch`, and a server rendering a request often needs to forward
* that request's credentials, which a global cannot know about.
*/
readonly fetch: FetchClient,
/** Headers sent with every operation, e.g. an authorization token. */
readonly headers?: { readonly [string]: string },
};How to reach the GraphQL endpoint.
function
createEnvironmentexport function createEnvironment(options: EnvironmentOptions): Environment { ... }A Relay environment that posts operations to endpoint.
The store is fresh, so two calls are two independent caches — which is what a server needs, where one environment per request is the only way two users do not see each other's data.