Content Relationship and Slice Machine with locales

Hi,

I have a a Content Relationship field in my slice. I pass extra fields from the page into the slice with fetchLinks. Everything seems to be working. However, I have 4 different locales on the website and it doesn't pass any extra fields into the slice once I introduce locale to the query. Please have a look at these examples:

working query without locale:

const page = await client.getSingle(
    "homepage",
    { fetchLinks: ["promo_banner.title, promo_banner.description"] }
  );

NOT working query with locale (it doesn't add fields from fetchLinks):

export async function getStaticProps({ locale, previewData }) {

  const client = createClient({ previewData });

  const page = await client.getSingle(
    "homepage",
    { lang: locale },
    { fetchLinks: ["promo_banner.title, promo_banner.description"] }
  );

  const articles = await client.getAllByType("article", { lang: locale });

  return {
    props: {
      page,
      articles,
    },
  };
}

Any ideas how can I pass localised data into the slice using fetchLinks?

Thank you,
Jev

Hi @jev1

Thanks for reaching out.

I'm currently investigating the issue, and I will let you know if I figure out the issue.
Also, have you tried to use GraphQuery instead of FetchLinks V1 as GraphQuery (FetchLinks v2) is an evolution over the V1

Hi @jev1
Can you try putting the query options together such:

const page = await client.getSingle(
  "homepage",
  {
    lang: locale,
    fetchLinks: ["promo_banner.title, promo_banner.description"],
  }
);