coerceInputValue.d.ts 401 B

1234567891011121314151617
  1. import { GraphQLInputType } from '../type/definition';
  2. import { GraphQLError } from '../error/GraphQLError';
  3. type OnErrorCB = (
  4. path: ReadonlyArray<string | number>,
  5. invalidValue: any,
  6. error: GraphQLError,
  7. ) => void;
  8. /**
  9. * Coerces a JavaScript value given a GraphQL Input Type.
  10. */
  11. export function coerceInputValue(
  12. inputValue: any,
  13. type: GraphQLInputType,
  14. onError?: OnErrorCB,
  15. ): any;