✨ Register: Show list of active products

🛠 Generate apollo client typescript helpers from graphql schema
This commit is contained in:
nikolark committed 2021-10-30 17:29:16 +02:00
1 parent fa89353525
commit f0656b34e9
13 files changed
+8165 -173

No files matched your search

+9 -2
View File
@@ -1,10 +1,17 @@
import strawberry
import strawberry_django
from strawberry_django import auto
from main import models
@strawberry.django.type(models.Product)
@strawberry_django.filters.filter(models.Product)
class ProductFilter:
id: auto
active: auto
@strawberry_django.type(models.Product, filters=ProductFilter)
class Product:
id: auto
name: auto
@@ -14,7 +21,7 @@ class Product:
@strawberry.type
class Query:
all_products: list[Product] = strawberry.django.field()
all_products: list[Product] = strawberry_django.field()
schema = strawberry.Schema(query=Query)