Skip to main content

GQLA - GraphQL Assistant

GQLA provides an easy way to fetch data from GraphQL api on server side.

Navigation:

Intro

GQLA is published under MIT license and doesn't provide any warranty. It is single person developed package.
No roadmap No warranty No consistency No active and fast responces to dev

Usage

WARNING : watch carefull about your recursion depth; nodes and edges also counted as recursion level;

Example of basic usage bellow:

from gqla import GQLA

# Create a list of ignored fields (recommended values)
ignore = ['pageInfo', 'deprecationReason', 'isDeprecated', 'cursor', 'parent1', 'id']

# Create a list of fields you only want to retrieve
only = ['edges', 'node', 'code', 'name', 'StarObject', 'PlanetObject', 'orbitals']

# Create a GQLA class instance with provided settings
helper = GQLA('solar', url='localhost', port='8080', usefolder=True, only=only, ignore=ignore, recursive_depth=5)

# Set output visualization to "pretty" json
helper._pretty = True

# Gather service structure
await helper.introspection()

# Request 'allStellar' query with arguments (filters:{not: {objectType: planet}}, first: 5) and save to json file
await helper.query_one('allStellar', usefolder=True, filters={'not': {'objectType': 'planet'}}, first='5')

# Request 'allStellar' query with fields in 'only' list and arguments (first: 1) without saving to file
result = await helper.query_one('allStellar', usefolder=False, only_fields=True, first='1')

# Print result of execution
print(result)

Installation

PIP

  • pip install gqla

SETUP

  • python setup.py install

Requirements:

  • r/w access if using folder to save infrastucture
  • python >= 3.5
  • aiohttp

Structure

Classes
  • statics - static data like intrispection query and url/query templates
  • GQLStorage - Storage package to contain and parse GraphQL data types
  • VerticalStorage - package to share data between vertical structures
  • Generator - Generator package used to create queries from model
  • GQLModel - Model package containing GraphQL service data
  • abstracts - package containing abstracts of all classes
  • GQQStorage - Queries storage package
  • Executor - Executor package
  • GQQuery - Queries package
  • GQLA - main class
Parameters:
  • usefolder - directive to use folder to store data such as service model, querries and returned data
  • name - name used to define service; required to create folders if usefolder is set
  • _subpid - number of subtask running; No actual usage besides logging
  • ignore - list of statements to ignore during querries generation
  • only - list of statements to keep during querries generation
  • recursive_depth - recursion depth limitation;
  • port - port of GraphQL service
  • url - url of GraphQL service
Methods

Notice that async meant to execute in execution loop;

  • introspection - method to gather information about service;async
  • query_one - method to generate and execute querries;async

Release files for gqla 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gqla 1.1.2
File Size Uploaded
gqla-1.1.2.tar.gz 15.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gqla 1.1.2
File Interpreter ABI Platform
gqla-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 33.7 kB

Release files / gqla-1.1.2.tar.gz

Download URL gqla-1.1.2.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
90113a57f7920e343de02767baf4c37155ecaebd763dc75d23d39ebca23cf2f9
BLAKE2b-256 checksum
How to use checksums
ed2e7804d6963424e45eb2af5bf45da02f197c1fd692c090029ed0e233c180ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

Release files / gqla-1.1.2-py3-none-any.whl

Download URL gqla-1.1.2-py3-none-any.whl
Size 18.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79242af47306cfa506ec52f9d1b0464bf0143a89f5714451d46d89bc397ada5a
BLAKE2b-256 checksum
How to use checksums
5098e4c71674bf97b50fb66f205aa543a828d67e9f202d71bc22af18b63193c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

Release history Release notifications | RSS feed

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.4.3

2 release files

0.3.7

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page