@constructive-io/graphql-codegen 4.5.0 → 4.5.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.
@@ -136,7 +136,7 @@ function generateMainBarrel(tables, options = {}) {
136
136
  // Add file header as leading comment on first statement
137
137
  if (statements.length > 0) {
138
138
  (0, babel_ast_1.addJSDocComment)(statements[0], [
139
- 'Auto-generated GraphQL SDK',
139
+ 'GraphQL SDK',
140
140
  '@generated by @constructive-io/graphql-codegen',
141
141
  '',
142
142
  `Tables: ${tableNames}`,
@@ -193,7 +193,7 @@ function generateRootBarrel(options = {}) {
193
193
  // Add file headeras leading comment on first statement
194
194
  if (statements.length > 0) {
195
195
  (0, babel_ast_1.addJSDocComment)(statements[0], [
196
- 'Generated SDK - auto-generated, do not edit',
196
+ 'GraphQL SDK - auto-generated, do not edit',
197
197
  '@generated by @constructive-io/graphql-codegen',
198
198
  ]);
199
199
  }
@@ -149,7 +149,7 @@ function generateAgentsDocs(tables, customOperations, toolName) {
149
149
  const lines = [];
150
150
  lines.push(`# ${toolName} CLI - Agent Reference`);
151
151
  lines.push('');
152
- lines.push('> @generated by @constructive-io/graphql-codegen - DO NOT EDIT');
152
+ lines.push('<!-- @constructive-io/graphql-codegen - DO NOT EDIT -->');
153
153
  lines.push('> This document is structured for LLM/agent consumption.');
154
154
  lines.push('');
155
155
  lines.push('## OVERVIEW');
@@ -842,7 +842,7 @@ function generateMultiTargetAgentsDocs(input) {
842
842
  const lines = [];
843
843
  lines.push(`# ${toolName} CLI - Agent Reference`);
844
844
  lines.push('');
845
- lines.push('> @generated by @constructive-io/graphql-codegen - DO NOT EDIT');
845
+ lines.push('<!-- @constructive-io/graphql-codegen - DO NOT EDIT -->');
846
846
  lines.push('> This document is structured for LLM/agent consumption.');
847
847
  lines.push('');
848
848
  lines.push('## OVERVIEW');
@@ -19,7 +19,7 @@ function getReadmeHeader(title) {
19
19
  ` <img height="120" src="${CONSTRUCTIVE_LOGO_URL}" />`,
20
20
  '</p>',
21
21
  '',
22
- `> @generated by @constructive-io/graphql-codegen - DO NOT EDIT`,
22
+ `<!-- @constructive-io/graphql-codegen - DO NOT EDIT -->`,
23
23
  '',
24
24
  ];
25
25
  }
@@ -94,7 +94,7 @@ function buildSkillFile(skill) {
94
94
  const lines = [];
95
95
  lines.push(`# ${skill.name}`);
96
96
  lines.push('');
97
- lines.push('> @generated by @constructive-io/graphql-codegen - DO NOT EDIT');
97
+ lines.push('<!-- @constructive-io/graphql-codegen - DO NOT EDIT -->');
98
98
  lines.push('');
99
99
  lines.push(skill.description);
100
100
  lines.push('');
@@ -124,7 +124,7 @@ function generateHooksAgentsDocs(tables, customOperations) {
124
124
  const lines = [];
125
125
  lines.push('# React Query Hooks - Agent Reference');
126
126
  lines.push('');
127
- lines.push('> @generated by @constructive-io/graphql-codegen - DO NOT EDIT');
127
+ lines.push('<!-- @constructive-io/graphql-codegen - DO NOT EDIT -->');
128
128
  lines.push('> This document is structured for LLM/agent consumption.');
129
129
  lines.push('');
130
130
  lines.push('## OVERVIEW');
@@ -57,7 +57,7 @@ function generateOrmReadme(tables, customOperations) {
57
57
  lines.push(`const items = await db.${singularName}.findMany({ select: { ${scalarFields.map((f) => `${f.name}: true`).join(', ')} } }).execute();`);
58
58
  lines.push('');
59
59
  lines.push(`// Get one by ${pk.name}`);
60
- lines.push(`const item = await db.${singularName}.findOne({ where: { ${pk.name}: '<value>' }, select: { ${scalarFields.map((f) => `${f.name}: true`).join(', ')} } }).execute();`);
60
+ lines.push(`const item = await db.${singularName}.findOne({ ${pk.name}: '<value>', select: { ${scalarFields.map((f) => `${f.name}: true`).join(', ')} } }).execute();`);
61
61
  lines.push('');
62
62
  lines.push(`// Create`);
63
63
  lines.push(`const created = await db.${singularName}.create({ data: { ${editableFields.map((f) => `${f.name}: '<value>'`).join(', ')} }, select: { ${pk.name}: true } }).execute();`);
@@ -114,7 +114,7 @@ function generateOrmAgentsDocs(tables, customOperations) {
114
114
  const lines = [];
115
115
  lines.push('# ORM Client - Agent Reference');
116
116
  lines.push('');
117
- lines.push('> @generated by @constructive-io/graphql-codegen - DO NOT EDIT');
117
+ lines.push('<!-- @constructive-io/graphql-codegen - DO NOT EDIT -->');
118
118
  lines.push('> This document is structured for LLM/agent consumption.');
119
119
  lines.push('');
120
120
  lines.push('## OVERVIEW');
@@ -147,7 +147,7 @@ function generateOrmAgentsDocs(tables, customOperations) {
147
147
  lines.push('```');
148
148
  lines.push('METHODS:');
149
149
  lines.push(` db.${singularName}.findMany({ select, where?, orderBy?, first?, offset? })`);
150
- lines.push(` db.${singularName}.findOne({ where: { ${pk.name} }, select })`);
150
+ lines.push(` db.${singularName}.findOne({ ${pk.name}, select })`);
151
151
  lines.push(` db.${singularName}.create({ data: { ${editableFields.map((f) => f.name).join(', ')} }, select })`);
152
152
  lines.push(` db.${singularName}.update({ where: { ${pk.name} }, data, select })`);
153
153
  lines.push(` db.${singularName}.delete({ where: { ${pk.name} } })`);
@@ -360,7 +360,7 @@ function generateOrmSkills(tables, customOperations) {
360
360
  language: 'typescript',
361
361
  usage: [
362
362
  `db.${(0, utils_1.lcFirst)(singularName)}.findMany({ select: { id: true } }).execute()`,
363
- `db.${(0, utils_1.lcFirst)(singularName)}.findOne({ where: { ${pk.name}: '<value>' }, select: { id: true } }).execute()`,
363
+ `db.${(0, utils_1.lcFirst)(singularName)}.findOne({ ${pk.name}: '<value>', select: { id: true } }).execute()`,
364
364
  `db.${(0, utils_1.lcFirst)(singularName)}.create({ data: { ${editableFields.map((f) => `${f.name}: '<value>'`).join(', ')} }, select: { id: true } }).execute()`,
365
365
  `db.${(0, utils_1.lcFirst)(singularName)}.update({ where: { ${pk.name}: '<value>' }, data: { ${editableFields[0]?.name || 'field'}: '<new>' }, select: { id: true } }).execute()`,
366
366
  `db.${(0, utils_1.lcFirst)(singularName)}.delete({ where: { ${pk.name}: '<value>' } }).execute()`,
@@ -119,7 +119,7 @@ function generateSharedBarrel(hasSchemaTypes) {
119
119
  // Add file header as leading comment on first statement
120
120
  if (statements.length > 0) {
121
121
  (0, babel_ast_1.addJSDocComment)(statements[0], [
122
- 'Shared types - auto-generated, do not edit',
122
+ 'Shared types - do not edit',
123
123
  '@generated by @constructive-io/graphql-codegen',
124
124
  ]);
125
125
  }
@@ -95,7 +95,7 @@ export function generateMainBarrel(tables, options = {}) {
95
95
  // Add file header as leading comment on first statement
96
96
  if (statements.length > 0) {
97
97
  addJSDocComment(statements[0], [
98
- 'Auto-generated GraphQL SDK',
98
+ 'GraphQL SDK',
99
99
  '@generated by @constructive-io/graphql-codegen',
100
100
  '',
101
101
  `Tables: ${tableNames}`,
@@ -152,7 +152,7 @@ export function generateRootBarrel(options = {}) {
152
152
  // Add file headeras leading comment on first statement
153
153
  if (statements.length > 0) {
154
154
  addJSDocComment(statements[0], [
155
- 'Generated SDK - auto-generated, do not edit',
155
+ 'GraphQL SDK - auto-generated, do not edit',
156
156
  '@generated by @constructive-io/graphql-codegen',
157
157
  ]);
158
158
  }
@@ -137,7 +137,7 @@ export function generateAgentsDocs(tables, customOperations, toolName) {
137
137
  const lines = [];
138
138
  lines.push(`# ${toolName} CLI - Agent Reference`);
139
139
  lines.push('');
140
- lines.push('> @generated by @constructive-io/graphql-codegen - DO NOT EDIT');
140
+ lines.push('<!-- @constructive-io/graphql-codegen - DO NOT EDIT -->');
141
141
  lines.push('> This document is structured for LLM/agent consumption.');
142
142
  lines.push('');
143
143
  lines.push('## OVERVIEW');
@@ -830,7 +830,7 @@ export function generateMultiTargetAgentsDocs(input) {
830
830
  const lines = [];
831
831
  lines.push(`# ${toolName} CLI - Agent Reference`);
832
832
  lines.push('');
833
- lines.push('> @generated by @constructive-io/graphql-codegen - DO NOT EDIT');
833
+ lines.push('<!-- @constructive-io/graphql-codegen - DO NOT EDIT -->');
834
834
  lines.push('> This document is structured for LLM/agent consumption.');
835
835
  lines.push('');
836
836
  lines.push('## OVERVIEW');
@@ -9,7 +9,7 @@ export function getReadmeHeader(title) {
9
9
  ` <img height="120" src="${CONSTRUCTIVE_LOGO_URL}" />`,
10
10
  '</p>',
11
11
  '',
12
- `> @generated by @constructive-io/graphql-codegen - DO NOT EDIT`,
12
+ `<!-- @constructive-io/graphql-codegen - DO NOT EDIT -->`,
13
13
  '',
14
14
  ];
15
15
  }
@@ -84,7 +84,7 @@ export function buildSkillFile(skill) {
84
84
  const lines = [];
85
85
  lines.push(`# ${skill.name}`);
86
86
  lines.push('');
87
- lines.push('> @generated by @constructive-io/graphql-codegen - DO NOT EDIT');
87
+ lines.push('<!-- @constructive-io/graphql-codegen - DO NOT EDIT -->');
88
88
  lines.push('');
89
89
  lines.push(skill.description);
90
90
  lines.push('');
@@ -118,7 +118,7 @@ export function generateHooksAgentsDocs(tables, customOperations) {
118
118
  const lines = [];
119
119
  lines.push('# React Query Hooks - Agent Reference');
120
120
  lines.push('');
121
- lines.push('> @generated by @constructive-io/graphql-codegen - DO NOT EDIT');
121
+ lines.push('<!-- @constructive-io/graphql-codegen - DO NOT EDIT -->');
122
122
  lines.push('> This document is structured for LLM/agent consumption.');
123
123
  lines.push('');
124
124
  lines.push('## OVERVIEW');
@@ -51,7 +51,7 @@ export function generateOrmReadme(tables, customOperations) {
51
51
  lines.push(`const items = await db.${singularName}.findMany({ select: { ${scalarFields.map((f) => `${f.name}: true`).join(', ')} } }).execute();`);
52
52
  lines.push('');
53
53
  lines.push(`// Get one by ${pk.name}`);
54
- lines.push(`const item = await db.${singularName}.findOne({ where: { ${pk.name}: '<value>' }, select: { ${scalarFields.map((f) => `${f.name}: true`).join(', ')} } }).execute();`);
54
+ lines.push(`const item = await db.${singularName}.findOne({ ${pk.name}: '<value>', select: { ${scalarFields.map((f) => `${f.name}: true`).join(', ')} } }).execute();`);
55
55
  lines.push('');
56
56
  lines.push(`// Create`);
57
57
  lines.push(`const created = await db.${singularName}.create({ data: { ${editableFields.map((f) => `${f.name}: '<value>'`).join(', ')} }, select: { ${pk.name}: true } }).execute();`);
@@ -108,7 +108,7 @@ export function generateOrmAgentsDocs(tables, customOperations) {
108
108
  const lines = [];
109
109
  lines.push('# ORM Client - Agent Reference');
110
110
  lines.push('');
111
- lines.push('> @generated by @constructive-io/graphql-codegen - DO NOT EDIT');
111
+ lines.push('<!-- @constructive-io/graphql-codegen - DO NOT EDIT -->');
112
112
  lines.push('> This document is structured for LLM/agent consumption.');
113
113
  lines.push('');
114
114
  lines.push('## OVERVIEW');
@@ -141,7 +141,7 @@ export function generateOrmAgentsDocs(tables, customOperations) {
141
141
  lines.push('```');
142
142
  lines.push('METHODS:');
143
143
  lines.push(` db.${singularName}.findMany({ select, where?, orderBy?, first?, offset? })`);
144
- lines.push(` db.${singularName}.findOne({ where: { ${pk.name} }, select })`);
144
+ lines.push(` db.${singularName}.findOne({ ${pk.name}, select })`);
145
145
  lines.push(` db.${singularName}.create({ data: { ${editableFields.map((f) => f.name).join(', ')} }, select })`);
146
146
  lines.push(` db.${singularName}.update({ where: { ${pk.name} }, data, select })`);
147
147
  lines.push(` db.${singularName}.delete({ where: { ${pk.name} } })`);
@@ -354,7 +354,7 @@ export function generateOrmSkills(tables, customOperations) {
354
354
  language: 'typescript',
355
355
  usage: [
356
356
  `db.${lcFirst(singularName)}.findMany({ select: { id: true } }).execute()`,
357
- `db.${lcFirst(singularName)}.findOne({ where: { ${pk.name}: '<value>' }, select: { id: true } }).execute()`,
357
+ `db.${lcFirst(singularName)}.findOne({ ${pk.name}: '<value>', select: { id: true } }).execute()`,
358
358
  `db.${lcFirst(singularName)}.create({ data: { ${editableFields.map((f) => `${f.name}: '<value>'`).join(', ')} }, select: { id: true } }).execute()`,
359
359
  `db.${lcFirst(singularName)}.update({ where: { ${pk.name}: '<value>' }, data: { ${editableFields[0]?.name || 'field'}: '<new>' }, select: { id: true } }).execute()`,
360
360
  `db.${lcFirst(singularName)}.delete({ where: { ${pk.name}: '<value>' } }).execute()`,
@@ -82,7 +82,7 @@ function generateSharedBarrel(hasSchemaTypes) {
82
82
  // Add file header as leading comment on first statement
83
83
  if (statements.length > 0) {
84
84
  addJSDocComment(statements[0], [
85
- 'Shared types - auto-generated, do not edit',
85
+ 'Shared types - do not edit',
86
86
  '@generated by @constructive-io/graphql-codegen',
87
87
  ]);
88
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructive-io/graphql-codegen",
3
- "version": "4.5.0",
3
+ "version": "4.5.2",
4
4
  "description": "GraphQL SDK generator for Constructive databases with React Query hooks",
5
5
  "keywords": [
6
6
  "graphql",
@@ -100,5 +100,5 @@
100
100
  "tsx": "^4.21.0",
101
101
  "typescript": "^5.9.3"
102
102
  },
103
- "gitHead": "594881150b097a4575f5dcdccf46207351d2a080"
103
+ "gitHead": "ce2369cad9ed3abca2887fe4e955afbcc536c17e"
104
104
  }