DBIO-GraphQL

Auto-generate a GraphQL schema from a DBIO schema.

DBIO::GraphQL->to_graphql($schema) introspects every source registered with a connected DBIO::Schema and returns an executable GraphQL::Schema with:

Composite primary keys are supported throughout.

Synopsis

use DBIO::GraphQL;
use GraphQL::Execution qw(execute);

my $db     = My::Schema->connect(...);
my $result = DBIO::GraphQL->to_graphql($db);

# Plural query with nested-DBIO-style filter
execute($result->{schema}, '
  query {
    allBooks(
      filter:  { title: { like: "%Perl%" } }
      orderBy: { field: "title", direction: ASC }
      page:    { skip: 0, take: 5 }
    ) {
      total nodes { id title }
    }
  }', undef, $result->{context});

See the module POD (perldoc DBIO::GraphQL) for the full query/mutation surface, filtering operators, pagination, limitations, and known behaviour.

Architecture

DBIO::GraphQL is a thin orchestrator over four focused modules:

Each module is independently testable through its own public interface.

Acknowledgements

DBIO port of DBIx::Class::Schema::GraphQL by Mohammad Sajid Anwar (MANWAR). The original DBIx::Class implementation, design, and documentation are his work; this distribution adapts them to the DBIO schema introspection API and re-architects the filter surface into a nested per-column shape that mirrors DBIO's native search-condition format.