Hi,
Instead of return the scalar JsonField
in the GraphQL introspection
type NewsletterBlockModelDescriptionField {
blocks: [String!]!
links: [String!]!
value: JsonField!
}
Rather return a custom scalar so we can easily map it to the correct type when using graphql codegen.
scalar StructuredTextDocument
type NewsletterBlockModelDescriptionField {
blocks: [String!]!
links: [String!]!
value: StructuredTextDocument!
}
In codegen we can then map the scalar explicitly to the type StructuredTextDocument
from react-datocms
for example.
We now have a work around involving patching the returned introspection query, but this is a bit annoying to maintain
Regards