When using the value field of an EmbedBlock in a query, it errors with "Cannot return null for non-nullable field EmbedBlock.value."
Steps to reproduce:
Define a StructBlock with an EmbedBlock field and register it with @register_streamfield_block
from wagtail.embeds import blocks as embeds_blocks
@register_streamfield_block
class EmbedStructBlock(blocks.StructBlock):
embed = embeds_blocks.EmbedBlock()
Register the field for GraphQL
from grapple.types import streamfield as grapple_streamfield
graphql_fields = [
grapple_streamfield.EmbedBlock(),
]
Use this EmbedStructBlock in a StreamField of a Page model and execute a GraphQL query which requests ‘value’ on the embed field
… on EmbedStructBlock {
testEmbed {
value
}
}
Switching the resolve_raw_value method of the EmbedBlock to resolve_value has solved this issue for me in the project I am currently working on
When using the value field of an EmbedBlock in a query, it errors with
"Cannot return null for non-nullable field EmbedBlock.value."
Steps to reproduce:
Switching the
resolve_raw_value
method of theEmbedBlock
toresolve_value
has solved this issue for me in the project I am currently working onShould
resolve_raw_value
actually beresolve_value
?