UNPKG

@cran/gql.core

Version:

Cran/GraphQL Core Utilities

18 lines (17 loc) 681 B
import type { Derivative } from "./parse"; import type { Plugin } from "../plugins/Plugin"; export declare namespace createScalar { interface Types { string: string; number: number; boolean: boolean; object: Record<string, Derivative>; array: Array<Derivative>; } type Invalid = (reason?: string) => string; type Casts = { [Key in keyof Types]?: boolean | ((value: Types[Key], invalid: Invalid) => string); }; type Serializer = (value: unknown) => unknown; } export declare function createScalar(name: string, description: string, casts: createScalar.Casts, serialize?: createScalar.Serializer): Plugin<any>;