torchbox / wagtail-grapple

A Wagtail app that makes building GraphQL endpoints a breeze!
https://wagtail-grapple.readthedocs.io/en/latest/
Other
151 stars 57 forks source link

SteamField block extra interfaces (part 1) #365

Closed mgax closed 10 months ago

mgax commented 10 months ago

Refs. https://github.com/torchbox/wagtail-grapple/issues/231

Allow specifying extra interfaces when registering a streamfield block:

@register_streamfield_block(extra_interfaces=(CustomInterfaceForBlock,))
class BlockWithCustomInterface(blocks.StructBlock):
    # ...
zerolab commented 10 months ago

@mgax merging this. As noted in Slack, I will move to declaring the additional interfaces via a property on the model, so will adapt this