Dunkel-Design / craft-graphql-sites

MIT License
2 stars 0 forks source link

[FR] Add site names, handle and site groups to GraphQL #1

Closed rtrudel closed 2 months ago

rtrudel commented 2 months ago

We can currently retrieve the language, the baseUrl, and the id, but similarly, it would be interesting to have the name, the handle and the information regarding the site group, just like craft.app.sites.getAllSites() does.

If it is too complex for the site groups, at least the name and handle of the site in addition to the information already returned.

By the way, I don't understand why this isn't built into Craft CMS, it seems like that would be the normal place for it, so thank you for addressing this gap.

soerenmeier commented 2 months ago

I think you should now be able to get almost all fields. Let me know if one is still missing or the group query is not what you need.

query {
  # csites for craft sites, because craft might wan't to use sites in the future
  csites {
    id
    baseUrl
    language
    name
    handle
    enabled
    hasUrls
    primary
    sortOrder
    group {
      id
      name
    }
  }
}

Is Published as v0.1.5

rtrudel commented 2 months ago

This is perfect! This is exactly what should be! Thank you!