gatsby-source-strapi icon indicating copy to clipboard operation
gatsby-source-strapi copied to clipboard

Support plugin prefixes

Open mwoelk opened this issue 3 years ago • 1 comments

Plugins such as i18n include their own content types such as locale that can be queried via the api as well. Those are exposed on sub paths of the form /api/{plugin}/{pluralName}.

When trying to fetch e.g. the locale type, currently the request is made to /api/locales as it is resolved through the fetched schema but the plugin prefix is not used although it can be derived from the plugin field in the schema.

Why is this useful? Especially in the example case with locales, it can be used to query a list of all locales and their names in order to build e.g. a language switcher component.

mwoelk avatar Feb 19 '22 14:02 mwoelk

@mwoelk I agree this would be an awesome feature, I tried to add such logic to the plugin but I faced a wall at some point with endpoints that does not respect the new API format which is the case for i18n.

I guess since the i18n plugin is a core feature we could make an exception for it in order to be able to query it.

cc @remidej @markkaylor

soupette avatar Feb 21 '22 08:02 soupette