{"id":13516304,"url":"https://github.com/valu-digital/wp-graphql-polylang","last_synced_at":"2025-04-05T05:09:10.334Z","repository":{"id":35892069,"uuid":"174859761","full_name":"valu-digital/wp-graphql-polylang","owner":"valu-digital","description":"WPGraphQL Polylang Extension for WordPress","archived":false,"fork":false,"pushed_at":"2024-06-17T08:14:20.000Z","size":417,"stargazers_count":124,"open_issues_count":41,"forks_count":20,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-21T20:25:09.018Z","etag":null,"topics":["graphql","polylang","wordpress-plugin","wpml"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/valu/wp-graphql-polylang","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valu-digital.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2019-03-10T17:52:56.000Z","updated_at":"2024-09-16T04:15:42.000Z","dependencies_parsed_at":"2024-05-21T11:19:43.390Z","dependency_job_id":"a7512b73-f5e5-4474-a51d-7200d9ef6bad","html_url":"https://github.com/valu-digital/wp-graphql-polylang","commit_stats":{"total_commits":318,"total_committers":9,"mean_commits":"35.333333333333336","dds":"0.047169811320754707","last_synced_commit":"3a0f6dee0d0434dd36c60fd6892851d04a37b358"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valu-digital%2Fwp-graphql-polylang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valu-digital%2Fwp-graphql-polylang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valu-digital%2Fwp-graphql-polylang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valu-digital%2Fwp-graphql-polylang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valu-digital","download_url":"https://codeload.github.com/valu-digital/wp-graphql-polylang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289429,"owners_count":20914464,"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","polylang","wordpress-plugin","wpml"],"created_at":"2024-08-01T05:01:21.189Z","updated_at":"2025-04-05T05:09:10.314Z","avatar_url":"https://github.com/valu-digital.png","language":"PHP","funding_links":[],"categories":["Plugins"],"sub_categories":["WordPress"],"readme":"# WPGraphQL Polylang Extension\n\nExtend [WPGraphQL](https://www.wpgraphql.com/) schema with language data from\nthe [Polylang](https://polylang.pro/) plugin.\n\n## Features\n\nFor posts and terms (custom ones too!)\n\n-   Adds `language` and `translations` fields\n-   Filter with a `language` where argument\n-   Set the language on create and update mutations\n-   Show all translations in the api by default\n    -   Polylang patches the WP Query to only list items with the current\n        default language. This plugin reverts that for the GraphQL api\n-   ACF Options Pages support\n\nRoot queries\n\n-   `defaultLanguage` get the current default language\n-   `languages` list all configured languages\n\nMenu\n\n-   Filter menu items by language\n\nFor details please refer to the generated docs in GraphiQL.\n\n## Example\n\nExample showing all features\n\n```graphql\nquery PolylangExample {\n    # Filter pages by language. If not set it defaults to ALL\n    pages(where: { language: EN }) {\n        nodes {\n            title\n\n            # Get language of each page\n            language {\n                code # Language code\n                name # Human readable name of the language\n            }\n\n            # Get links to the translates versions of each page\n            # This is an array of post objects\n            translations {\n                title\n                link\n                language {\n                    code\n                }\n            }\n        }\n    }\n\n    # Taxonomies such as tags can be filtered like post objects\n    tags(where: { language: EN }) {\n        nodes {\n            name\n            language {\n                code\n                name\n            }\n        }\n    }\n\n    # Get translated version of a given menu\n    menuItems(where: { language: EN, location: FOOTER_MENU }) {\n        nodes {\n            url\n        }\n    }\n\n    # Get the default language\n    defaultLanguage {\n        name\n        code\n    }\n\n    # Get all configured languages\n    languages {\n        name\n        code\n    }\n\n    # Get translations for ACF Options Pages.\n    # See the section in the README.\n    siteSettings(language: EN) {\n        siteSettings {\n            footerTitle\n        }\n    }\n}\n```\n\n## Requirements\n\n-   PHP 7.2 or later\n-   [WPGraphQL][] 0.13.x or later\n-   Polylang 2.6.5 or later\n    -   The free version is enough\n    -   If you get the PRO version the pro features such as translated slugs will work too\n\n[pll_context]: https://github.com/polylang/polylang/commit/2203b9e16532797fa530f9b73024b53885d728ef\n[polylang-github]: https://github.com/polylang/polylang\n[wpgraphql]: https://github.com/wp-graphql/wp-graphql/releases\n\n## Installation\n\nIf you use composer you can install it from Packagist\n\n    composer require valu/wp-graphql-polylang\n\nOtherwise you can clone it from Github to your plugins using the stable branch\n\n    cd wp-content/plugins\n    git clone --branch stable https://github.com/valu-digital/wp-graphql-polylang.git\n\n## ACF Options Pages\n\nIn addition to WPGraphQL and Polylang plugins you'll need these plugins too\n\n-   [Advanced Custom Fields Pro](https://www.advancedcustomfields.com/pro/)\n    -   It's Pro only feature\n-   [ACF Options For Polylang](https://wordpress.org/plugins/acf-options-for-polylang/)\n-   [WPGraphQL for Advanced Custom Fields](https://www.wpgraphql.com/acf/)\n    -   v0.3.2 or later is required\n\nYou can install the free plugins using Composer. You'll need to have the\n[WordPress Packagist][] repository enabled.\n\n```\ncomposer require wp-graphql/wp-graphql-acf wpackagist-plugin/acf-options-for-polylang\n```\n\nWhen registering the Options Page you must pass in `show_in_graphql` and\n`graphql_field_name` arguments.\n\n```php\nacf_add_options_page([\n    'page_title' =\u003e __('Site settings', 'theme'),\n    'menu_title' =\u003e __('Site settings', 'theme'),\n    'menu_slug' =\u003e 'site-settings',\n    'capability' =\u003e 'manage_options',\n    'redirect' =\u003e false,\n    'show_in_graphql' =\u003e true,\n    'graphql_field_name' =\u003e 'siteSettings'\n]);\n```\n\n[wordpress packagist]: https://wpackagist.org/\n[options page]: https://www.advancedcustomfields.com/resources/options-page/\n[acf options for polylang]: https://wordpress.org/plugins/acf-options-for-polylang/\n\n## Slack\n\nYou can find us from the [WPGraphQL Slack][slack] on the `#polylang` channel.\n\n[slack]: https://wpgql-slack.herokuapp.com/\n\n\n## WPML\n\nBut I'm using WPML?!\n\nThere's [rburgst/wp-graphql-wpml](https://github.com/rburgst/wp-graphql-wpml).\n\nOr you might want to checkout migration docs\n\n\u003chttps://polylang.pro/how-to-switch-from-wpml-to-polylang/\u003e\n\n\n## Contributing\n\nCheckout [CONTRIBUTING.md](CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalu-digital%2Fwp-graphql-polylang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalu-digital%2Fwp-graphql-polylang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalu-digital%2Fwp-graphql-polylang/lists"}