Currently, the snippet field of the SnippetChooserBlock type is non-nullable. As Wagtail doesn't enforce that a snippet referenced in a SnippetChooserBlock value cannot be deleted, this field should be nullable in the GraphQL schema.
If the referenced snippet object is deleted (ignoring the warnings provided by Wagtail's references index), the value of this field will be null. This may cause errors downstream as client code may not handle that the value may be null, as this condition is not indicated by the schema.
The use of required in graphene's field API unfortunately clashes with the same keyword in Wagtail's block API. However, per the docs, in the context of a graphene field it:
indicates [the] field as not null in the graphql schema. Same behavior as graphene.NonNull. Default False
Currently, the
snippet
field of theSnippetChooserBlock
type is non-nullable. As Wagtail doesn't enforce that a snippet referenced in aSnippetChooserBlock
value cannot be deleted, this field should be nullable in the GraphQL schema.If the referenced snippet object is deleted (ignoring the warnings provided by Wagtail's references index), the value of this field will be
null
. This may cause errors downstream as client code may not handle that the value may benull
, as this condition is not indicated by the schema.This also applies to ImageChooserBlock, DocumentChooserBlock, and PageChooserBlock.
The use of
required
in graphene's field API unfortunately clashes with the same keyword in Wagtail's block API. However, per the docs, in the context of a graphene field it: