Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sitecore-jss] [Editing] Updated dictionary query to reduce query complexity #1846

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Our versioning strategy is as follows:
* `[sitecore-jss]` _GraphQLRequestClient_ now can accept custom 'headers' in the constructor or via _createClientFactory_ ([#1806](https://github.com/Sitecore/jss/pull/1806))
* `[templates/nextjs]` Removed cors header for API endpoints from _lib/next-config/plugins/cors-header_ plugin since cors is handled by API handlers / middlewares ([#1806](https://github.com/Sitecore/jss/pull/1806))
* `[sitecore-jss-nextjs]` Updates to Next.js editing integration to further support secure hosting scenarios (on XM Cloud & Vercel) ([#1832](https://github.com/Sitecore/jss/pull/1832))
* `[sitecore-jss]` `[nextjs-xmcloud]` DictionaryService can now use a `site` GraphQL query instead of `search` one to improve performance. This is currently only available for XMCloud deployments and is enabled with `nextjs-xmcloud` add-on by default ([#1804](https://github.com/Sitecore/jss/pull/1804))
* `[sitecore-jss]` `[nextjs-xmcloud]` DictionaryService can now use a `site` GraphQL query instead of `search` one to improve performance. This is currently only available for XMCloud deployments and is enabled with `nextjs-xmcloud` add-on by default ([#1804](https://github.com/Sitecore/jss/pull/1804))([#1846](https://github.com/Sitecore/jss/pull/1846))
* `[templates/nextjs-sxa]` nextjs-sxa components now use the NextImage component instead of the react Image component from JSS lib for image optimization ([#1843](https://github.com/Sitecore/jss/pull/1843))

### 🛠 Breaking Change
Expand Down
6 changes: 4 additions & 2 deletions packages/sitecore-jss/src/editing/graphql-editing-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ export const query = /* GraphQL */ `
$language: String!
$version: String
$after: String
$pageSize: Int = ${PAGE_SIZE}
) {
item(path: $itemId, language: $language, version: $version) {
rendered
}
site {
siteInfo(site: $siteName) {
dictionary(language: $language, first: ${PAGE_SIZE}, after: $after) {
dictionary(language: $language, first: $pageSize, after: $after) {
results {
key
value
Expand All @@ -45,10 +46,11 @@ export const dictionaryQuery = /* GraphQL */ `
$siteName: String!
$language: String!
$after: String
$pageSize: Int = ${PAGE_SIZE}
) {
site {
siteInfo(site: $siteName) {
dictionary(language: $language, first: ${PAGE_SIZE}, after: $after) {
dictionary(language: $language, first: $pageSize, after: $after) {
results {
key
value
Expand Down