@baeta/plugin-pagination 2.0.0-next.1 → 2.0.0-next.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
@@ -1,5 +1,15 @@
1
1
  # @baeta/plugin-pagination
2
2
 
3
+ ## 2.0.0-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix broken types
8
+
9
+ - Updated dependencies []:
10
+ - @baeta/generator-sdk@2.0.0-next.2
11
+ - @baeta/util-path@2.0.0-next.2
12
+
3
13
  ## 2.0.0-next.1
4
14
 
5
15
  ### Patch Changes
@@ -0,0 +1,74 @@
1
+ import * as _baeta_generator_sdk from '@baeta/generator-sdk';
2
+
3
+ /**
4
+ * Configuration options for a specific pagination type
5
+ */
6
+ interface PaginationTypeOptions {
7
+ /** The GraphQL type for nodes (e.g., "User!") */
8
+ nodeType?: string;
9
+ /** The GraphQL type for cursors
10
+ * @defaultValue "ID!"
11
+ */
12
+ cursorType?: string;
13
+ /**
14
+ * Additional fields to add to the edge type
15
+ * @example edgeFields: ["hasPhotos: Boolean!"]
16
+ */
17
+ edgeFields?: string[];
18
+ /**
19
+ * Additional fields to add to the connection type
20
+ * @example connectionFields: ["totalCount: Int!"]
21
+ */
22
+ connectionFields?: string[];
23
+ }
24
+ /**
25
+ * Configuration options for the pagination plugin
26
+ */
27
+ interface PaginationOptions<Keys extends string | number | symbol = string> {
28
+ /**
29
+ * Map of type names to their pagination configuration.
30
+ * @example
31
+ * ```typescript
32
+ * {
33
+ * // Simple configuration
34
+ * User: true,
35
+ *
36
+ * // Advanced configuration
37
+ * UserCustom: {
38
+ * nodeType: "User",
39
+ * cursorType: "UUID!",
40
+ * connectionFields: ["totalCount: Int!"],
41
+ * edgeFields: ["hasPhotos: Boolean!"]
42
+ * }
43
+ * }
44
+ * ```
45
+ */
46
+ types: {
47
+ [key in Keys]?: boolean | PaginationTypeOptions;
48
+ };
49
+ /**
50
+ * Whether the node field should be nullable in all connections
51
+ * @defaultValue true
52
+ */
53
+ nullableNode?: boolean;
54
+ /**
55
+ * Additional fields to add to the PageInfo type
56
+ * @example ["hasMorePages: Boolean!"]
57
+ */
58
+ pageInfoFields?: string[];
59
+ /**
60
+ * Custom name for the pagination module
61
+ * @defaultValue 'baeta-pagination'
62
+ */
63
+ moduleName?: string;
64
+ }
65
+ /**
66
+ * A plugin that generates Relay-style pagination types for GraphQL.
67
+ * See https://baeta.io/docs/plugins/pagination for more details
68
+ *
69
+ * @param options - Configuration options for the pagination plugin
70
+ * @returns A Baeta generator plugin
71
+ */
72
+ declare function paginationPlugin<T>(options: PaginationOptions<keyof T>): _baeta_generator_sdk.GeneratorPluginV1<unknown>;
73
+
74
+ export { type PaginationOptions, type PaginationTypeOptions, paginationPlugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baeta/plugin-pagination",
3
- "version": "2.0.0-next.1",
3
+ "version": "2.0.0-next.2",
4
4
  "keywords": [
5
5
  "baeta",
6
6
  "graphql",
@@ -43,8 +43,8 @@
43
43
  "types": "tsc --noEmit"
44
44
  },
45
45
  "dependencies": {
46
- "@baeta/generator-sdk": "^2.0.0-next.1",
47
- "@baeta/util-path": "^2.0.0-next.1"
46
+ "@baeta/generator-sdk": "^2.0.0-next.2",
47
+ "@baeta/util-path": "^2.0.0-next.2"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@baeta/builder": "^0.0.0",