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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for tarxemo_django_graphene_utils-0.1.2.tar.gz
Algorithm Hash digest
SHA256 6e4f83a4bc872e15d7e209a4f3f0b832d5046da010afe663772e66aa69b64be9
MD5 2a627e9ef6bc70718c89f53b71a14adb
BLAKE2b-256 ab22fac08a36602d60bfe8c1f6aff8b5fa119d462ef41ef0665a687665161bf2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tarxemo_django_graphene_utils-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d8624f89661d65c83d1227a5e9455b18d2b8f07f99e36a9e9004b83d36257301
MD5 b721be7258a715730aca63cd3ba3e657
BLAKE2b-256 364905ebb666dde775128b9bbe3e90030cecee4682c740aa7677703295ea4693

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