-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2169 from graphcommerce-org/fix/GCOM-1315-cli-mig…
…ration Fix/gcom 1315 cli migration
- Loading branch information
Showing
16 changed files
with
142 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@graphcommerce/next-config": patch | ||
"@graphcommerce/hygraph-cli": patch | ||
--- | ||
|
||
Solve issue where a Hygraph DynamicRow conditions were missing fields in the OrCondition |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 56 additions & 35 deletions
91
packages/hygraph-cli/dist/migrations/graphcommerce7to8.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,57 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.graphcommerce7to7_1 = void 0; | ||
const management_sdk_1 = require("@hygraph/management-sdk"); | ||
const migrationAction_1 = require("../migrationAction"); | ||
const graphcommerce7to7_1 = async (schema) => { | ||
if (!migrationAction_1.client) { | ||
return 0; | ||
} | ||
const hasRow = schema.models | ||
.find((m) => m.apiId === 'DynamicRow') | ||
?.fields.some((f) => f.apiId === 'row'); | ||
if (hasRow) { | ||
(0, migrationAction_1.migrationAction)(schema, 'unionField', 'update', { | ||
apiId: 'row', | ||
displayName: 'Row Deprecated', | ||
parentApiId: 'DynamicRow', | ||
description: 'This field is deprecated. Use Rows instead.', | ||
}); | ||
} | ||
(0, migrationAction_1.migrationAction)(schema, 'unionField', 'create', { | ||
displayName: 'Rows', | ||
apiId: 'rows', | ||
'use strict' | ||
Object.defineProperty(exports, '__esModule', { value: true }) | ||
exports.graphcommerce7to8 = void 0 | ||
const management_sdk_1 = require('@hygraph/management-sdk') | ||
const migrationAction_1 = require('../migrationAction') | ||
const graphcommerce7to8 = async (schema) => { | ||
if (!migrationAction_1.client) { | ||
return 0 | ||
} | ||
const hasRow = schema.models | ||
.find((m) => m.apiId === 'DynamicRow') | ||
?.fields.some((f) => f.apiId === 'row') | ||
if (hasRow) { | ||
;(0, migrationAction_1.migrationAction)(schema, 'unionField', 'update', { | ||
apiId: 'row', | ||
displayName: 'Row Deprecated', | ||
parentApiId: 'DynamicRow', | ||
description: 'This field is deprecated. Use Rows instead.', | ||
}) | ||
} | ||
;(0, migrationAction_1.migrationAction)( | ||
schema, | ||
'unionField', | ||
'create', | ||
{ | ||
displayName: 'Rows', | ||
apiId: 'rows', | ||
isList: true, | ||
reverseField: { | ||
modelApiIds: ['RowQuote', 'RowLinks', 'RowColumnOne'], | ||
apiId: 'dynamicRows', | ||
displayName: 'Dynamic Rows', | ||
visibility: management_sdk_1.VisibilityTypes.Hidden, | ||
isList: true, | ||
reverseField: { | ||
modelApiIds: ['RowQuote', 'RowLinks', 'RowColumnOne'], | ||
apiId: 'dynamicRows', | ||
displayName: 'Dynamic Rows', | ||
visibility: management_sdk_1.VisibilityTypes.Hidden, | ||
isList: true, | ||
}, | ||
parentApiId: 'DynamicRow', | ||
}, 'DynamicRow', 'model'); | ||
return migrationAction_1.client.run(true); | ||
}; | ||
exports.graphcommerce7to7_1 = graphcommerce7to7_1; | ||
}, | ||
parentApiId: 'DynamicRow', | ||
}, | ||
'DynamicRow', | ||
'model', | ||
) | ||
;(0, migrationAction_1.migrationAction)( | ||
schema, | ||
'componentUnionField', | ||
'create', | ||
{ | ||
displayName: 'Conditions', | ||
apiId: 'conditions', | ||
parentApiId: 'ConditionOr', | ||
componentApiIds: ['ConditionText', 'ConditionNumber'], | ||
isList: true, | ||
}, | ||
'ConditionOr', | ||
'component', | ||
) | ||
return migrationAction_1.client.run(true) | ||
} | ||
exports.graphcommerce7to8 = graphcommerce7to8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './graphcommerce5to6' | ||
export * from './graphcommerce6to7' | ||
export * from './graphcommerce7to8' | ||
export * from './graphcommerce8to9' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters