블로그
⭐️ Polylang를 위한 언어별 데이터 필터링 기능을 탑재한 v4.1 출시 (PRO)
Gato GraphQL v4.1이 출시되었습니다. 변경 사항의 전체 목록은 GitHub 릴리스 노트에서 확인하실 수 있습니다.
가장 중요한 새 기능은 Gato GraphQL PRO에 관한 것입니다.
[PRO] Polylang: 언어별 데이터 필터링
Polylang 확장 기능을 사용하면, 이제 언어별로 데이터를 필터링할 수 있습니다.
다음 데이터를 가져올 때 필터링할 언어를 지정할 수 있습니다:
- Posts
- Pages
- Custom posts
- 카테고리
- Tags
- Media items
해당 필드는 polylangLanguage 입력값을 받으며, 코드 또는 로케일로, 1개 또는 복수의 언어로 필터링할 수 있습니다.
예를 들어, $languageCodes: ["es"]를 전달하면 스페인어 데이터를 가져올 수 있습니다:
query FilterByLanguage($languageCodes: [String!])
{
posts(filter: {
polylangLanguages: { codes: $languageCodes }
}) {
id
title
}
pages(filter: {
polylangLanguages: { codes: $languageCodes }
}) {
id
title
}
customPosts(filter: {
customPostTypes: ["some-cpt"]
polylangLanguages: { codes: $languageCodes }
}) {
id
title
}
postCategories(filter: {
polylangLanguages: { codes: $languageCodes }
}) {
id
name
}
postTags(filter: {
polylangLanguages: { codes: $languageCodes }
}) {
id
name
}
categories(
taxonomy: "some-category"
filter: { polylangLanguages: { codes: $languageCodes } }
) {
id
name
}
tags(
taxonomy: "some-tag"
filter: { polylangLanguages: { codes: $languageCodes } }
) {
id
name
}
mediaItems(filter: {
polylangLanguages: { codes: $languageCodes }
}) {
id
title
}
}