[Python] How can a duration scalar from Django models be implemented for Strawberry GQL?

Discussão em 'Python' iniciado por Stack, Outubro 24, 2024.

  1. Stack

    Stack Membro Participativo

    How can Django duration model fields be exposed in a Strawberry GraphQL API? Is there a standard implementation for the ISO8601 duration format or does a custom scalar field need to be implemented?

    from django.db import models

    class MyModel(models.Model):
    name = models.CharField(max_length=255)
    my_duration = models.DurationField()

    Continue reading...

Compartilhe esta Página