Skip to content

Commit ec2d5d5

Browse files
authored
CIF-2659 - GraphQL Schema Checker Tool (#172)
* Add schema checker tool * Update readme
1 parent 6ea8a87 commit ec2d5d5

13 files changed

Lines changed: 287 additions & 251 deletions

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ This will build and deploy the GraphQl functions and web frontend. The CLI will
127127

128128
To test the GraphQL endpoint directly open the GraphiQL to test some GraphQL queries. The URL for your GraphiQL instance is printed out by the AIO CLI during the deployment. Any other GraphQL client will work as well.
129129

130+
Please also make sure your implementation is compatible with the queries CIF is using. You can use the GraphQL schema checker tool in the [schemas](schemas/README.md) folder.
131+
130132
## Developing a real 3rd-party integration
131133

132134
This repository provides a reference implementation that can be used as a starting point to develop a real integration with a 3rd-party commerce system. In order to implement a real integration, one will have to:

package-lock.json

Lines changed: 82 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
},
2929
"devDependencies": {
3030
"@openwhisk/wskdebug": "1.3.0",
31+
"axios": "^0.27.2",
3132
"chai": "4.3.5",
33+
"chalk": "^4.1.2",
3234
"eslint": "7.32.0",
3335
"eslint-plugin-header": "3.1.1",
3436
"eslint-plugin-react": "7.28.0",

schemas/README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
# Pruned Schema Generation
1+
# CIF Schemas
22

3-
To define the scope of a third-party integrations, you can generate a minimal or pruned schema based on the full Adobe Commerce / Magento schema and the queries that are actually used by CIF.
3+
Make sure to run `npm install` in the root of the project before using any of the tools below.
44

5-
In this folder, you can find the queries and schemas used by the latest versions of the CIF Core Components and the CIF Add-on. Those are regularly updated. If you need to generate a schema based on older versions, please utilize the git history.
5+
## Pruned Schema Generation
66

7-
Make sure, you ran `npm install` in the root of the project. To generate a pruned schema, run `./generate.js` and follow the steps. Please use the generated schema as reference for your third-party integration.
7+
To define the scope of a third-party integration, you can generate a minimal or pruned schema based on the full Adobe Commerce / Magento schema and the queries that are actually used by CIF.
8+
9+
In this folder, you can find the queries and schemas used by the latest versions of the CIF Core Components and the CIF Add-on. Those are regularly updated. Schemas of previous versions of the CIF Core Components are available in the git history and are tagged.
10+
11+
To generate a pruned schema, run `./generate.js` and follow the steps. Please use the generated schema as reference for your third-party integration.
12+
13+
## Compatibility Check
14+
15+
The GraphQL schema checker tool allows you to test the schema of your implemented GraphQL endpoint for compatibility with CIF. This includes the CIF Core Components and the CIF Add-on.
16+
The tool will provide detailed information about possible incompatibilities.
17+
18+
Please run `./check.js` and follow the steps provided.

schemas/addon-ui/cif-schema-addon-ui-2.3.5.pruned.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
"queryType": {
55
"name": "Query"
66
},
7-
"mutationType": {
8-
"name": "Mutation"
9-
},
7+
"mutationType": null,
108
"subscriptionType": null,
119
"types": [
1210
{

schemas/addon-ui/cif-schema-addon-ui-2.4.0.pruned.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
"queryType": {
55
"name": "Query"
66
},
7-
"mutationType": {
8-
"name": "Mutation"
9-
},
7+
"mutationType": null,
108
"subscriptionType": null,
119
"types": [
1210
{

0 commit comments

Comments
 (0)