@rytass/cms-base-nestjs-graphql-module 0.1.24 → 0.1.26
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 +306 -0
- package/__tests__/enums.spec.ts +76 -0
- package/__tests__/language-decorator.spec.ts +17 -0
- package/__tests__/quadrats-element-scalar.spec.ts +123 -0
- package/llms.txt +361 -0
- package/package.json +10 -6
- package/project.json +23 -0
- package/src/cms-base-graphql.module.ts +101 -0
- package/src/constants/enum/base-action.enum.ts +17 -0
- package/src/constants/enum/base-resource.enum.ts +4 -0
- package/src/constants/option-providers.ts +35 -0
- package/src/data-loaders/article.dataloader.ts +84 -0
- package/src/data-loaders/members.dataloader.ts +36 -0
- package/src/decorators/language.decorator.ts +45 -0
- package/src/dto/article-collection.dto.ts +9 -0
- package/src/dto/article-multi-language-content.dto.ts +18 -0
- package/src/dto/article-signature-step.dto.ts +10 -0
- package/src/dto/article-signature.dto.ts +21 -0
- package/src/dto/article-stage-version.dto.ts +23 -0
- package/src/dto/article-version-content.input.ts +18 -0
- package/src/dto/article.dto.ts +16 -0
- package/src/dto/articles.args.ts +16 -0
- package/src/dto/backstage-article-collection.dto.ts +9 -0
- package/src/dto/backstage-article.args.ts +20 -0
- package/src/dto/backstage-article.dto.ts +14 -0
- package/src/dto/backstage-category.dto.ts +5 -0
- package/src/dto/base-article.dto.ts +19 -0
- package/src/dto/base-category.dto.ts +13 -0
- package/src/dto/categories.args.ts +27 -0
- package/src/dto/category-multi-language-name.dto.ts +10 -0
- package/src/dto/category-multi-language-name.input.ts +10 -0
- package/src/dto/category.dto.ts +8 -0
- package/src/dto/collection.dto.ts +13 -0
- package/src/dto/create-article.args.ts +27 -0
- package/src/dto/create-category.args.ts +15 -0
- package/src/dto/custom-field.input.ts +10 -0
- package/src/dto/update-article.args.ts +8 -0
- package/src/dto/update-category.args.ts +8 -0
- package/src/dto/user.dto.ts +10 -0
- package/{index.d.ts → src/index.ts} +2 -0
- package/src/mutations/article.mutations.ts +177 -0
- package/src/mutations/category.mutations.ts +78 -0
- package/src/queries/article.queries.ts +71 -0
- package/src/queries/category.queries.ts +53 -0
- package/src/resolvers/article-signature.resolver.ts +29 -0
- package/src/resolvers/article.resolver.ts +41 -0
- package/src/resolvers/backstage-article.resolver.ts +161 -0
- package/src/resolvers/backstage-category.resolver.ts +40 -0
- package/src/scalars/quadrats-element.scalar.ts +56 -0
- package/src/typings/cms-graphql-base-providers.ts +3 -0
- package/{typings/cms-graphql-base-root-module-async-options.dto.d.ts → src/typings/cms-graphql-base-root-module-async-options.dto.ts} +6 -4
- package/{typings/cms-graphql-base-root-module-option-factory.d.ts → src/typings/cms-graphql-base-root-module-option-factory.ts} +2 -1
- package/src/typings/cms-graphql-base-root-module-options.dto.ts +11 -0
- package/src/typings/dto/resolved-create-article-args.dto.ts +33 -0
- package/src/typings/dto/resolved-create-category-args.dto.ts +19 -0
- package/tsconfig.build.json +8 -0
- package/LICENSE +0 -21
- package/cms-base-graphql.module.d.ts +0 -9
- package/cms-base-graphql.module.js +0 -114
- package/constants/enum/base-action.enum.d.ts +0 -14
- package/constants/enum/base-action.enum.js +0 -17
- package/constants/enum/base-resource.enum.d.ts +0 -4
- package/constants/enum/base-resource.enum.js +0 -7
- package/constants/option-providers.d.ts +0 -2
- package/constants/option-providers.js +0 -20
- package/data-loaders/article.dataloader.d.ts +0 -17
- package/data-loaders/article.dataloader.js +0 -68
- package/data-loaders/members.dataloader.d.ts +0 -8
- package/data-loaders/members.dataloader.js +0 -56
- package/decorators/language.decorator.d.ts +0 -2
- package/decorators/language.decorator.js +0 -32
- package/dto/article-collection.dto.d.ts +0 -5
- package/dto/article-collection.dto.js +0 -27
- package/dto/article-multi-language-content.dto.d.ts +0 -7
- package/dto/article-multi-language-content.dto.js +0 -41
- package/dto/article-signature-step.dto.d.ts +0 -4
- package/dto/article-signature-step.dto.js +0 -28
- package/dto/article-signature.dto.d.ts +0 -7
- package/dto/article-signature.dto.js +0 -44
- package/dto/article-stage-version.dto.d.ts +0 -9
- package/dto/article-stage-version.dto.js +0 -59
- package/dto/article-version-content.input.d.ts +0 -7
- package/dto/article-version-content.input.js +0 -43
- package/dto/article.dto.d.ts +0 -7
- package/dto/article.dto.js +0 -37
- package/dto/articles.args.d.ts +0 -6
- package/dto/articles.args.js +0 -48
- package/dto/backstage-article-collection.dto.d.ts +0 -5
- package/dto/backstage-article-collection.dto.js +0 -27
- package/dto/backstage-article.args.d.ts +0 -6
- package/dto/backstage-article.args.js +0 -38
- package/dto/backstage-article.dto.d.ts +0 -6
- package/dto/backstage-article.dto.js +0 -38
- package/dto/backstage-category.dto.d.ts +0 -3
- package/dto/backstage-category.dto.js +0 -16
- package/dto/base-article.dto.d.ts +0 -7
- package/dto/base-article.dto.js +0 -47
- package/dto/base-category.dto.d.ts +0 -5
- package/dto/base-category.dto.js +0 -33
- package/dto/categories.args.d.ts +0 -8
- package/dto/categories.args.js +0 -62
- package/dto/category-multi-language-name.dto.d.ts +0 -4
- package/dto/category-multi-language-name.dto.js +0 -28
- package/dto/category-multi-language-name.input.d.ts +0 -4
- package/dto/category-multi-language-name.input.js +0 -30
- package/dto/category.dto.d.ts +0 -4
- package/dto/category.dto.js +0 -24
- package/dto/collection.dto.d.ts +0 -5
- package/dto/collection.dto.js +0 -33
- package/dto/create-article.args.d.ts +0 -11
- package/dto/create-article.args.js +0 -71
- package/dto/create-category.args.d.ts +0 -7
- package/dto/create-category.args.js +0 -45
- package/dto/custom-field.input.d.ts +0 -4
- package/dto/custom-field.input.js +0 -28
- package/dto/update-article.args.d.ts +0 -4
- package/dto/update-article.args.js +0 -24
- package/dto/update-category.args.d.ts +0 -4
- package/dto/update-category.args.js +0 -24
- package/dto/user.dto.d.ts +0 -4
- package/dto/user.dto.js +0 -28
- package/index.cjs.js +0 -2334
- package/index.js +0 -8
- package/mutations/article.mutations.d.ts +0 -22
- package/mutations/article.mutations.js +0 -338
- package/mutations/category.mutations.d.ts +0 -15
- package/mutations/category.mutations.js +0 -134
- package/queries/article.queries.d.ts +0 -16
- package/queries/article.queries.js +0 -132
- package/queries/category.queries.d.ts +0 -13
- package/queries/category.queries.js +0 -124
- package/resolvers/article-signature.resolver.d.ts +0 -10
- package/resolvers/article-signature.resolver.js +0 -68
- package/resolvers/article.resolver.d.ts +0 -14
- package/resolvers/article.resolver.js +0 -95
- package/resolvers/backstage-article.resolver.d.ts +0 -33
- package/resolvers/backstage-article.resolver.js +0 -296
- package/resolvers/backstage-category.resolver.d.ts +0 -8
- package/resolvers/backstage-category.resolver.js +0 -76
- package/scalars/quadrats-element.scalar.d.ts +0 -3
- package/scalars/quadrats-element.scalar.js +0 -47
- package/typings/cms-graphql-base-providers.d.ts +0 -3
- package/typings/cms-graphql-base-providers.js +0 -5
- package/typings/cms-graphql-base-root-module-options.dto.d.ts +0 -6
- package/typings/dto/resolved-create-article-args.dto.d.ts +0 -24
- package/typings/dto/resolved-create-category-args.dto.d.ts +0 -13
- /package/{typings/custom-field-value.type.d.ts → src/typings/custom-field-value.type.ts} +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [0.1.26](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.25...@rytass/cms-base-nestjs-graphql-module@0.1.26) (2026-02-02)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
9
|
+
|
|
10
|
+
## [0.1.25](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.24...@rytass/cms-base-nestjs-graphql-module@0.1.25) (2026-02-02)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
13
|
+
|
|
14
|
+
## [0.1.24](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.23...@rytass/cms-base-nestjs-graphql-module@0.1.24) (2026-01-14)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
17
|
+
|
|
18
|
+
## [0.1.23](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.22...@rytass/cms-base-nestjs-graphql-module@0.1.23) (2025-12-05)
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
- **cms-base-nestjs-graphql-module:** add sorter to articles query for consistent ordering ([6400648](https://github.com/Rytass/Utils/commit/64006485edb04d5e70d6d02f984b1eb2894c5f04))
|
|
23
|
+
- **cms-base-nestjs-graphql-module:** use categoriesLoaderNoCache in BackstageArticleResolver for uncached category loading ([f57f5ab](https://github.com/Rytass/Utils/commit/f57f5ab77d94cbc1bb0cf3bb5b79e5194cda33c2))
|
|
24
|
+
|
|
25
|
+
## [0.1.22](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.21...@rytass/cms-base-nestjs-graphql-module@0.1.22) (2025-12-05)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
28
|
+
|
|
29
|
+
## [0.1.21](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.20...@rytass/cms-base-nestjs-graphql-module@0.1.21) (2025-12-04)
|
|
30
|
+
|
|
31
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
32
|
+
|
|
33
|
+
## [0.1.20](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.19...@rytass/cms-base-nestjs-graphql-module@0.1.20) (2025-11-10)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
36
|
+
|
|
37
|
+
## [0.1.19](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.18...@rytass/cms-base-nestjs-graphql-module@0.1.19) (2025-10-20)
|
|
38
|
+
|
|
39
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
40
|
+
|
|
41
|
+
## [0.1.18](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.17...@rytass/cms-base-nestjs-graphql-module@0.1.18) (2025-09-22)
|
|
42
|
+
|
|
43
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
44
|
+
|
|
45
|
+
## [0.1.17](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.16...@rytass/cms-base-nestjs-graphql-module@0.1.17) (2025-09-16)
|
|
46
|
+
|
|
47
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
48
|
+
|
|
49
|
+
## [0.1.16](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.15...@rytass/cms-base-nestjs-graphql-module@0.1.16) (2025-09-16)
|
|
50
|
+
|
|
51
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
52
|
+
|
|
53
|
+
## [0.1.15](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.14...@rytass/cms-base-nestjs-graphql-module@0.1.15) (2025-09-16)
|
|
54
|
+
|
|
55
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
56
|
+
|
|
57
|
+
## [0.1.14](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.13...@rytass/cms-base-nestjs-graphql-module@0.1.14) (2025-09-15)
|
|
58
|
+
|
|
59
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
60
|
+
|
|
61
|
+
## [0.1.13](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.12...@rytass/cms-base-nestjs-graphql-module@0.1.13) (2025-09-11)
|
|
62
|
+
|
|
63
|
+
### Features
|
|
64
|
+
|
|
65
|
+
- migrate to Nx project-based configuration ([c2d9ca4](https://github.com/Rytass/Utils/commit/c2d9ca46c00ace42bcbf69300dcc43a7346cb9aa))
|
|
66
|
+
|
|
67
|
+
### Tests
|
|
68
|
+
|
|
69
|
+
- migrate to standardized test structure ([b7dc99e](https://github.com/Rytass/Utils/commit/b7dc99ef85f5951480dfdae6198cefa252c15423))
|
|
70
|
+
|
|
71
|
+
### BREAKING CHANGES
|
|
72
|
+
|
|
73
|
+
- Test directory structure changed from **test** to **tests**
|
|
74
|
+
|
|
75
|
+
🤖 Generated with [Claude Code](https://claude.ai/code)
|
|
76
|
+
|
|
77
|
+
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
78
|
+
|
|
79
|
+
## [0.1.12](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.11...@rytass/cms-base-nestjs-graphql-module@0.1.12) (2025-09-09)
|
|
80
|
+
|
|
81
|
+
### Bug Fixes
|
|
82
|
+
|
|
83
|
+
- **cms-base:** resolve @typescript-eslint/no-explicit-any errors across CMS modules ([3f64a47](https://github.com/Rytass/Utils/commit/3f64a470dff434558ba208709fd24de2d8d3ec6b))
|
|
84
|
+
|
|
85
|
+
### Features
|
|
86
|
+
|
|
87
|
+
- add test:coverage script to all packages ([f73bce5](https://github.com/Rytass/Utils/commit/f73bce52024d453755824fa6af784f13da50061f))
|
|
88
|
+
- upgrade file-type from v16.5.4 to v21.0.0 ([eb8217b](https://github.com/Rytass/Utils/commit/eb8217b76c4a0d74061f782c082fd4183961bb12))
|
|
89
|
+
|
|
90
|
+
### BREAKING CHANGES
|
|
91
|
+
|
|
92
|
+
- file-type v21 is ESM-only, requires Node.js 18+
|
|
93
|
+
|
|
94
|
+
🤖 Generated with [Claude Code](https://claude.ai/code)
|
|
95
|
+
|
|
96
|
+
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
97
|
+
|
|
98
|
+
## [0.1.11](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.10...@rytass/cms-base-nestjs-graphql-module@0.1.11) (2025-08-24)
|
|
99
|
+
|
|
100
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
101
|
+
|
|
102
|
+
## [0.1.10](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.9...@rytass/cms-base-nestjs-graphql-module@0.1.10) (2025-08-19)
|
|
103
|
+
|
|
104
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
105
|
+
|
|
106
|
+
## [0.1.9](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.8...@rytass/cms-base-nestjs-graphql-module@0.1.9) (2025-08-04)
|
|
107
|
+
|
|
108
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
109
|
+
|
|
110
|
+
## [0.1.8](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.7...@rytass/cms-base-nestjs-graphql-module@0.1.8) (2025-08-04)
|
|
111
|
+
|
|
112
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
113
|
+
|
|
114
|
+
## [0.1.7](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.6...@rytass/cms-base-nestjs-graphql-module@0.1.7) (2025-08-04)
|
|
115
|
+
|
|
116
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
117
|
+
|
|
118
|
+
## [0.1.6](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.5...@rytass/cms-base-nestjs-graphql-module@0.1.6) (2025-08-04)
|
|
119
|
+
|
|
120
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
121
|
+
|
|
122
|
+
## [0.1.5](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.4...@rytass/cms-base-nestjs-graphql-module@0.1.5) (2025-08-04)
|
|
123
|
+
|
|
124
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
125
|
+
|
|
126
|
+
## [0.1.4](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.3...@rytass/cms-base-nestjs-graphql-module@0.1.4) (2025-08-04)
|
|
127
|
+
|
|
128
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
129
|
+
|
|
130
|
+
## [0.1.3](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.2...@rytass/cms-base-nestjs-graphql-module@0.1.3) (2025-08-04)
|
|
131
|
+
|
|
132
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
133
|
+
|
|
134
|
+
## [0.1.2](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.1...@rytass/cms-base-nestjs-graphql-module@0.1.2) (2025-08-04)
|
|
135
|
+
|
|
136
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
137
|
+
|
|
138
|
+
## [0.1.1](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.1.0...@rytass/cms-base-nestjs-graphql-module@0.1.1) (2025-08-04)
|
|
139
|
+
|
|
140
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
141
|
+
|
|
142
|
+
# [0.1.0](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.27...@rytass/cms-base-nestjs-graphql-module@0.1.0) (2025-07-28)
|
|
143
|
+
|
|
144
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
145
|
+
|
|
146
|
+
## [0.0.27](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.26...@rytass/cms-base-nestjs-graphql-module@0.0.27) (2025-07-17)
|
|
147
|
+
|
|
148
|
+
### Bug Fixes
|
|
149
|
+
|
|
150
|
+
- **cms-base-nestjs-graphql-module:** update categoryIds, parentIds, and ids fields to use ID type ([0ab423c](https://github.com/Rytass/Utils/commit/0ab423cf63cc76437bb1700e82a0197b8fff4367))
|
|
151
|
+
|
|
152
|
+
## [0.0.26](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.25...@rytass/cms-base-nestjs-graphql-module@0.0.26) (2025-07-15)
|
|
153
|
+
|
|
154
|
+
### Features
|
|
155
|
+
|
|
156
|
+
- **cms-base-nestjs-graphql-module:** add support for custom article fields and async options ([7d719fe](https://github.com/Rytass/Utils/commit/7d719feb7dad91fd1f046c53514ea6f89dfb0156))
|
|
157
|
+
|
|
158
|
+
## [0.0.25](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.24...@rytass/cms-base-nestjs-graphql-module@0.0.25) (2025-07-14)
|
|
159
|
+
|
|
160
|
+
### Features
|
|
161
|
+
|
|
162
|
+
- **cms-base-nestjs-graphql-module:** add BackstageCategoryResolver and CategoryMultiLanguageNameDto for multi-language support ([3285ffc](https://github.com/Rytass/Utils/commit/3285ffcb0364271e4b037bf7857b083ed9390334))
|
|
163
|
+
- **cms-base-nestjs-graphql-module:** add sorter field to BackstageArticleArgs for article sorting ([14fa2fd](https://github.com/Rytass/Utils/commit/14fa2fda9cfefbebab9db0b55766f37092402fbb))
|
|
164
|
+
- **cms-base-nestjs-graphql-module:** add sorter field to CategoriesArgs for category sorting ([fa0d57e](https://github.com/Rytass/Utils/commit/fa0d57e83a14d510168ff99a1690d360ec3beb65))
|
|
165
|
+
|
|
166
|
+
## [0.0.24](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.23...@rytass/cms-base-nestjs-graphql-module@0.0.24) (2025-07-08)
|
|
167
|
+
|
|
168
|
+
### Bug Fixes
|
|
169
|
+
|
|
170
|
+
- **cms-base-nestjs-graphql-module:** fix multiple language mode is not enabled ([74ee78f](https://github.com/Rytass/Utils/commit/74ee78fd36194e03d0bffced87675428bc07d92c))
|
|
171
|
+
|
|
172
|
+
### Features
|
|
173
|
+
|
|
174
|
+
- **cms-base-nestjs-graphql-module:** replace IsPublic with AllowActions for article and category mutations and queries; add BaseAction and BaseResource enums ([31f85f4](https://github.com/Rytass/Utils/commit/31f85f441f8d7919abd43f19d1f7da865a72b575))
|
|
175
|
+
|
|
176
|
+
## [0.0.23](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.22...@rytass/cms-base-nestjs-graphql-module@0.0.23) (2025-06-30)
|
|
177
|
+
|
|
178
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
179
|
+
|
|
180
|
+
## [0.0.22](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.21...@rytass/cms-base-nestjs-graphql-module@0.0.22) (2025-06-29)
|
|
181
|
+
|
|
182
|
+
### Bug Fixes
|
|
183
|
+
|
|
184
|
+
- **cms-base-nestjs-graphql-module:** update withdrawArticle method to include version parameter ([b5a916b](https://github.com/Rytass/Utils/commit/b5a916ba5be5347d71331750c85c88d7b2f0286a))
|
|
185
|
+
|
|
186
|
+
## [0.0.21](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.20...@rytass/cms-base-nestjs-graphql-module@0.0.21) (2025-06-26)
|
|
187
|
+
|
|
188
|
+
### Bug Fixes
|
|
189
|
+
|
|
190
|
+
- **cms-base-nestjs-graphql-module:** improve serialize method in QuadratsContentScalar to handle string values correctly ([d6f2e30](https://github.com/Rytass/Utils/commit/d6f2e30c52d052e1d4b944d67902f63d4e1bf2d4))
|
|
191
|
+
- **cms-base-nestjs-graphql-module:** remove unnecessary console log in createArticle method ([53a04c2](https://github.com/Rytass/Utils/commit/53a04c26468b593ea706b6e35320da02a6c0aed5))
|
|
192
|
+
- **cms-base-nestjs-graphql-module:** simplify rejectArticle method by removing version parameter ([9702179](https://github.com/Rytass/Utils/commit/9702179565f45d13b600aca81c19478275c46d36))
|
|
193
|
+
|
|
194
|
+
### Features
|
|
195
|
+
|
|
196
|
+
- **cms-base-nestjs-graphql-module:** add articleId field to ArticleResolver and BackstageArticleResolver ([a320973](https://github.com/Rytass/Utils/commit/a3209734592952472fa2b05ed0f98cbf5836c8e9))
|
|
197
|
+
- **cms-base-nestjs-graphql-module:** add deleteArticleVersion mutation and update version handling in approve, reject, and release mutations ([7aa031a](https://github.com/Rytass/Utils/commit/7aa031a88fe71417afbcf828b5cb13e34c0c5861))
|
|
198
|
+
- **cms-base-nestjs-graphql-module:** refactor article creation and update logic to use resolveCreateArticleArgs method for better multi-language support ([6db339d](https://github.com/Rytass/Utils/commit/6db339d68104be04e5d4c4280204329166f1dc19))
|
|
199
|
+
- **cms-base-nestjs-graphql-module:** update submitArticle and add putBackArticle methods for improved article management ([b68418e](https://github.com/Rytass/Utils/commit/b68418ec689593268c4076d4bd42a6b3ab0227e4))
|
|
200
|
+
|
|
201
|
+
## [0.0.20](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.19...@rytass/cms-base-nestjs-graphql-module@0.0.20) (2025-06-23)
|
|
202
|
+
|
|
203
|
+
### Features
|
|
204
|
+
|
|
205
|
+
- **cms-base-nestjs-graphql-module:** resolve id with version ([7996927](https://github.com/Rytass/Utils/commit/799692753719e1da5005ee2afd48a37c6d1620e8))
|
|
206
|
+
|
|
207
|
+
## [0.0.19](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.18...@rytass/cms-base-nestjs-graphql-module@0.0.19) (2025-06-23)
|
|
208
|
+
|
|
209
|
+
### Features
|
|
210
|
+
|
|
211
|
+
- **cms-base-nestjs-graphql-module:** add signatures resolver ([0f437c9](https://github.com/Rytass/Utils/commit/0f437c94bd478f44dcd39a00cda38c12c233e90c))
|
|
212
|
+
|
|
213
|
+
## [0.0.18](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.17...@rytass/cms-base-nestjs-graphql-module@0.0.18) (2025-06-23)
|
|
214
|
+
|
|
215
|
+
### Features
|
|
216
|
+
|
|
217
|
+
- **cms-base-nestjs-graphql-module:** add stage version type support ([6bbe49e](https://github.com/Rytass/Utils/commit/6bbe49ee31c26398e4ae1b955d9c26bfb6d6a353))
|
|
218
|
+
|
|
219
|
+
## [0.0.17](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.16...@rytass/cms-base-nestjs-graphql-module@0.0.17) (2025-06-23)
|
|
220
|
+
|
|
221
|
+
### Features
|
|
222
|
+
|
|
223
|
+
- **cms-base-nestjs-graphql-module:** add stage loader ([695760d](https://github.com/Rytass/Utils/commit/695760de302a08f9a1e40ad175a027f42112bbb5))
|
|
224
|
+
|
|
225
|
+
## [0.0.16](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.15...@rytass/cms-base-nestjs-graphql-module@0.0.16) (2025-06-23)
|
|
226
|
+
|
|
227
|
+
### Features
|
|
228
|
+
|
|
229
|
+
- **cms-base-nestjs-graphql-module:** versions field ([8a16b54](https://github.com/Rytass/Utils/commit/8a16b54a9244c0d023f5915e6071bf8647a3e09a))
|
|
230
|
+
|
|
231
|
+
## [0.0.15](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.14...@rytass/cms-base-nestjs-graphql-module@0.0.15) (2025-06-23)
|
|
232
|
+
|
|
233
|
+
### Features
|
|
234
|
+
|
|
235
|
+
- **cms-base-nestjs-graphql-module:** support multi language fields ([65bc55a](https://github.com/Rytass/Utils/commit/65bc55ab3739ee23a5858a185371e2d0df27ca0a))
|
|
236
|
+
|
|
237
|
+
## [0.0.14](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.13...@rytass/cms-base-nestjs-graphql-module@0.0.14) (2025-06-23)
|
|
238
|
+
|
|
239
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
240
|
+
|
|
241
|
+
## [0.0.13](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.12...@rytass/cms-base-nestjs-graphql-module@0.0.13) (2025-06-23)
|
|
242
|
+
|
|
243
|
+
### Features
|
|
244
|
+
|
|
245
|
+
- **cms-base-nestjs-graphql-module:** add more resolver ([a706558](https://github.com/Rytass/Utils/commit/a7065582f0dd950d898ec061dcbe5a054c115d7c))
|
|
246
|
+
|
|
247
|
+
## [0.0.12](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.11...@rytass/cms-base-nestjs-graphql-module@0.0.12) (2025-06-23)
|
|
248
|
+
|
|
249
|
+
### Bug Fixes
|
|
250
|
+
|
|
251
|
+
- **cms-base-nestjs-graphql-module:** support multi language option ([09bc2c2](https://github.com/Rytass/Utils/commit/09bc2c2a57cca2d9175ce39eb297e5bb1ee46c79))
|
|
252
|
+
|
|
253
|
+
## [0.0.11](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.10...@rytass/cms-base-nestjs-graphql-module@0.0.11) (2025-06-23)
|
|
254
|
+
|
|
255
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
256
|
+
|
|
257
|
+
## [0.0.10](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.9...@rytass/cms-base-nestjs-graphql-module@0.0.10) (2025-06-23)
|
|
258
|
+
|
|
259
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
260
|
+
|
|
261
|
+
## [0.0.9](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.8...@rytass/cms-base-nestjs-graphql-module@0.0.9) (2025-06-23)
|
|
262
|
+
|
|
263
|
+
### Features
|
|
264
|
+
|
|
265
|
+
- **cms-base-nestjs-graphql-module:** add article resolver fields on categories and releaesdBy ([121ebd6](https://github.com/Rytass/Utils/commit/121ebd614ae7d84b495bc7f6a2ec8f7955ae3cec))
|
|
266
|
+
|
|
267
|
+
## [0.0.8](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.7...@rytass/cms-base-nestjs-graphql-module@0.0.8) (2025-06-23)
|
|
268
|
+
|
|
269
|
+
### Features
|
|
270
|
+
|
|
271
|
+
- **cms-base-nestjs-graphql-module:** only return released article on public query ([e3ba06c](https://github.com/Rytass/Utils/commit/e3ba06cf6a62b4a206773d328163f55c47971550))
|
|
272
|
+
|
|
273
|
+
## [0.0.7](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.6...@rytass/cms-base-nestjs-graphql-module@0.0.7) (2025-06-23)
|
|
274
|
+
|
|
275
|
+
### Bug Fixes
|
|
276
|
+
|
|
277
|
+
- **cms-base-nestjs-graphql-module:** support multi language mode detection ([24f599b](https://github.com/Rytass/Utils/commit/24f599ba607ddf37d3dc5f45d542a88214007624))
|
|
278
|
+
|
|
279
|
+
## [0.0.6](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.5...@rytass/cms-base-nestjs-graphql-module@0.0.6) (2025-06-23)
|
|
280
|
+
|
|
281
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
282
|
+
|
|
283
|
+
## [0.0.5](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.4...@rytass/cms-base-nestjs-graphql-module@0.0.5) (2025-06-23)
|
|
284
|
+
|
|
285
|
+
### Bug Fixes
|
|
286
|
+
|
|
287
|
+
- **cms-base-nestjs-graphql-module:** missing object type decorator ([a633952](https://github.com/Rytass/Utils/commit/a633952c70c5972f13441efeb22393233fd09902))
|
|
288
|
+
|
|
289
|
+
## [0.0.4](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.3...@rytass/cms-base-nestjs-graphql-module@0.0.4) (2025-06-23)
|
|
290
|
+
|
|
291
|
+
### Features
|
|
292
|
+
|
|
293
|
+
- **cms-base-nestjs-graphql-module:** remove interface type ([0807267](https://github.com/Rytass/Utils/commit/080726720133ef45c50b2661cafbff634d2ba98a))
|
|
294
|
+
|
|
295
|
+
## [0.0.3](https://github.com/Rytass/Utils/compare/@rytass/cms-base-nestjs-graphql-module@0.0.2...@rytass/cms-base-nestjs-graphql-module@0.0.3) (2025-06-23)
|
|
296
|
+
|
|
297
|
+
**Note:** Version bump only for package @rytass/cms-base-nestjs-graphql-module
|
|
298
|
+
|
|
299
|
+
## 0.0.2 (2025-06-23)
|
|
300
|
+
|
|
301
|
+
### Features
|
|
302
|
+
|
|
303
|
+
- **cms-base-nestjs-graphql-module:** add CmsBaseModule and CmsService with basic functionality ([0958153](https://github.com/Rytass/Utils/commit/09581532b636a888cf9765181ab39f8bdc2ced01))
|
|
304
|
+
- **cms-base-nestjs-graphql-module:** add DataLoaders (articles, categories, members), GraphQL DTOs, queries/mutations/resolvers, Language decorator, and custom scalar for QuadratsContent ([9763977](https://github.com/Rytass/Utils/commit/9763977fa2d66d7b4c9b927ba09018133cf01859))
|
|
305
|
+
- **cms-base-nestjs-graphql-module:** initialize GraphQL module with basic structure and configuration ([4316755](https://github.com/Rytass/Utils/commit/4316755531923aa606e7efaf03f1856d7345df7d))
|
|
306
|
+
- **cms-base-nestjs-module:** add userId option to release method and update releasedBy field ([1138ad6](https://github.com/Rytass/Utils/commit/1138ad6b33daa73e0ac2363b7fda9ad598762075))
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { BaseAction } from '../src/constants/enum/base-action.enum';
|
|
2
|
+
import { BaseResource } from '../src/constants/enum/base-resource.enum';
|
|
3
|
+
|
|
4
|
+
describe('CMS GraphQL Enums', () => {
|
|
5
|
+
describe('BaseAction', () => {
|
|
6
|
+
it('should have LIST action', () => {
|
|
7
|
+
expect(BaseAction.LIST).toBe('LIST');
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it('should have READ action', () => {
|
|
11
|
+
expect(BaseAction.READ).toBe('READ');
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('should have CREATE action', () => {
|
|
15
|
+
expect(BaseAction.CREATE).toBe('CREATE');
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('should have UPDATE action', () => {
|
|
19
|
+
expect(BaseAction.UPDATE).toBe('UPDATE');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should have DELETE action', () => {
|
|
23
|
+
expect(BaseAction.DELETE).toBe('DELETE');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('should have DELETE_VERSION action', () => {
|
|
27
|
+
expect(BaseAction.DELETE_VERSION).toBe('DELETE_VERSION');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should have SUBMIT action', () => {
|
|
31
|
+
expect(BaseAction.SUBMIT).toBe('SUBMIT');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('should have PUT_BACK action', () => {
|
|
35
|
+
expect(BaseAction.PUT_BACK).toBe('PUT_BACK');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should have APPROVE action', () => {
|
|
39
|
+
expect(BaseAction.APPROVE).toBe('APPROVE');
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('should have REJECT action', () => {
|
|
43
|
+
expect(BaseAction.REJECT).toBe('REJECT');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('should have RELEASE action', () => {
|
|
47
|
+
expect(BaseAction.RELEASE).toBe('RELEASE');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should have WITHDRAW action', () => {
|
|
51
|
+
expect(BaseAction.WITHDRAW).toBe('WITHDRAW');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('should have exactly 12 actions', () => {
|
|
55
|
+
const actionCount = Object.keys(BaseAction).length;
|
|
56
|
+
|
|
57
|
+
expect(actionCount).toBe(12);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
describe('BaseResource', () => {
|
|
62
|
+
it('should have ARTICLE resource', () => {
|
|
63
|
+
expect(BaseResource.ARTICLE).toBe('ARTICLE');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('should have CATEGORY resource', () => {
|
|
67
|
+
expect(BaseResource.CATEGORY).toBe('CATEGORY');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('should have exactly 2 resources', () => {
|
|
71
|
+
const resourceCount = Object.keys(BaseResource).length;
|
|
72
|
+
|
|
73
|
+
expect(resourceCount).toBe(2);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { LANGUAGE_HEADER_KEY } from '../src/decorators/language.decorator';
|
|
2
|
+
|
|
3
|
+
describe('Language Decorator', () => {
|
|
4
|
+
describe('LANGUAGE_HEADER_KEY', () => {
|
|
5
|
+
it('should be defined', () => {
|
|
6
|
+
expect(LANGUAGE_HEADER_KEY).toBeDefined();
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it('should have the correct value', () => {
|
|
10
|
+
expect(LANGUAGE_HEADER_KEY).toBe('x-language');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should be a string', () => {
|
|
14
|
+
expect(typeof LANGUAGE_HEADER_KEY).toBe('string');
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { BadRequestException, InternalServerErrorException } from '@nestjs/common';
|
|
2
|
+
import { Kind } from 'graphql';
|
|
3
|
+
import { QuadratsContentScalar } from '../src/scalars/quadrats-element.scalar';
|
|
4
|
+
|
|
5
|
+
describe('QuadratsContentScalar', () => {
|
|
6
|
+
describe('definition', () => {
|
|
7
|
+
it('should have the correct name', () => {
|
|
8
|
+
expect(QuadratsContentScalar.name).toBe('QuadratsContent');
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('should have a description', () => {
|
|
12
|
+
expect(QuadratsContentScalar.description).toBe('QuadratsContent custom scalar type (as JSON string)');
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
describe('parseValue', () => {
|
|
17
|
+
it('should parse a valid JSON string array', () => {
|
|
18
|
+
const validJson = JSON.stringify([{ type: 'paragraph', children: [{ text: 'Hello' }] }]);
|
|
19
|
+
|
|
20
|
+
const result = QuadratsContentScalar.parseValue(validJson);
|
|
21
|
+
|
|
22
|
+
expect(result).toEqual([{ type: 'paragraph', children: [{ text: 'Hello' }] }]);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('should throw BadRequestException for non-array JSON', () => {
|
|
26
|
+
const invalidJson = JSON.stringify({ type: 'paragraph' });
|
|
27
|
+
|
|
28
|
+
expect(() => QuadratsContentScalar.parseValue(invalidJson)).toThrow(BadRequestException);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('should throw InternalServerErrorException for invalid JSON string', () => {
|
|
32
|
+
const invalidJson = 'not valid json';
|
|
33
|
+
|
|
34
|
+
expect(() => QuadratsContentScalar.parseValue(invalidJson)).toThrow(InternalServerErrorException);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('should throw BadRequestException for non-string value', () => {
|
|
38
|
+
expect(() => QuadratsContentScalar.parseValue(123)).toThrow(BadRequestException);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('should throw BadRequestException for object value', () => {
|
|
42
|
+
expect(() => QuadratsContentScalar.parseValue({ type: 'paragraph' })).toThrow(BadRequestException);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should throw BadRequestException for null value', () => {
|
|
46
|
+
expect(() => QuadratsContentScalar.parseValue(null)).toThrow(BadRequestException);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe('serialize', () => {
|
|
51
|
+
it('should return string value as is', () => {
|
|
52
|
+
const stringValue = '[{"type":"paragraph"}]';
|
|
53
|
+
|
|
54
|
+
const result = QuadratsContentScalar.serialize(stringValue);
|
|
55
|
+
|
|
56
|
+
expect(result).toBe(stringValue);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('should stringify array value', () => {
|
|
60
|
+
const arrayValue = [{ type: 'paragraph', children: [{ text: 'Hello' }] }];
|
|
61
|
+
|
|
62
|
+
const result = QuadratsContentScalar.serialize(arrayValue);
|
|
63
|
+
|
|
64
|
+
expect(result).toBe(JSON.stringify(arrayValue));
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('should stringify object value', () => {
|
|
68
|
+
const objectValue = { key: 'value' };
|
|
69
|
+
|
|
70
|
+
const result = QuadratsContentScalar.serialize(objectValue);
|
|
71
|
+
|
|
72
|
+
expect(result).toBe(JSON.stringify(objectValue));
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('should throw InternalServerErrorException for circular reference', () => {
|
|
76
|
+
const circularObj: Record<string, unknown> = {};
|
|
77
|
+
|
|
78
|
+
circularObj.self = circularObj;
|
|
79
|
+
|
|
80
|
+
expect(() => QuadratsContentScalar.serialize(circularObj)).toThrow(InternalServerErrorException);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
describe('parseLiteral', () => {
|
|
85
|
+
it('should parse valid string literal', () => {
|
|
86
|
+
const ast = {
|
|
87
|
+
kind: Kind.STRING,
|
|
88
|
+
value: '[{"type":"paragraph"}]',
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const result = QuadratsContentScalar.parseLiteral(ast, {});
|
|
92
|
+
|
|
93
|
+
expect(result).toEqual([{ type: 'paragraph' }]);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('should throw InternalServerErrorException for invalid JSON in string literal', () => {
|
|
97
|
+
const ast = {
|
|
98
|
+
kind: Kind.STRING,
|
|
99
|
+
value: 'not valid json',
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
expect(() => QuadratsContentScalar.parseLiteral(ast, {})).toThrow(InternalServerErrorException);
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('should throw Error for non-string kind', () => {
|
|
106
|
+
const ast = {
|
|
107
|
+
kind: Kind.INT,
|
|
108
|
+
value: '123',
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
expect(() => QuadratsContentScalar.parseLiteral(ast, {})).toThrow('Expected string literal for QuadratsContent');
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it('should throw Error for object kind', () => {
|
|
115
|
+
const ast = {
|
|
116
|
+
kind: Kind.OBJECT,
|
|
117
|
+
fields: [],
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
expect(() => QuadratsContentScalar.parseLiteral(ast, {})).toThrow('Expected string literal for QuadratsContent');
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
});
|