- Updated internal PHP hook structure for error payloads (#2739)
- Use bulk mutations in predefined persisted queries (#2728)
- Added documentation for new PRO module Polylang Mutations (#2733)
- Added documentation for new PRO field
_arrayIntersect(#2735) - Added predefined persisted query:
- [PRO] Create missing translation posts for Polylang (#2740)
- Don't replace chars in translation persisted queries (#2731)
- "Call to protected method" exception in PHP 8.2 (#2741)
- Rename field
_intSubstractto_intSubtract - Rename directive
@intSubstractto@intSubtract - Renamed field
polylangEnabledLanguagestopolylangLanguages - Fields
polylangLanguage,polylangDefaultLanguageandpolylangLanguagesreturn typePolylangLanguageinstead ofString - Renamed inputs
languagetolanguageByandpolylangLanguagetopolylangLanguageBy
- Added field
_arrayIntersect
The new PRO module Polylang Mutations provides mutations for the integration with the Polylang plugin.
The GraphQL schema is provided with mutations to:
- Establish the language for custom posts, tags and categories, and
- Define associations among them (i.e. indicate that a set of custom posts, tags or categories is a translation for each other).
| Mutation | Description |
|---|---|
polylangSetCustomPostLanguage |
Set the language of the custom post. |
polylangSetTaxonomyTermLanguage |
Set the language of the taxonomy term. |
polylangSaveCustomPostTranslationAssociation |
Set the translation association for the custom post. |
polylangSaveTaxonomyTermTranslationAssociation |
Set the translation association for the taxonomy term. |
For instance, the following query defines the language for 3 posts (to English, Spanish and French), and then defines that these 3 posts are a translation of each other:
mutation {
post1: polylangSetCustomPostLanguage(input: {id: 1, languageBy: { code: "en" }}) {
status
errors {
__typename
...on ErrorPayload {
message
}
}
}
post2: polylangSetCustomPostLanguage(input: {id: 2, languageBy: { code: "es" }}) {
status
errors {
__typename
...on ErrorPayload {
message
}
}
}
post3: polylangSetCustomPostLanguage(input: {id: 3, languageBy: { code: "fr" }}) {
status
errors {
__typename
...on ErrorPayload {
message
}
}
}
polylangSaveCustomPostTranslationAssociation(input: {
ids: [1, 2, 3]
}) {
status
errors {
__typename
...on ErrorPayload {
message
}
}
}
}