@financial-times/cp-content-pipeline-client 0.6.0 → 0.6.2

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
@@ -120,6 +120,30 @@
120
120
  * devDependencies
121
121
  * @financial-times/cp-content-pipeline-schema bumped from ^0.6.10 to ^0.6.11
122
122
 
123
+ ### Dependencies
124
+
125
+ * The following workspace dependencies were updated
126
+ * devDependencies
127
+ * @financial-times/cp-content-pipeline-schema bumped from ^0.7.0 to ^0.7.1
128
+
129
+ ## [0.6.2](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-client-v0.6.1...cp-content-pipeline-client-v0.6.2) (2023-03-16)
130
+
131
+
132
+ ### Features
133
+
134
+ * add a way of asserting our fragments are compatible with content-tree ([86ddeab](https://github.com/Financial-Times/cp-content-pipeline/commit/86ddeab8ad66c96ff2e6e700cae82236171858b4))
135
+ * add more content-tree/fragment type assertions ([412441b](https://github.com/Financial-Times/cp-content-pipeline/commit/412441b6270e8aa4eca4809e90a4140892db0e67))
136
+ * generate types for scalars ([0ce155e](https://github.com/Financial-Times/cp-content-pipeline/commit/0ce155e64ce9691dde2b123963d5159d89f5b18d))
137
+ * include id property in image responses ([de16578](https://github.com/Financial-Times/cp-content-pipeline/commit/de165784f7a26a3173f9e9b5a95b89e21c1e30ef))
138
+ * remove unused alt field from image fragment (it's on the imageset) ([9c6d58f](https://github.com/Financial-Times/cp-content-pipeline/commit/9c6d58f9a90b307cb96c7a21551d6227d92aaafb))
139
+
140
+
141
+ ### Dependencies
142
+
143
+ * The following workspace dependencies were updated
144
+ * devDependencies
145
+ * @financial-times/cp-content-pipeline-schema bumped from ^0.7.1 to ^0.7.2
146
+
123
147
  ## [0.6.0](https://github.com/Financial-Times/cp-content-pipeline/compare/cp-content-pipeline-client-v0.5.11...cp-content-pipeline-client-v0.6.0) (2023-03-14)
124
148
 
125
149
 
package/codegen.js ADDED
@@ -0,0 +1,34 @@
1
+ const { scalars } = require('@financial-times/cp-content-pipeline-schema')
2
+ const mapValues = require('lodash.mapvalues')
3
+
4
+ const config = {
5
+ schema: [
6
+ {
7
+ schema: {
8
+ loader: './loader.js',
9
+ },
10
+ },
11
+ ],
12
+ documents: 'queries/*.graphql',
13
+ generates: {
14
+ 'src/generated/index.ts': {
15
+ plugins: [
16
+ 'typescript',
17
+ 'typescript-operations',
18
+ 'typescript-graphql-request',
19
+ ],
20
+ config: {
21
+ // discourage transforming data in consumers by making properties readonly
22
+ immutableTypes: true,
23
+ // make types better-compatible with React, which doesn't like null
24
+ maybeValue: 'T',
25
+ // output types for custom scalars
26
+ scalars: mapValues(scalars, (scalar) => scalar.codegenType),
27
+ // don't ouptput __typename unless requested
28
+ skipTypename: true,
29
+ },
30
+ },
31
+ },
32
+ }
33
+
34
+ module.exports = config