Skip to main content

GraphQL Query Modules

Project description

Importable GraphQL modules

Documentation Status

gqlmod allows you to keep your GraphQL queries in .gql files and import them as modules.

  • Validation of queries at import time
  • Validation of queries against the schema


Install both gqlmod and any providers you need. (The starwars provider ships with gqlmod, so you can begin playing with it immediately.)

Define a .gql file with your queries and mutations, like so:


query HeroForEpisode($ep: Episode!) {
  hero(episode: $ep) {
    ... on Droid {
    ... on Human {

And then you can just import it and use it:

import gqlmod  # noqa
from mygql import HeroForEpisode



So why use this?

  • Strong validation as soon as possible (when the modules are imported)
  • All the work is done at warmup, not when the query is made
  • I think not mixing languages produces cleaner code?

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for gqlmod, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size gqlmod-0.1-py3-none-any.whl (11.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size gqlmod-0.1.tar.gz (17.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page