from typing import Optional import dateutil.parser import django.db.utils import graphql import kocherga.projects.models import kocherga.wagtail.models from kocherga.error import PublicError from kocherga.graphql import django_utils, g, helpers from kocherga.graphql.basic_types import BasicResult from kocherga.graphql.permissions import authenticated from ... import models, permissions from ..types import Event c = helpers.Collection() EventUpdateResult = g.ObjectType( 'EventUpdateResult', g.fields({ 'ok': Optional[bool], 'event': g.NN(Event) })) @c.class_field class eventCreate(helpers.BaseFieldWithInput): def resolve(self, _, info, input): title = input['title'] start = input['start'] end = input['end']
from kocherga.graphql import g, helpers from .. import models fields = helpers.Collection() @fields.class_field class id(helpers.BaseField): def resolve(self, obj: models.Payment, info): return obj.pk permissions = [] result = 'ID!' @fields.class_field class kassa_id(helpers.BaseField): def resolve(self, obj: models.Payment, info): return obj.get_kassa_id() permissions = [] result = str @fields.class_field class is_paid(helpers.BaseField): def resolve(self, obj: models.Payment, info): return obj.is_paid permissions = []