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.1.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.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for tarxemo_django_graphene_utils-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5695be573d3409b233a7b96a8fb589aaaf4488dac45e206daa348facbfe2a9c7
MD5 38c575847cade01b4476bd4471fe242a
BLAKE2b-256 682f5924e57295804496309f7a16b87a3a383721dc5f65476217bad54439567c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tarxemo_django_graphene_utils-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 31ed07c858a693300b3b5d5b5366cd4c672d104a3a4401df401046ea4c2cbb08
MD5 38914e2c7bfeeedbf296a71e838b6604
BLAKE2b-256 795686fd9f764010b0be1726a926eb782829bb9c9942212cb9f2b1b33e7862df

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