summaryrefslogtreecommitdiff
path: root/school/node_modules/graphql/utilities/coerceInputValue.d.ts
blob: 45c70a5d333f8cfd45634214a4a89faeb7cb057b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { GraphQLInputType } from '../type/definition';
import { GraphQLError } from '../error/GraphQLError';

type OnErrorCB = (
  path: ReadonlyArray<string | number>,
  invalidValue: any,
  error: GraphQLError,
) => void;

/**
 * Coerces a JavaScript value given a GraphQL Input Type.
 */
export function coerceInputValue(
  inputValue: any,
  type: GraphQLInputType,
  onError?: OnErrorCB,
): any;