wpengine / wp-graphql-content-blocks

Plugin that extends WPGraphQL to support querying (Gutenberg) Blocks as data

Home Page:https://faustjs.org/docs/gutenberg/wp-graphql-content-blocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: `BlockWithSupportsAnchor` is causing `DUPLICATE_TYPE` error

justlevine opened this issue · comments

When querying for editor blocks with GRAPHQL_DEBUG enabled, I get the following DUPLICATE_TYPE error:
You cannot register duplicate Types to the Schema. The Type 'BlockWithSupportsAnchor' already exists in the Schema. Make sure to give new Types a unique name.

This is due to the fact that that register_graphql_interface() is being called for every block type.

What should actually happen is that the BlockWithSupportsAnchor should be registered once in the Registry, and Block::register_block_supports_field() should only register_interface_to_type().

Example

image

+1 to this, it seems related to the new registering of the NodeWithEditorBlocks interfaces