- Issue created by @apmsooner
- First commit to issue fork.
- π¦πΊAustralia almunnings Melbourne, π¦πΊ
Do you perceive
RouteEntityExtra
,EntityLoadRevision
andEntityConnectionQueryHelper
having the same issue with theirgetTranslated
code?I'm thinking we abstract the lot into a trait, which allows us to be consistent and possibly feature flag the behaviour
- πΊπΈUnited States apmsooner
@almunnings, i'm assuming yes an abstraction may be favorable but also a behavioral setting to how a site wants to handle. I found in the Wunder starter kit that they also have their own patch (https://patch-diff.githubusercontent.com/raw/drupal-graphql/graphql/pull...) that is addressing similar errors but they are just returning NULL which wouldn't be the expected behavior for everyone. I think there perhaps needs to be an underlying global setting that determines if default language fallbacks should be returned everywhere applicable.
- πΊπΈUnited States apmsooner
Noting also that the Wunder patch referenced above is against the graphql module so do we address these issues there or within graphql_compose? It certainly feels at least graphql_compose is more actively maintained but leveraging functions from graphql which seem to be the source of the underlying issues we're seeing.
- Status changed to Needs review
17 days ago 6:08am 7 May 2025 - π¦πΊAustralia almunnings Melbourne, π¦πΊ
Bigger commit here.
Might need to lean on our buddies Wunder and jmolivas to test.Anywhere we were loading translations i've shifted it off to a trait that has a hook.
If you have custom logic beyond whatever I'm doing here, probably the hook is a good way about it?
- π¦πΊAustralia almunnings Melbourne, π¦πΊ
Per your testing requirements
query MyQuery { node(id: "f099a6cd-f63b-4f9b-ba26-238cf2271fdc") { ... on NodePage { tags { __typename ... on TermTags { id name langcode { id } } } } } }
Response
{ "data": { "node": { "tags": [ { "__typename": "TermTags", "id": "1", "name": "AAAA", "langcode": { "id": "en" } }, { "__typename": "TermTags", "id": "2", "name": "BBBB", "langcode": { "id": "en" } }, { "__typename": "TermTags", "id": "3", "name": "CCCC", "langcode": { "id": "bn" } } ] } } }