statamic / ideas

💡Discussions on ideas and feature requests for Statamic
https://statamic.dev
32 stars 1 forks source link

site arg for graphql globalSets #1122

Open Narretz opened 9 months ago

Narretz commented 9 months ago

Right now, there's no way to get the globalSets of a site other than the default site without knowing the handle names. E.g. you can't do:

query Globals{
  globalSets(site: 'en') {
    handle
    ... on GlobalSet_Footer {
      main_text
    }
    ... on GlobalSet_SocialMedia {
      title
    }     
  }
}

Instead you have to do

query Globals{
  globalSet(site: "en", handle: "footer") {
    handle
    ... on GlobalSet_Footer {
      main_text
    }
  }
}

and so on.

This is very annoying and could be fixed by adding this site argument.