October 2017 Archives

graphql-perl - graphql-js tutorial translation to graphql-perl and Mojolicious::Plugin::GraphQL

Version 0.16 of GraphQL implements most of using the Schema Definition Language to create schemas, rather than doing so programmatically. So let's now translate all the idioms in the JavaScript GraphQL tutorial into Perl!

EDIT version 0.17 implements the rest, so this tutorial translated has been updated slightly as you don't need to specify a schema at all if you call your query type Query, etc.

The form…

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 /users/ed_j/2017/10/index.html

About Mohawk

user-pic I blog about Perl.