gatsby-source-strapi
gatsby-source-strapi copied to clipboard
Common GraphQL object type for images
Currently when a component uses an image, an object type is created in the schema that looks similar to this: STRAPI__COMPONENT_NAMEImage
. Even if multiple image fields are used there are many duplicate ObjectTypes with different names created although their schemas are all the same.
It would be great to have them all use the same object type e.g. STRAPI__IMAGE or implement a common GraphQL Interface.
Why? This would make it easier to build queries using fragments. One could define an image component in gatsby that has a fragment on the image type/interface and re-use it all throughout the page.
Just added PR #286 that should solve this issue by simply extracting images into own nodes and linking them (similar to how JSON/Text is handled but with a constant type).