2024-03-22 09:56:30 -07:00
|
|
|
from typing import List
|
|
|
|
|
|
|
|
import strawberry
|
|
|
|
import strawberry_django
|
2021-06-25 14:12:09 -04:00
|
|
|
|
2023-03-23 05:42:18 -07:00
|
|
|
from extras import models
|
2021-06-25 14:12:09 -04:00
|
|
|
from .types import *
|
2023-11-30 13:36:33 -08:00
|
|
|
|
|
|
|
|
2024-03-22 09:56:30 -07:00
|
|
|
@strawberry.type
|
|
|
|
class ExtrasQuery:
|
|
|
|
@strawberry.field
|
|
|
|
def config_context(self, id: int) -> ConfigContextType:
|
|
|
|
return models.ConfigContext.objects.get(pk=id)
|
|
|
|
config_context_list: List[ConfigContextType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def config_template(self, id: int) -> ConfigTemplateType:
|
|
|
|
return models.ConfigTemplate.objects.get(pk=id)
|
|
|
|
config_template_list: List[ConfigTemplateType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def custom_field(self, id: int) -> CustomFieldType:
|
|
|
|
return models.CustomField.objects.get(pk=id)
|
|
|
|
custom_field_list: List[CustomFieldType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def custom_field_choice_set(self, id: int) -> CustomFieldChoiceSetType:
|
|
|
|
return models.CustomFieldChoiceSet.objects.get(pk=id)
|
|
|
|
custom_field_choice_set_list: List[CustomFieldChoiceSetType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def custom_link(self, id: int) -> CustomLinkType:
|
|
|
|
return models.CustomLink.objects.get(pk=id)
|
|
|
|
custom_link_list: List[CustomLinkType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def export_template(self, id: int) -> ExportTemplateType:
|
|
|
|
return models.ExportTemplate.objects.get(pk=id)
|
|
|
|
export_template_list: List[ExportTemplateType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def image_attachment(self, id: int) -> ImageAttachmentType:
|
|
|
|
return models.ImageAttachment.objects.get(pk=id)
|
|
|
|
image_attachment_list: List[ImageAttachmentType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def saved_filter(self, id: int) -> SavedFilterType:
|
|
|
|
return models.SavedFilter.objects.get(pk=id)
|
|
|
|
saved_filter_list: List[SavedFilterType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def journal_entry(self, id: int) -> JournalEntryType:
|
|
|
|
return models.JournalEntry.objects.get(pk=id)
|
|
|
|
journal_entry_list: List[JournalEntryType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def tag(self, id: int) -> TagType:
|
|
|
|
return models.Tag.objects.get(pk=id)
|
|
|
|
tag_list: List[TagType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def webhook(self, id: int) -> WebhookType:
|
|
|
|
return models.Webhook.objects.get(pk=id)
|
|
|
|
webhook_list: List[WebhookType] = strawberry_django.field()
|
|
|
|
|
|
|
|
@strawberry.field
|
|
|
|
def event_rule(self, id: int) -> EventRuleType:
|
|
|
|
return models.EventRule.objects.get(pk=id)
|
|
|
|
event_rule_list: List[EventRuleType] = strawberry_django.field()
|