GraphQ...e::Enum(3pm)

πŸ“¦
version 0.54 Β· 2 versions
  • 0.54 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.53 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 an is_deprecated key 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