strapi-community / strapi-plugin-slugify

A plugin for Strapi Headless CMS that provides the ability to auto slugify a field for any content type.

Home Page:https://market.strapi.io/plugins/strapi-plugin-slugify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: add locale param option for gql

gregghawes opened this issue · comments

When translating my categories, quite a few are the same across different languages.

Would it be possible to have an option to allow duplicated slugs and a "locale" option in the findSlug graphql method?

If you set the slug field localization to disabled it should have the same value for all locales.

I will look into adding the locale param for gql. PRs are always welcome :)

Curious if there's been any movement on this or if anyone's found a solution. Cheers!

No progress on it atm, I haven't had a chance to look into this yet.

Need to research on how we can check if i18n are enabled and content is localized.

Naive way would be to check if the plugin is installed but don't believe that's a guarantee.

Is there a way to use the pattern outlined here for GraphQL?

No, not in gql.

The problem with gql is that it's not so easy to do things dynamically due to the schema.

For example in this case, their is no way for me to dynamically define the locale param as being valid for one content type but not another. With REST I don't need to do any of that.

I will see if their is someway to incorporate the already existing filter support for the generated type but will need some investigation.

I already started work on it on the feat-gql-add-locale-support branch but it would be for all content types so not ideal.