I just installed the newest version, which works great for most of the things, but I stumbled upon some problems (I already mentioned some of them here, but maybe you overlooked it).
When querying with GraphQL, I can only specify the locale for a Content Type which has localization enabled, which makes sense in the first place, but has a major drawback: I canโt populate a relation with the needed locale. For example if I have a Content Type Hotel
and a Content Type WelcomeMessage
and the hotel has a 1-1 relation with the welcome message and my query looks like this:
query FindHotel($id: ID!) {
hotels(where: { id: $id }) {
id
name
welcomeMessage {
title
locale
}
}
}
How is it possible to retrieve a different locale for the welcomeMessage
then the default one? As a workaround, I could just query the localizations
field on welcomeMessage
and filter the content on the client side, which would be less than ideal and not very scalable.
Also, it is not possible to specify the locale when querying a single instance of a collection type by ID (screenshot of the generated schema):
Proposed solution for the above problems:
Instead of always returning the default locale or adding a locale parameter to each and every query, you could simply use the Accept-Language
header which every browser sends by default to determine the current content language. This would also work nicely with nested GQL queries.
In the meantime, is there any other possibility to make nested queries fully localized, e.g. by manipulating the context object or something?