Skip to main content

Shared Django Graphene utilities and DTOs for efficient API development

Project description

TarXemo Django Graphene Utils

PyPI version Framework :: Django License: MIT

Shared Django Graphene utilities and DTOs for efficient API development. This package provides standardized response builders, pagination helpers, and common GraphQL types.

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/*
    

tarxemo-django-graphene-utils

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.3.tar.gz (6.3 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.3-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for tarxemo_django_graphene_utils-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ce95236c2fdf973756202331bb4f66befca95bd897b9b4b44772e278ac20ed84
MD5 4c42dfe95a179844665031f8bb5347c2
BLAKE2b-256 e277ff1a02e7e86ea426d66ffa0e490b5db2db5e8b6637d2d5ca284173390b21

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tarxemo_django_graphene_utils-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 60ea025de3e1dafc063ef1021ab97df978600a750e9b850d85c34a77f8da1410
MD5 5561f54815689e0d893eedb7246ad35d
BLAKE2b-256 5b1d42c4a412ab036411b714a4fea92828fe2824bd74dc1127451434b891c77a

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