I'm making a headless Drupal site with Gatsby using paragraphs. I'm experienced with Drupal but relatively new with gatsby/graphql.
The issue I'm running into is that if our database does not actually have any instances of a paragraph, then it generates the schema without that (i guess it generates a minimal schema based on what exists, not what types are actually possible) and it errors out because it's not an allowed type in the schema when it gets to that paragraph in my graphql union type.
I'm getting around this currently by making sure there's a node with content with all the possible paragraphs (or referenced nodes for entity reference fields). Everything works then, but this is a bad solution, especially for a site that'll eventually be handed off to a client. I feel like there's gotta be a way to make them optional in graphql or not break the build if one paragraph doesn't exist in content.
I know I can customize the schema, but some content types have 10-20 possible paragraphs and that'd just get insane if I had to manually maintain the schema when it's so close to what I need automatically.
Any help would be greatly appreciated. Thanks!