Skip to main content

Shared Django Graphene utilities and DTOs for efficient API development

Project description

TarXemo Django Graphene Utils

A utility collection for building standardized GraphQL APIs with Django and Graphene.

Installation

pip install tarxemo-django-graphene-utils

Usage

Standardized Responses

from tarxemo_django_graphene_utils import build_success_response, build_error

def resolve_something(root, info):
    if success:
        return build_success_response("Operation successful")
    return build_error("Something went wrong")

Pagination

from tarxemo_django_graphene_utils import get_paginated_and_non_paginated_data

def resolve_items(root, info, **kwargs):
    return get_paginated_and_non_paginated_data(
        model=MyModel,
        filtering_object=kwargs,
        graphene_type=MyModelType
    )

Building and Publishing

  1. Build the package:

    python setup.py sdist bdist_wheel
    
  2. Upload to PyPI (requires twine):

    twine upload dist/*
    

Project details


Download files

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

Source Distribution

tarxemo_django_graphene_utils-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tarxemo_django_graphene_utils-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file tarxemo_django_graphene_utils-0.1.0.tar.gz.

File metadata

File hashes

Hashes for tarxemo_django_graphene_utils-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3eee23c18604dcb32c999c1b8cd7da29fed218ad7c5e2b7ae099703a36182460
MD5 ce9f146d5e385d1757316ca85afb6c78
BLAKE2b-256 dbb1445e1d8c80c37ae75259de7ba905347fdfcd7c499e8b1eb5ffe22c6cf6c9

See more details on using hashes here.

File details

Details for the file tarxemo_django_graphene_utils-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tarxemo_django_graphene_utils-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 380014c03453c77bd1b30a8ddc90a3c29ad78ef6d48d27a43df3af849a6d0821
MD5 07243f6a0336ed5fabba8f31a7ca7032
BLAKE2b-256 0a8e1e95a6340b329ee2d191cf54dd286a21fa63d370b25e4d560df323a13fa1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page