GraphQL::Role::HashMappable(3pm)

GraphQL::Role::HashMappable3pm

Graphql object role

Usage

  with qw(GraphQL::Role::HashMappable);
  # or runtime
  Role::Tiny->apply_roles_to_object($foo, qw(GraphQL::Role::HashMappable));

Overview

Provides method for mapping code over a hash-ref.

Methods

hashmap

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.

Releases

Unchanged in 2 releases since Debian 12 (Bookworm).

  1. 12–13

From libgraphql-perl 0.54-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.