{"id":15723213,"url":"https://github.com/daun/statamic-graphql-alternate-locales","last_synced_at":"2025-07-10T08:42:20.013Z","repository":{"id":257808744,"uuid":"867313675","full_name":"daun/statamic-graphql-alternate-locales","owner":"daun","description":"List alternate locales of entries in Statamic GraphQL queries","archived":false,"fork":false,"pushed_at":"2024-10-13T10:48:58.000Z","size":184,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-03T05:37:56.634Z","etag":null,"topics":["graphql","i18n","locale","statamic"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-03T20:35:57.000Z","updated_at":"2024-10-13T10:49:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"63052714-bb48-4d60-8827-3d26d79e5386","html_url":"https://github.com/daun/statamic-graphql-alternate-locales","commit_stats":null,"previous_names":["daun/statamic-graphql-alternate-locales"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fstatamic-graphql-alternate-locales","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fstatamic-graphql-alternate-locales/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fstatamic-graphql-alternate-locales/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fstatamic-graphql-alternate-locales/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daun","download_url":"https://codeload.github.com/daun/statamic-graphql-alternate-locales/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253870865,"owners_count":21976613,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql","i18n","locale","statamic"],"created_at":"2024-10-03T22:10:42.941Z","updated_at":"2025-05-13T04:01:21.951Z","avatar_url":"https://github.com/daun.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Statamic GraphQL Alternate Locales\n\n**List alternate locales of entries in Statamic GraphQL queries.**\n\nThis addon provides a simple way of querying alternate languages of entries in GraphQL. Mainly\nuseful for frontend language switches.\n\n![Screenshot of locale query in Statamic GraphiQL interface](./art/statamic-graphql-alternate-locales.png)\n\n## Installation\n\n```sh\ncomposer require daun/statamic-graphql-alternate-locales\n```\n\n## Usage\n\nAfter installation, you can list all locales of an entry from the new `locales` field. It requires\nselecting the specific subfields to return. See below for a list of all supported subfields.\n\n```graphql\n{\n  page: entry(\n    collection: \"pages\"\n    slug: \"about\"\n    filter: { locale: \"en\" }\n  ) {\n    slug\n    title\n    locale\n    locales {\n      locale\n      slug\n      title\n    }\n  }\n}\n```\n\nThe above query would result in the following data:\n\n```json\n{\n  \"slug\": \"about\",\n  \"title\": \"About\",\n  \"locale\": \"en\",\n  \"locales\": [\n    {\n      \"locale\": \"de\",\n      \"slug\": \"ueber-uns\",\n      \"title\": \"Über uns\"\n    },\n    {\n      \"locale\": \"en\",\n      \"slug\": \"about\",\n      \"title\": \"About\"\n    }\n  ]\n}\n```\n\n## Publish status\n\nBy default, the `locales` field only returns entries in published locales. To include all locales\nregardless of publish status, set the `unpublished` arg to `true`:\n\n```graphql\nlocales (unpublished: true) {\n  locale\n  slug\n  title\n}\n```\n\n## Available subfields\n\n| Subfield | Type | Value |\n|---------------|---------------|---------------|\n| `id` | `string` | `$entry-\u003eid()` |\n| `locale` | `string` | `$entry-\u003elocale()` |\n| `current` | `boolean` | `$entry-\u003elocale()` === `locale` filter of query |\n| `slug` | `string` | `$entry-\u003eslug()` |\n| `url` | `string` | `$entry-\u003eurl()` |\n| `uri` | `string` | `$entry-\u003euri()` |\n| `permalink` | `string` | `$entry-\u003eabsoluteUrl()` |\n| `published` | `boolean` | `$entry-\u003epublished()` |\n| `private` | `boolean` | `$entry-\u003eprivate()` |\n| `status` | `string` | `$entry-\u003estatus()` |\n| `title` | `string` | `$entry-\u003eget('title')` |\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaun%2Fstatamic-graphql-alternate-locales","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaun%2Fstatamic-graphql-alternate-locales","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaun%2Fstatamic-graphql-alternate-locales/lists"}