This was recently asked on #SitecoreSlack in the #jss channel, which you should totally join if you haven't already.

The ask was how to list all language versions of an item through GraphQL. I didn't know the answer off the top of my head but I popped open (the built in) GraphiQL editor for my JSS application and discovered that this is possible to do through the existing API.

Here's an example of what that query might look like:

query LanguageVersionQuery($path:String) {
  item(path:$path) {
    versions(allLanguages: true) {
      name,
      language {
        name
      }
    }
  }
}

I could see this being pretty useful for implementing a drop down on a page to switch to a different language translation for some piece of content or something similar.

If you're interested in learning more about GraphQL and SitecoreJSS, check out my talk from 2019 SUGCON EU where I walk through the documentation explorer and work through some examples to show off some of the potential.

See you on #SitecoreSlack!