GraphQ...:Parser(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::Language::Parser β€” the GraphQL Pegex parser πŸ’–

okay so bestie, you found the manpage for GraphQL::Language::Parser and honestly? iconic. it's from the User Contributed Perl Documentation section (that's the 3pm girlies), so grab a strawberry πŸ“ and let's get into it.


✨ SYNOPSIS ✨

like, the vibe is literally just this:

use GraphQL::Language::Parser qw(parse);
my $parsed = parse(
  $source
);

that's it. that's the whole entrance exam. you pull in parse, you hand it your $source, and it hands you back a parsed thing. slay. πŸ’…


🌸 DESCRIPTION 🌸

so what is this thing actually doing? two jobs, main character energy, no notes:

  • it gives you an outside-accessible point of entry into the GraphQL parser β€” that's the parse up there in the SYNOPSIS, hi bestie πŸ‘‹
  • it's also a subclass of Pegex::Parser, and its whole deal is parsing a document into an AST that GraphQL can actually use

so like. it parses GraphQL. into a tree. that GraphQL then eats. periodt. 🌈


πŸ¦‹ METHODS πŸ¦‹

πŸ’« parse πŸ’«

parse($source, $noLocation);
NB: unlike in Pegex::Parser, this is a function, not an instance method. that's not a typo, that's on purpose β€” it's how the Pegex implementation details get hidden away so you never have to look at them. you're welcome. 🫢

πŸ’« format_error πŸ’«

an override of the parent method, because we do things our own way here. it returns a GraphQL::Error. so when something goes wrong, you get a proper little error object and not just vibes. 😭


πŸ‘‘ SEE ALSO πŸ‘‘

ngl the original page doesn't list any SEE ALSO refs, so this section is just me blowing you a kiss. πŸ’‹


and that's the whole page, bestie! this was perl v5.34.0, dated 2022-03-27, straight from the User Contributed Perl Documentation girlies. go parse something gorgeous. βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from