graphQLBigInt top-level property

GraphQLScalarType<BigInt, String> graphQLBigInt
final

A BigInt, serialized as an string.

Implementation

final GraphQLScalarType<BigInt, String> graphQLBigInt = GraphQLScalarTypeValue(
  name: 'BigInt',
  description: 'An arbitrarily large integer.',
  serialize: (bigInt) => bigInt.toString(),
  deserialize: (_, input) => BigInt.parse(input),
  specifiedByURL: 'https://api.dart.dev/stable/dart-core/BigInt-class.html',
  validate: (key, input) => BigInt.tryParse(input.toString()) != null
      ? ValidationResult.ok(input.toString())
      : ValidationResult.failure(
          [
            'Expected "$key" to be a number or numeric string. Got invalid value $input.'
          ],
        ),
);