I am working with react-native and using the
StructuredText component you provide.
- I released mobile apps that support
StructuredText with a block of
- A few weeks later, I want to add a block of
type B to
- For old app versions that does not fetch block B in their graphql query, I have this crash The Structured Text document contains a ‘block’ node, but cannot find a record with ID 146357494 inside data.blocks!
What’s the recommended way to support adding a new block without breaking all previous versions?
I can try to parse the DAST schema and remove blocks that the current app version does not support but Is there an other way?
It would help if the
StructuredText component was not throwing in case a block is not found (which can be perfectly fine in my scenario)
Thanks a lot for your help
Hello @christophe.menager and welcome to the community!
If a block value is present inside a structured text, you must request also the “blocks” in the GraphQL query, and also provide a renderRule for that block.
Otherwise, the StructuredText component would not be able to render that block:
Since blocks are custom pieces of schema, we have no way of knowing how the user would like to map the structure of the block to HTML, so without a renderRule, and the blocks being requested through the GraphQL query, we can’t render the structured text if a block is present.
Thanks @m.finamor , I got an answer from the support in parallel and got the opportunity to give a bit more details.
Your answer is the same pre-written question than your colleague, that is not answering my problem by the way
I will create a feature request for an “Ignore unsuported blocks option” in the
Recap of my situation for others reading this question:
In my situation:
- I don’t fetch the block in my graphql query
- I don’t handle that block in the renderRule
- I simply want to NOT handle this unsupported block and not return it
Hello @christophe.menager, i’m the same person that replied over to you over at email@example.com thats why the answers are equal, sorry
I’ve added the feature request to the roadmap and we’ll make sure to update you on any new developments