Mojolicious::Plugin::Schema::GraphQL - Schema generator by Files for Mojolicious
use Mojolicious::Lite;
plugin 'Schema::GraphQL';
# only query
my $schema = app->schema('query');
# scalar and query
my $schema = app->schema('scalar', 'query');
# all
my $schema = app->schema;
1;
MyApp/Schema/scalar.graphql:
scalar Date
MyApp/Schema/query.graphql:
type Query {
name: String
email: String
date: Date
}
MyApp/Schema/mutation.graphql:
type Mutation {
post(url: String!, description: String!): Link!
}
type Link {
id: ID!
description: String!
url: String!
}
Mojolicious::Plugin::Schema::GraphQL Schema generator by Files for Mojolicious, ahe intention is to separate GraphQL schemas from Perl code.
# Mojolicious::Lite
plugin 'Schema::GraphQL' => {path => '/home/user/my-path'};
my $schema = $self->schema('name-of-schema');
Load, generate and cache a schema with given name.
Mojolicious, Mojolicious::Guides, http://mojolicio.us, GraphQL, Mojolicious::Plugin::GraphQL.
Lucas Tiago de Moraes lucastiagodemoraes@gmail.com
This software is copyright (c) 2020 by Lucas Tiago de Moraes.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.