Skip to content

Commit

Permalink
Merge pull request #42 from vtex-apps/SO-4-update-all-used-versions-o…
Browse files Browse the repository at this point in the history
…f-vtex-product-comparison-to-stop-using-apps-graphql-2-x

chore: uses `publicSettingsForApp` endpoint to retrieve app settings
  • Loading branch information
lariciamota authored Feb 24, 2023
2 parents 3053fde + 2e5797e commit 3767de6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Changed

- Uses `publicSettingsForApp` endpoint to retrieve app settings

## [0.17.0] - 2022-06-15

### Added
Expand Down
3 changes: 2 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
"vtex.product-list-context": "0.x",
"vtex.flex-layout": "0.x",
"vtex.pixel-manager": "1.x",
"vtex.apps-graphql": "2.x",
"vtex.apps-graphql": "3.x",
"vtex.product-context": "0.x"
},
"settingsSchema": {
"access": "public",
"title": "Product comparison",
"type": "object",
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion react/ProductComparisonContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ const ProductComparisonProvider = ({ children }: Props) => {

useEffect(() => {
const appSettings = JSON.parse(
pathOr(`{}`, ['appSettings', 'message'], appSettingsData)
pathOr(`{}`, ['publicSettingsForApp', 'message'], appSettingsData)
)

dispatch({
Expand Down
2 changes: 1 addition & 1 deletion react/queries/AppSettings.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
query AppSettings($version: String) {
appSettings(app: "vtex.product-comparison", version: $version)
publicSettingsForApp(app: "vtex.product-comparison", version: $version)
@context(provider: "vtex.apps-graphql") {
message
}
Expand Down

0 comments on commit 3767de6

Please sign in to comment.