GraphQL::MaybeTypeCheck - Conditional type-checking at runtime
use GraphQL::MaybeTypeCheck; method foo( $arg1 Str, $arg2 Int ) :ReturnType(Map[Str, Int]) { # ... }
This module optionally enables type-checking in the caller as implemented by Function::Parameters and Return::Type depending on whether Devel::StrictMode is activated.
Devel::StrictMode
When Devel::StrictMode is active, this module will import Function::Parameters into the caller with its default configuration. As of writing, this includes checking both argument count and type.
When in strict mode this also requires Return::Type which registers the ReturnType attribute.
require
ReturnType
When strict mode is inactive this module still imports Function::Parameters into the caller however it sets fun and method to lax mode and disables argument type checking.
Function::Parameters
fun
method
This also installs a no-op ReturnType attribute so the existing syntax isn't broken.
To install GraphQL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GraphQL
CPAN shell
perl -MCPAN -e shell install GraphQL
For more information on module installation, please visit the detailed CPAN module installation guide.