GraphQL::Role::HashMappable - GraphQL object role
with qw(GraphQL::Role::HashMappable);
# or runtime
Role::Tiny->apply_roles_to_object($foo, qw(GraphQL::Role::HashMappable));
Provides method for mapping code over a hash-ref.
Given a hash-ref, returns a modified copy of the data. Returns undef if given
that. Parameters:
- $item
- Hash-ref.
- $source
- Hash-ref of the source data for this hash. Will be used only for its
keys.
- $code
- Code-ref.
Each value will be the original value returned by the given
code-ref, which is called with $keyname,
$value. Will call the code for all given keys, but
not copy over any values not existing in original item.
If code throws an exception, the message will have added to it
information about which data element caused it.