simplify some type checks by fixing graphql schema
This commit is contained in:
@ -49,9 +49,9 @@ class EventCategory(models.Model):
|
||||
panels = [FieldPanel("name"), FieldPanel("slug"), FieldPanel("show_in_filters")]
|
||||
|
||||
graphql_fields = [
|
||||
GraphQLString("name"),
|
||||
GraphQLString("slug"),
|
||||
GraphQLBoolean("show_in_filters"),
|
||||
GraphQLString("name", required=True),
|
||||
GraphQLString("slug", required=True),
|
||||
GraphQLBoolean("show_in_filters", required=True),
|
||||
]
|
||||
|
||||
class Meta:
|
||||
@ -171,8 +171,20 @@ class EventPage(Page):
|
||||
GraphQLInt("price_regular"),
|
||||
GraphQLInt("price_student"),
|
||||
GraphQLInt("price_member"),
|
||||
GraphQLCollection(GraphQLForeignKey, "categories", "events.EventCategory"),
|
||||
GraphQLCollection(GraphQLForeignKey, "occurrences", "events.EventOccurrence"),
|
||||
GraphQLCollection(
|
||||
GraphQLForeignKey,
|
||||
"categories",
|
||||
"events.EventCategory",
|
||||
required=True,
|
||||
item_required=True,
|
||||
),
|
||||
GraphQLCollection(
|
||||
GraphQLForeignKey,
|
||||
"occurrences",
|
||||
"events.EventOccurrence",
|
||||
required=True,
|
||||
item_required=True,
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
@ -195,7 +207,7 @@ class EventOccurrence(Orderable):
|
||||
]
|
||||
|
||||
graphql_fields = [
|
||||
GraphQLString("start"),
|
||||
GraphQLString("start", required=True),
|
||||
GraphQLString("end"),
|
||||
GraphQLForeignKey("venue", "venues.VenuePage"),
|
||||
]
|
||||
|
Reference in New Issue
Block a user