graphile-test
Version:
PostGraphile Testing
18 lines (17 loc) • 841 B
TypeScript
import { ExecutionResult, DocumentNode } from 'graphql';
import { PostGraphileOptions } from 'postgraphile';
import type { Client, Pool } from 'pg';
import { GetConnectionOpts, GetConnectionResult } from 'pgsql-test';
import { GetConnectionsInput } from './types';
export declare const runGraphQLInContext: <T = ExecutionResult>({ input, conn, pgPool, schema, options, authRole, query, variables, reqOptions }: {
input: GetConnectionsInput & GetConnectionOpts;
conn: GetConnectionResult;
pgPool: Pool;
schema: any;
options: PostGraphileOptions;
authRole: string;
query: string | DocumentNode;
variables?: Record<string, any>;
reqOptions?: Record<string, any>;
}) => Promise<T>;
export declare function setContextOnClient(pgClient: Client, pgSettings: Record<string, string>, role: string): Promise<void>;