1

I try to use graphQL to get language specific entries from my Craft CMS. I (naively?) tried this:

query {
    entries (section: "newsIntranet", language: "fr") {
        title
        postDate
        expiryDate
        contentText
    }
}

because of this part of doc. How can I get make sure that I only get entries of a given language when using graphQL from an extrernal system?

1
  • 2
    I tried using language too, and didn't seem to be able to make it work either. Have you tried using site or siteId instead? That seems to work for me. – Joorren Nov 9 '20 at 15:02
1

You'll want to use siteId for this.

query {
    entries (section: "newsIntranet", siteId: "2") {
        title
        postDate
        expiryDate
        contentText
    }
}

Swap out "2" with whatever the siteId of the French site is on your system.

1
  • Thank you a lot for your quick and helpful answer! – Jeremy Benks Nov 10 '20 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.