NAME
DBIO::GraphQL::Policy - What DBIO::GraphQL exposes and who may use it (the trust model)
VERSION
version 0.900007
METHODS
monikers
The sources that are exposed, sorted.
included
$policy->included($moniker)
True when the source is part of the generated schema.
has_mutations
$policy->has_mutations($moniker)
True when the source gets createX / updateX / deleteX.
hidden
$policy->hidden($moniker, $column)
True for a column named in hide and for a column declared is_serializable => 0. A hidden column is no field, no filter field, no ordering and no mutation argument. The primary key stays usable as the identity of get, update and delete.
readonly
$policy->readonly($moniker, $column)
True for a column named in readonly: readable, but never a mutation argument.
visible_columns
my @cols = $policy->visible_columns($moniker);
The columns of the source that are not hidden, in source order.
writable_columns
my @cols = $policy->writable_columns($moniker);
The visible columns that are not readonly: what a mutation may take as a value.
check_depth
$policy->check_depth($info);
Dies when the field being resolved lies deeper than max_depth. The depth is the number of field names in the path of the resolve info (list indices do not count). The relationship resolvers call it, so the depth is bounded for a caller that executes the schema without the execute code reference of "to_graphql" in DBIO::GraphQL.
authorize
my $restriction = $policy->authorize($op, $moniker, $args, $context, $relationship);
Asks the authorize hook before a resolver touches the database. Without a hook everything is allowed. A false answer dies with not authorized; a true answer returns undef; a hashref returns the (non-empty) restriction for the caller to apply.
AUTHOR
DBIO Authors
COPYRIGHT AND LICENSE
Copyright (C) 2026 DBIO Authors
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.