@cmscraft/schema 0.0.0-stage → 0.3.4

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/README.md CHANGED
@@ -1,3 +1,52 @@
1
- # Temporary Holding Version
1
+ # @cmscraft/schema
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The public GraphQL schema of the [CMS Craft](https://docs.cms-craft.com) API, as SDL, plus generated TypeScript types.
4
+ Use it to generate a typed client without introspecting the live API.
5
+
6
+ > Free during beta. Paid plans will follow; we will announce pricing and give notice before any charge.
7
+
8
+ ## Install
9
+
10
+ ```bash
11
+ npm i -D @cmscraft/schema
12
+ ```
13
+
14
+ `pnpm add -D @cmscraft/schema` and `yarn add -D @cmscraft/schema` work the same way.
15
+
16
+ ## Use as a codegen schema
17
+
18
+ `@cmscraft/schema/schema.gql` is the schema file. Point [GraphQL Code Generator](https://the-guild.dev/graphql/codegen)
19
+ at it:
20
+
21
+ ```ts
22
+ // codegen.ts
23
+ import type { CodegenConfig } from '@graphql-codegen/cli'
24
+
25
+ const config: CodegenConfig = {
26
+ schema: 'node_modules/@cmscraft/schema/schema.gql',
27
+ documents: ['src/**/*.graphql'],
28
+ generates: {
29
+ 'src/generated/graphql.ts': { plugins: ['typescript', 'typescript-operations'] }
30
+ }
31
+ }
32
+
33
+ export default config
34
+ ```
35
+
36
+ ## Types
37
+
38
+ The generated schema types are exported from `@cmscraft/schema/types`:
39
+
40
+ ```ts
41
+ import type { Query } from '@cmscraft/schema/types'
42
+ ```
43
+
44
+ ## Documentation
45
+
46
+ Endpoint, authentication and API guides: https://docs.cms-craft.com
47
+
48
+ Questions: support@cms-craft.com
49
+
50
+ ## License
51
+
52
+ MIT