Test::Snapshot - automate externalising "expected" data

During the ongoing development of graphql-perl, I have found it valuable to generate data structures, and to compare those with expected values. Often, these have been highly detailed rather than a subset, because I wanted to know when anything changed.

When, however, something does validly have to change, it might change quite a few "expected" outputs. If those all need updating manually, that is a lot of repetitive activity. What if the computer could do that instead? What if Perl had "snapshot testing" as used in JavaScript frontend development, most popularly in /var/www/users/ed_j/index.html

graphql-perl - plugin to make GraphQL "just work" with OpenAPI

The just-released v0.03 of GraphQL::Plugin::Convert::OpenAPI provides a plugin to convert a given OpenAPI specification (the spec formerly known as Swagger) to a GraphQL schema.

There is also now a sample OpenAPI applet for Mojolicious::Lite. It provides a GraphQL interface to the superb CPAN Testers REST API. Here is an example query:

{
  v3_report_get(id: "a35ce723-6bf8-1014-858b-1fdf904…

graphql-perl - plugin to make GraphQL "just work" with DBIx::Class

As mentioned in the LPW "trailer" for shiny new toys, I will be giving a talk on graphql-perl. I promised to talk about introspecting a DBIx::Class schema to make a GraphQL interface. This is how!

The API for a "convert plugin" for graphql-perl is simple: implement a to_graphql, and optionally a from_graphql method. The to_graphql returns a hash-ref with three keys:

    /var/www/users/ed_j/index.html

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…