You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building storybook, only a subset of resource types listed in packages/generator/src/storybook.ts are loaded to avoid massively bloating the assets loaded when visiting storybook.medplum.com. The way @medplum/fhir-router builds its GQL schema (in buildRootSchema) will almost always be incompatible with having loaded only a subset of types since buildRootSchema crawls through every element of each top-level resource type that was loaded and will pretty quickly hit a type that was not included in that list, e.g. Resource, Extension, oid, etc.
This hasn't been exposed since the common code paths that make GQL queries, e.g. medplum.requestSchema checks if the type has already been loaded and returns early before needing to make the GQL request. Given the tradeoffs of bloating the storybook build bundle size and complexity of recursively loading types, officially not supporting GQL in storybook could very well be a reasonable outcome; if so, an explicit error message should be thrown when a story attempts to do so.
The text was updated successfully, but these errors were encountered:
When building storybook, only a subset of resource types listed in
packages/generator/src/storybook.ts
are loaded to avoid massively bloating the assets loaded when visiting storybook.medplum.com. The way @medplum/fhir-router builds its GQL schema (inbuildRootSchema
) will almost always be incompatible with having loaded only a subset of types sincebuildRootSchema
crawls through every element of each top-level resource type that was loaded and will pretty quickly hit a type that was not included in that list, e.g.Resource
,Extension
,oid
, etc.This hasn't been exposed since the common code paths that make GQL queries, e.g.
medplum.requestSchema
checks if the type has already been loaded and returns early before needing to make the GQL request. Given the tradeoffs of bloating the storybook build bundle size and complexity of recursively loading types, officially not supporting GQL in storybook could very well be a reasonable outcome; if so, an explicit error message should be thrown when a story attempts to do so.The text was updated successfully, but these errors were encountered: