GraphQ...erface(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

πŸ’– GraphQL::Type::Interface(3pm) πŸ’–

okay bestie, welcome to the GraphQL::Type::Interface page β€” straight out of the User Contributed Perl Documentation section of your local man pages. she's giving interface energy, she's giving abstract type realness, and honestly? iconic. πŸŽ€


✨ NAME ✨

GraphQL::Type::Interface β€” it's a GraphQL interface type. that's it, that's the whole vibe. πŸ¦‹


✨ SYNOPSIS ✨

okay so here's literally how you'd spin one up. look at her go:

use GraphQL::Type::Interface;
my $ImplementingType;
my $InterfaceType = GraphQL::Type::Interface->new(
  name => 'Interface',
  fields => { field_name => { type => $scalar_type } },
  resolve_type => sub {
    return $ImplementingType;
  },
);

no cap, that's the whole thing. you pass a name, you pass fields, and if you're feeling fancy you hand her a resolve_type coderef that returns $ImplementingType. slay. πŸ’…


✨ ATTRIBUTES ✨

she doesn't hoard all her attributes herself, bestie β€” she borrows them, main character delegation energy:

  • she has name and description courtesy of GraphQL::Role::Named πŸŽ€
  • she has fields courtesy of GraphQL::Role::FieldsOutput 🌸

that's the tea. both rolled in, both ready to use.

🌈 resolve_type 🌈

  • resolve_type β€” it's optional, and it's a code-ref whose whole job is to resolve types. that's the entire description, fr fr. 🫢
heads up: nothing here says what happens if you don't pass it β€” the page just says it's optional, so that's all we're claiming. don't come for me. πŸ’€

and that's the page, bestie!! ✨ this little doc lives in the perl v5.34.0 era, dated 2022-03-27, and it was generated from the GraphQ...erface(3pm) man page header/footer situation β€” so if you're citing her, that's the tea. go build some interfaces, you absolute legend. πŸ‘‘πŸ’–

πŸ“¦ where this page comes from