@graphcommerce/graphql-codegen-markdown-docs 7.0.0-canary.21 → 7.0.1-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,194 @@
1
1
  # Change Log
2
2
 
3
- ## 7.0.0-canary.21
3
+ ## 7.0.1-canary.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2047](https://github.com/graphcommerce-org/graphcommerce/pull/2047) [`136580b39`](https://github.com/graphcommerce-org/graphcommerce/commit/136580b39e3cffdd07e3fa087e049bd532c3e8f1) - Updated all dependencies to the latest version where possible. ([@paales](https://github.com/paales))
8
+
9
+ ## 7.0.0
10
+
11
+ ### Patch Changes
12
+
13
+ - [#2034](https://github.com/graphcommerce-org/graphcommerce/pull/2034) [`6fca47484`](https://github.com/graphcommerce-org/graphcommerce/commit/6fca474847fe52f004a6ac0abbd88492512b46ad) - Pre-resolve the customFetch in mesh config, so that it works with the new mesh version. ([@paales](https://github.com/paales))
14
+
15
+ - [#2012](https://github.com/graphcommerce-org/graphcommerce/pull/2012) [`1dbb3ae13`](https://github.com/graphcommerce-org/graphcommerce/commit/1dbb3ae13553992ee1ed77f375375560f28c418c) - Upgrade graphql to 16.7.1, add graphql as peer dependency ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
16
+
17
+ - [#1960](https://github.com/graphcommerce-org/graphcommerce/pull/1960) [`86e14569b`](https://github.com/graphcommerce-org/graphcommerce/commit/86e14569b1f68f73be7f93b614e36b382c5debff) - Updated to the latest release of GraphQL codegen and solve compatibility issues with our own generator ([@paales](https://github.com/paales))
18
+
19
+ - [#1959](https://github.com/graphcommerce-org/graphcommerce/pull/1959) [`d0809b132`](https://github.com/graphcommerce-org/graphcommerce/commit/d0809b132a0e4cbdfeb86164f6c16a89ebecd987) - Added support for default values in the Config.graphqls files for the documentation ([@JoshuaS98](https://github.com/JoshuaS98))
20
+
21
+ ## 6.2.0-canary.98
22
+
23
+ ## 6.2.0-canary.97
24
+
25
+ ## 6.2.0-canary.96
26
+
27
+ ## 6.2.0-canary.95
28
+
29
+ ## 6.2.0-canary.94
30
+
31
+ ## 6.2.0-canary.93
32
+
33
+ ## 6.2.0-canary.92
34
+
35
+ ## 6.2.0-canary.91
36
+
37
+ ## 6.2.0-canary.90
38
+
39
+ ### Patch Changes
40
+
41
+ - [#2034](https://github.com/graphcommerce-org/graphcommerce/pull/2034) [`6fca47484`](https://github.com/graphcommerce-org/graphcommerce/commit/6fca474847fe52f004a6ac0abbd88492512b46ad) - Pre-resolve the customFetch in mesh config ([@paales](https://github.com/paales))
42
+
43
+ ## 6.2.0-canary.89
44
+
45
+ ## 6.2.0-canary.88
46
+
47
+ ## 6.2.0-canary.87
48
+
49
+ ## 6.2.0-canary.86
50
+
51
+ ## 6.2.0-canary.85
52
+
53
+ ## 6.2.0-canary.84
54
+
55
+ ## 6.2.0-canary.83
56
+
57
+ ## 6.2.0-canary.82
58
+
59
+ ## 6.2.0-canary.81
60
+
61
+ ## 6.2.0-canary.80
62
+
63
+ ## 6.2.0-canary.79
64
+
65
+ ## 6.2.0-canary.78
66
+
67
+ ## 6.2.0-canary.77
68
+
69
+ ## 6.2.0-canary.76
70
+
71
+ ## 6.2.0-canary.75
72
+
73
+ ## 6.2.0-canary.74
74
+
75
+ ## 6.2.0-canary.73
76
+
77
+ ## 6.2.0-canary.72
78
+
79
+ ## 6.2.0-canary.71
80
+
81
+ ## 6.2.0-canary.70
82
+
83
+ ## 6.2.0-canary.69
84
+
85
+ ### Patch Changes
86
+
87
+ - [#2012](https://github.com/graphcommerce-org/graphcommerce/pull/2012) [`1dbb3ae13`](https://github.com/graphcommerce-org/graphcommerce/commit/1dbb3ae13553992ee1ed77f375375560f28c418c) - Upgrade graphql to 16.7.1, add graphql as peer dependency ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
88
+
89
+ ## 6.2.0-canary.68
90
+
91
+ ## 6.2.0-canary.67
92
+
93
+ ## 6.2.0-canary.66
94
+
95
+ ## 6.2.0-canary.65
96
+
97
+ ## 6.2.0-canary.64
98
+
99
+ ## 6.2.0-canary.63
100
+
101
+ ## 6.2.0-canary.62
102
+
103
+ ## 6.2.0-canary.61
104
+
105
+ ## 6.2.0-canary.60
106
+
107
+ ## 6.2.0-canary.59
108
+
109
+ ## 6.2.0-canary.58
110
+
111
+ ## 6.2.0-canary.57
112
+
113
+ ## 6.2.0-canary.56
114
+
115
+ ## 6.2.0-canary.55
116
+
117
+ ## 6.2.0-canary.54
118
+
119
+ ## 6.2.0-canary.53
120
+
121
+ ## 6.2.0-canary.52
122
+
123
+ ## 6.2.0-canary.51
124
+
125
+ ## 6.2.0-canary.50
126
+
127
+ ## 6.2.0-canary.49
128
+
129
+ ### Patch Changes
130
+
131
+ - [#1959](https://github.com/graphcommerce-org/graphcommerce/pull/1959) [`d0809b132`](https://github.com/graphcommerce-org/graphcommerce/commit/d0809b132a0e4cbdfeb86164f6c16a89ebecd987) - Added support for default values in the Config.graphqls files for the documentation ([@JoshuaS98](https://github.com/JoshuaS98))
132
+
133
+ ## 6.2.0-canary.48
134
+
135
+ ## 6.2.0-canary.47
136
+
137
+ ## 6.2.0-canary.46
138
+
139
+ ## 6.2.0-canary.45
140
+
141
+ ## 6.2.0-canary.44
142
+
143
+ ## 6.2.0-canary.43
144
+
145
+ ## 6.2.0-canary.42
146
+
147
+ ## 6.2.0-canary.41
148
+
149
+ ### Patch Changes
150
+
151
+ - [#1960](https://github.com/graphcommerce-org/graphcommerce/pull/1960) [`86e14569b`](https://github.com/graphcommerce-org/graphcommerce/commit/86e14569b1f68f73be7f93b614e36b382c5debff) - Updated to the latest release of GraphQL codegen and solve compatibility issues with our own generator ([@paales](https://github.com/paales))
152
+
153
+ ## 6.2.0-canary.40
154
+
155
+ ## 6.2.0-canary.39
156
+
157
+ ## 6.2.0-canary.38
158
+
159
+ ## 6.2.0-canary.37
160
+
161
+ ## 6.2.0-canary.36
162
+
163
+ ## 6.2.0-canary.35
164
+
165
+ ## 6.2.0-canary.34
166
+
167
+ ## 6.2.0-canary.33
168
+
169
+ ## 6.2.0-canary.32
170
+
171
+ ## 6.2.0-canary.31
172
+
173
+ ## 6.2.0-canary.30
174
+
175
+ ## 6.2.0-canary.29
176
+
177
+ ## 6.2.0-canary.28
178
+
179
+ ## 6.2.0-canary.27
180
+
181
+ ## 6.2.0-canary.26
182
+
183
+ ## 6.2.0-canary.25
184
+
185
+ ## 6.2.0-canary.24
186
+
187
+ ## 6.2.0-canary.23
188
+
189
+ ## 6.2.0-canary.22
190
+
191
+ ## 6.2.0-canary.21
4
192
 
5
193
  ## 6.2.0-canary.20
6
194
 
package/dist/index.js CHANGED
@@ -4,7 +4,11 @@ exports.plugin = void 0;
4
4
  const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
5
5
  const graphql_1 = require("graphql");
6
6
  /** Converts input type to markdown document. */
7
- const plugin = (schema, _documents, config) => {
7
+ const plugin = (schema,
8
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
+ _documents,
10
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
11
+ config) => {
8
12
  const astNode = (0, plugin_helpers_1.getCachedDocumentNodeFromSchema)(schema);
9
13
  const enumStings = new Map();
10
14
  const descriptionText = (node) => {
@@ -25,12 +29,19 @@ const plugin = (schema, _documents, config) => {
25
29
  leave: (node) => possibleScalars.includes(node.name) ? node.name : `[${node.name}](#${node.name})`,
26
30
  },
27
31
  StringValue: { leave: (node) => node.value },
32
+ BooleanValue: { leave: (node) => node.value },
33
+ EnumValue: { leave: (node) => node.value },
34
+ IntValue: { leave: (node) => node.value },
35
+ FloatValue: { leave: (node) => node.value },
28
36
  ListType: { leave: (node) => `[${node.type}]` },
29
37
  NonNullType: {
30
38
  leave: (node) => `${node.type}!`,
31
39
  },
32
40
  InputValueDefinition: {
33
- leave: (node) => `\`${node.name}: ${node.type}\`${descriptionText(node)}`,
41
+ leave: (node) => {
42
+ const defaultValue = node.defaultValue ? ` (default: ${node.defaultValue})` : '';
43
+ return `\`${node.name}: ${node.type}${defaultValue}\`${descriptionText(node)}`;
44
+ },
34
45
  },
35
46
  InputObjectTypeDefinition: {
36
47
  enter: (node) => ({
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/graphql-codegen-markdown-docs",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "7.0.0-canary.21",
5
+ "version": "7.0.1-canary.0",
6
6
  "sideEffects": false,
7
7
  "type": "commonjs",
8
8
  "main": "dist/index.js",
@@ -21,17 +21,19 @@
21
21
  }
22
22
  },
23
23
  "devDependencies": {
24
- "@graphcommerce/eslint-config-pwa": "7.0.0-canary.21",
25
- "@graphcommerce/prettier-config-pwa": "7.0.0-canary.21",
26
- "@graphcommerce/typescript-config-pwa": "7.0.0-canary.21"
24
+ "@graphcommerce/eslint-config-pwa": "7.0.1-canary.0",
25
+ "@graphcommerce/prettier-config-pwa": "7.0.1-canary.0",
26
+ "@graphcommerce/typescript-config-pwa": "7.0.1-canary.0"
27
27
  },
28
28
  "dependencies": {
29
- "@graphql-codegen/add": "4.0.1",
30
- "@graphql-codegen/plugin-helpers": "4.1.0",
31
- "@graphql-codegen/visitor-plugin-common": "3.0.2",
32
- "@graphql-tools/utils": "^9.2.1",
29
+ "@graphql-codegen/add": "5.0.0",
30
+ "@graphql-codegen/plugin-helpers": "5.0.1",
31
+ "@graphql-codegen/visitor-plugin-common": "4.0.1",
32
+ "@graphql-tools/utils": "^10.0.1",
33
33
  "@types/parse-filepath": "^1.0.0",
34
- "graphql": "16.6.0",
35
34
  "parse-filepath": "^1.0.2"
35
+ },
36
+ "peerDependencies": {
37
+ "graphql": "^16.7.1"
36
38
  }
37
39
  }
package/src/graphql.ts CHANGED
@@ -12,7 +12,7 @@ export const isNamedType = (typ?: TypeNode): typ is NamedTypeNode => typ?.kind =
12
12
 
13
13
  export const isInput = (kind: string) => kind.includes('Input')
14
14
 
15
- type ObjectTypeDefinitionFn = (node: ObjectTypeDefinitionNode) => any
15
+ type ObjectTypeDefinitionFn = (node: ObjectTypeDefinitionNode) => unknown
16
16
 
17
17
  export const ObjectTypeDefinitionBuilder = (
18
18
  useObjectTypes: boolean | undefined,
package/src/index.ts CHANGED
@@ -1,12 +1,17 @@
1
- import { PluginFunction, Types } from '@graphql-codegen/plugin-helpers'
2
- import { getCachedDocumentNodeFromSchema } from '@graphql-codegen/plugin-helpers'
1
+ import {
2
+ PluginFunction,
3
+ Types,
4
+ getCachedDocumentNodeFromSchema,
5
+ } from '@graphql-codegen/plugin-helpers'
3
6
  import { GraphQLSchema, visit } from 'graphql'
4
7
  import { MarkdownDocsPluginConfig } from './config'
5
8
 
6
9
  /** Converts input type to markdown document. */
7
10
  export const plugin: PluginFunction<MarkdownDocsPluginConfig, Types.ComplexPluginOutput> = (
8
11
  schema: GraphQLSchema,
12
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
9
13
  _documents: Types.DocumentFile[],
14
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
15
  config: MarkdownDocsPluginConfig,
11
16
  ): Types.ComplexPluginOutput => {
12
17
  const astNode = getCachedDocumentNodeFromSchema(schema)
@@ -35,12 +40,19 @@ export const plugin: PluginFunction<MarkdownDocsPluginConfig, Types.ComplexPlugi
35
40
  possibleScalars.includes(node.name) ? node.name : `[${node.name}](#${node.name})`,
36
41
  }, // String, Boolean, GraphCommerceDebugConfig, etc.
37
42
  StringValue: { leave: (node) => node.value },
43
+ BooleanValue: { leave: (node) => node.value },
44
+ EnumValue: { leave: (node) => node.value },
45
+ IntValue: { leave: (node) => node.value },
46
+ FloatValue: { leave: (node) => node.value },
38
47
  ListType: { leave: (node) => `[${node.type}]` },
39
48
  NonNullType: {
40
49
  leave: (node) => `${node.type}!`,
41
50
  },
42
51
  InputValueDefinition: {
43
- leave: (node) => `\`${node.name}: ${node.type}\`${descriptionText(node)}`,
52
+ leave: (node) => {
53
+ const defaultValue = node.defaultValue ? ` (default: ${node.defaultValue})` : ''
54
+ return `\`${node.name}: ${node.type}${defaultValue}\`${descriptionText(node)}`
55
+ },
44
56
  },
45
57
  InputObjectTypeDefinition: {
46
58
  enter: (node) => ({