UNPKG

@graphql-inspector/action

Version:

GraphQL Inspector functionality for GitHub Actions

35 lines (34 loc) 1.14 kB
import { Source } from 'graphql'; import * as probot from 'probot'; import { Endpoint, NormalizedEnvironment, SchemaPointer } from './config.js'; type FileLoaderConfig = { context: probot.Context; owner: string; repo: string; action: string; release: string; }; interface FileLoaderInput { path: string; ref: string; alias: string; throwNotFound?: boolean; onError?: (error: any) => void; } export type FileLoader = (input: FileLoaderInput) => Promise<string | null>; export type ConfigLoader = () => Promise<object | null | undefined>; export declare function createFileLoader(config: FileLoaderConfig): FileLoader; export declare function createConfigLoader(config: FileLoaderConfig & { ref: string; }, loadFile: FileLoader): ConfigLoader; export declare function printSchemaFromEndpoint(endpoint: Endpoint): Promise<string>; export declare function loadSources({ config, oldPointer, newPointer, loadFile, }: { config: NormalizedEnvironment; oldPointer: SchemaPointer; newPointer: SchemaPointer; loadFile: FileLoader; }): Promise<{ old: Source; new: Source; }>; export {};