@sterblue/sterblue-sdk
Version:
Sterblue Graph SDK for graphile.sterblue.com
33 lines (32 loc) • 1.64 kB
TypeScript
/**
* From a SDK List function, make a function that directly outputs the list
* By taking the resulting list out of the graphql response payload
* @param listFunction a function that return the graphql response payload with the list stored in the key `list`
*/
export declare const getResultFromListFunction: (listFunction: any) => (variables: any) => Promise<any>;
/**
* From a SDK Count function, make a function that directly outputs the count
* By taking the resulting count out of the graphql response payload
* @param countFunction a function that return the graphql response payload with the count stored in `connection.aggregate.count`
*/
export declare const getResultFromCountFunction: (countFunction: any) => (variables: any) => Promise<any>;
/**
* From a SDK Result function, make a function that directly outputs the result
* By taking the result out of the graphql response payload
* @param resultFunction a function that return the graphql response payload with the result stored in the key `result`
*/
export declare const getResultFromResultFunction: (resultFunction: any) => (variables: any) => Promise<any>;
/**
* Stream a list query as an async iterable using batches.
* Allow to perform huge queries, replace queryHugeData
*/
export declare const streamQuery: <R>(listFunction: any, countFunction?: ({ offset, first }: {
offset: any;
first: any;
}) => Promise<{}>) => ({ first, offset, batchSize, batchConcurrency, ...variables }: {
[x: string]: any;
first?: number;
offset?: number;
batchSize?: number;
batchConcurrency?: number;
}) => Promise<AsyncIterableIterator<R>>;