NAME

GraphQL::Houtou::Type::Scalar - built-in and custom GraphQL scalars

SYNOPSIS

use GraphQL::Houtou::Type::Scalar qw($String $Int $Float $Boolean $ID);

my $DateTime = GraphQL::Houtou::Type::Scalar->new(
  name        => 'DateTime',
  serialize   => sub { $_[0]->iso8601 },
  parse_value => sub { parse_iso8601($_[0]) },
);

DESCRIPTION

Exports the five specced scalars as ready-made instances. Custom scalars take serialize (internal value to response value) and parse_value (variable/argument input to internal value); both default to pass-through. specified_by_url adds the @specifiedBy URL. Input coercion for the built-in scalars runs natively in the XS lane.

SEE ALSO

GraphQL::Houtou