graphql-perl - Mojolicious::Plugin::GraphQL - Mojolicious GraphQL endpoint

Having made a Dancer 2 plugin to easily make GraphQL endpoints, it only seemed fair to make a Mojolicious plugin to do the same thing. That has just been released to CPAN. There is also a sample applet for Mojolicious::Lite.

Sample code from the applet:

my $schema = GraphQL::Schema->new(
    query => GraphQL::Type::Objec…

graphql-perl - Dancer2::Plugin::GraphQL - Dancer2 GraphQL endpoint

The porting of GraphQL to Perl 5 (sponsored by Perl Careers) continues. With v0.12, released 10 Oct, it is possible to run queries and return results. This includes the introspection query built in to GraphQL.

Now there is a Dancer 2 plugin: Dancer2::Plugin::GraphQL. This allows you to make a Dancer2 app that serves GraphQL, and - if configured suitably - serve the superb GraphiQL interface to interactively explore and query your schema, with type-ahead.

There is also a /var/www/users/ed_j/index.html

graphql-perl - MooX::Thunking - Deferred computation attributes

As part of porting GraphQL to Perl (sponsored by Perl Careers), one of my goals is to use the best possible practice in making rigorous code. One way to use this is to imitate the style of the JavaScript reference implementation's use of immutable data structures.

One problem arising is creating objects that have a reference to themselves. If the objects created were mutable, then one would simply create the object, then set the relevant attribute to include the object reference. If the objects are immutable this is not possible. For example:

graphql-perl - Pegex findings

I'm porting the reference implementation of GraphQL for JavaScript to Perl, sponsored by Perl Careers. Part of that is obviously to lex/parse GraphQL queries. I decided to try this with Pegex.

Key findings:

  • Pegex rules with regexes need to keep Pegex "atoms" separated from the "/" characters by whitespace, else it will be treated as a literal
  • If you override the "ws" rule, do not have "-" in a regex in any sub-rules, or the c…

graphql-perl - a GraphQL implementation in Perl

I have recently started porting the reference implementation of GraphQL for JavaScript to Perl, sponsored by Perl Careers. My key considerations:

  • Use as "modern" Perl as possible: one of the Mo* family, plus type-checking
  • Follow the JS implementation where it makes sense, but be open to more Perlish ways where that's easier/better

You can see the GitHub repo at https://github.com/graphql-perl/graphql-perl, an…