GraphQ...:Object(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::Object β€” bestie, it's giving GraphQL object type energy πŸ‘‘βœ¨


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so first you gotta pull it in, and then you build your lil type, no cap:

use GraphQL::Type::Object;
my $interface_type;
my $implementing_type = GraphQL::Type::Object->new(
  name => 'Object',
  interfaces => [ $interface_type ],
  fields => { field_name => { type => $scalar_type, resolve => sub { '' } }},
);

like. the way that just works. 🫢


🌸 ATTRIBUTES 🌸

so it's got name and description coming straight from GraphQL::Role::Named, and it's got fields from GraphQL::Role::FieldsOutput. inherited slay, honestly πŸ’…

πŸŽ€ interfaces

optional bestie, it's a thunked array-ref of the interface type objects that get implemented. iykyk ✨

πŸŽ€ is_type_of

also optional, a code-ref this time. what goes in: a value, an execution context hash-ref, and a resolve-info hash-ref. that's the vibe check right there πŸ”₯


fr fr that's the whole page. short, sweet, iconic. πŸ’œ

perl v5.34.0 🌈 2022-03-27 β€” mwah, that's a wrap, go forth and build your types, main character πŸ’–πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from