GraphQ...e::Enum(3pm)
π NAME π
GraphQL::Type::Enum β it's the GraphQL enum type, bestie. That's it, that's the whole vibe. β¨
(Also if you peeped the page header, it says GraphQ...e::Enum(3pm) from the User Contributed Perl Documentation β yeah, that's just our girl GraphQL::Type::Enum with a lil nickname. She's the same queen. π)
π SYNOPSIS π
Okay so here's how you actually summon her:
use GraphQL::Type::Enum;
my %text2value;
my $type = GraphQL::Type::Enum->new(
name => 'Enum',
values => { value1 => {}, value2 => { value => 'yo' } },
);
Look at that. %text2value is just chillin' there, value1 gets no config at all (she's low maintenance π
), and value2 is out here with value => 'yo'. Iconic behavior fr fr.
π¦ ATTRIBUTES π¦
She's got name and description handed down from GraphQL::Role::Named. Family traits, yk? π«Ά
β¨ values β¨
This one's a hash-ref that maps value labels π to a hash-ref description. And the description keys? Every single one is optional. No pressure, no stress, no cap.
valueβ the actual Perl value of that item. If you don't specify it, it just defaults to the string name of the value. And ngl, integers are often useful here. πdeprecation_reasonβ the reason, if this thing is deprecated. And heads up: if you supply it, the hash for that value ALSO gets anis_deprecatedkey with a true value. Two for one, slay. πdescriptionβ the description. Yeah. That's the whole thing. It describes. π
π METHODS π
β is_valid β
Returns true if the Perl entity you handed her is a valid value for this type. She relies on unique stringification of the value to do it β so if your stringification is out here being messy and not unique, that's on you bestie, not her. π
π₯ BUILD π₯
Internal method. Don't touch, don't look, don't perceive her. She's doing her little behind-the-scenes thing. Main character energy only when she wants to be seen. β¨
Real talk though: this is all the page gives us, so I'm not about to invent extra lore. What's here is here, periodt. π
And that's the whole page, bestie! Signing off with the deets from the footer: this was perl v5.34.0, dated 2022-03-27, and the page itself is GraphQ...e::Enum(3pm) from the User Contributed Perl Documentation. Now go build something cute with your enums. Byeee! π§πΈ
π¦ where this page comes from
- debian bookworm: libgraphql-perl 0.54-1 Β· Artistic-2.0
- debian trixie: libgraphql-perl 0.54-1 Β· Artistic-2.0
- ubuntu noble: libgraphql-perl 0.54-1 Β· Artistic-2.0
- ubuntu resolute: libgraphql-perl 0.54-1 Β· Artistic-2.0
- ubuntu stonking: libgraphql-perl 0.54-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms