@constructive-io/graphql-codegen 5.13.7 → 5.13.8
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/client/error.d.ts +1 -1
- package/client/error.js +2 -2
- package/client/execute.d.ts +1 -1
- package/client/execute.js +2 -2
- package/client/typed-document.d.ts +1 -1
- package/core/ast.d.ts +1 -1
- package/core/ast.js +4 -4
- package/core/codegen/cli/command-map-generator.d.ts +1 -1
- package/core/codegen/cli/docs-generator.d.ts +2 -2
- package/core/codegen/cli/index.d.ts +10 -10
- package/core/codegen/cli/index.js +21 -21
- package/core/codegen/cli/table-command-generator.js +1 -1
- package/core/codegen/index.js +1 -1
- package/core/codegen/types.js +1 -1
- package/core/codegen/utils.d.ts +1 -1
- package/core/codegen/utils.js +1 -1
- package/core/custom-ast.d.ts +1 -1
- package/core/custom-ast.js +5 -5
- package/core/generate.js +1 -1
- package/core/introspect/schema-query.d.ts +1 -1
- package/core/introspect/schema-query.js +0 -3
- package/core/introspect/source/database.js +1 -9
- package/core/introspect/source/pgpm-module.js +1 -1
- package/core/introspect/transform-schema.d.ts +1 -1
- package/core/introspect/transform-schema.js +5 -5
- package/core/types.d.ts +1 -1
- package/core/types.js +2 -2
- package/esm/client/error.d.ts +1 -1
- package/esm/client/error.js +1 -1
- package/esm/client/execute.d.ts +1 -1
- package/esm/client/execute.js +1 -1
- package/esm/client/typed-document.d.ts +1 -1
- package/esm/core/ast.d.ts +1 -1
- package/esm/core/ast.js +1 -1
- package/esm/core/codegen/cli/command-map-generator.d.ts +1 -1
- package/esm/core/codegen/cli/docs-generator.d.ts +2 -2
- package/esm/core/codegen/cli/docs-generator.js +2 -2
- package/esm/core/codegen/cli/index.d.ts +10 -10
- package/esm/core/codegen/cli/index.js +8 -8
- package/esm/core/codegen/cli/table-command-generator.js +1 -1
- package/esm/core/codegen/docs-utils.js +1 -1
- package/esm/core/codegen/hooks-docs-generator.js +2 -2
- package/esm/core/codegen/index.js +1 -1
- package/esm/core/codegen/mutations.js +1 -1
- package/esm/core/codegen/orm/custom-ops-generator.js +1 -1
- package/esm/core/codegen/orm/docs-generator.js +2 -2
- package/esm/core/codegen/target-docs-generator.js +1 -1
- package/esm/core/codegen/types.js +1 -1
- package/esm/core/codegen/utils.d.ts +1 -1
- package/esm/core/codegen/utils.js +1 -1
- package/esm/core/custom-ast.d.ts +1 -1
- package/esm/core/custom-ast.js +1 -1
- package/esm/core/generate.js +6 -6
- package/esm/core/introspect/schema-query.d.ts +1 -1
- package/esm/core/introspect/schema-query.js +0 -3
- package/esm/core/introspect/source/database.js +1 -9
- package/esm/core/introspect/source/pgpm-module.js +1 -1
- package/esm/core/introspect/transform-schema.d.ts +1 -1
- package/esm/core/introspect/transform-schema.js +1 -1
- package/esm/core/types.d.ts +1 -1
- package/esm/core/types.js +1 -1
- package/esm/core/workspace.js +1 -1
- package/esm/generators/field-selector.d.ts +1 -1
- package/esm/generators/field-selector.js +1 -1
- package/esm/generators/mutations.d.ts +1 -1
- package/esm/generators/mutations.js +1 -1
- package/esm/generators/naming-helpers.d.ts +1 -1
- package/esm/generators/naming-helpers.js +1 -1
- package/esm/generators/select.d.ts +1 -1
- package/esm/generators/select.js +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +1 -1
- package/esm/types/index.d.ts +1 -1
- package/generators/field-selector.d.ts +1 -1
- package/generators/field-selector.js +2 -2
- package/generators/mutations.d.ts +1 -1
- package/generators/mutations.js +2 -2
- package/generators/naming-helpers.d.ts +1 -1
- package/generators/naming-helpers.js +6 -6
- package/generators/select.d.ts +1 -1
- package/generators/select.js +3 -3
- package/index.d.ts +2 -2
- package/index.js +3 -3
- package/package.json +10 -10
- package/types/index.d.ts +1 -1
|
@@ -8,8 +8,8 @@ import { generateMutationKeysFile } from './mutation-keys';
|
|
|
8
8
|
import { generateAllMutationHooks } from './mutations';
|
|
9
9
|
import { generateAllQueryHooks } from './queries';
|
|
10
10
|
import { generateQueryKeysFile } from './query-keys';
|
|
11
|
-
import { generateAllSubscriptionHooks, generateConnectionStateHook, } from './subscriptions';
|
|
12
11
|
import { generateSelectionFile } from './selection';
|
|
12
|
+
import { generateAllSubscriptionHooks, generateConnectionStateHook, } from './subscriptions';
|
|
13
13
|
import { getTableNames } from './utils';
|
|
14
14
|
// ============================================================================
|
|
15
15
|
// Main orchestrator
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* useDeleteCarMutation.ts -> ORM delete
|
|
9
9
|
*/
|
|
10
10
|
import * as t from '@babel/types';
|
|
11
|
-
import { addJSDocComment, buildSelectionArgsCall, callExpr, constDecl, createFunctionParam, createImportDeclaration, createSTypeParam, createTypeReExport, destructureParamsWithSelection, exportDeclareFunction, exportFunction, generateHookFileCode, getClientCallUnwrap, inferSelectResultType, objectProp, omitType, returnUseMutation, selectionConfigType, shorthandProp, spreadObj, sRef,
|
|
11
|
+
import { addJSDocComment, buildSelectionArgsCall, callExpr, constDecl, createFunctionParam, createImportDeclaration, createSTypeParam, createTypeReExport, destructureParamsWithSelection, exportDeclareFunction, exportFunction, generateHookFileCode, getClientCallUnwrap, inferSelectResultType, objectProp, omitType, returnUseMutation, selectionConfigType, shorthandProp, spreadObj, sRef, typeLiteralWithProps, typeRef, useMutationOptionsType, useMutationResultType, voidStatement, } from './hooks-ast';
|
|
12
12
|
import { getBulkCreateMutationFileName, getBulkCreateMutationHookName, getBulkDeleteMutationFileName, getBulkDeleteMutationHookName, getBulkUpdateMutationFileName, getBulkUpdateMutationHookName, getBulkUpsertMutationFileName, getBulkUpsertMutationHookName, getCreateMutationFileName, getCreateMutationHookName, getCreateMutationName, getDeleteInputTypeName, getDeleteMutationFileName, getDeleteMutationHookName, getDeleteMutationName, getExtraInputKeys, getPrimaryKeyInfo, getTableNames, getUpdateInputTypeName, getUpdateMutationFileName, getUpdateMutationHookName, getUpdateMutationName, hasValidPrimaryKey, lcFirst, } from './utils';
|
|
13
13
|
function buildMutationResultType(mutationName, singularName, relationTypeName, selectType) {
|
|
14
14
|
return typeLiteralWithProps([
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import * as t from '@babel/types';
|
|
8
8
|
import { addJSDocComment, generateCode } from '../babel-ast';
|
|
9
|
-
import {
|
|
9
|
+
import { getSelectTypeName, NON_SELECT_TYPES } from '../select-helpers';
|
|
10
10
|
import { getTypeBaseName, isTypeRequired, scalarToTsType, typeRefToTsType, } from '../type-resolver';
|
|
11
11
|
import { getGeneratedFileHeader, stripSmartComments, ucFirst } from '../utils';
|
|
12
12
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toKebabCase } from 'inflekt';
|
|
2
|
-
import { buildSkillFile, buildSkillReference,
|
|
3
|
-
import { getScalarFields, getTableNames,
|
|
2
|
+
import { argPlaceholder, buildSkillFile, buildSkillReference, buildSpecialFieldsMarkdown, categorizeSpecialFields, fieldPlaceholder, formatArgType, getEditableFields, getReadmeFooter, getReadmeHeader, pkPlaceholder, } from '../docs-utils';
|
|
3
|
+
import { getPrimaryKeyInfo, getScalarFields, getTableNames, lcFirst, } from '../utils';
|
|
4
4
|
export function generateOrmReadme(tables, customOperations, registry) {
|
|
5
5
|
const lines = [];
|
|
6
6
|
lines.push(...getReadmeHeader('ORM Client'));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getReadmeFooter, getReadmeHeader } from './docs-utils';
|
|
2
2
|
export function generateTargetReadme(options) {
|
|
3
3
|
const { hasOrm, hasHooks, hasCli, tableCount, customQueryCount, customMutationCount, config, } = options;
|
|
4
4
|
const lines = [];
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Types generator - generates types.ts with entity interfaces using Babel AST
|
|
3
3
|
*/
|
|
4
4
|
import * as t from '@babel/types';
|
|
5
|
-
import { SCALAR_NAMES } from './scalars';
|
|
6
5
|
import { generateCode } from './babel-ast';
|
|
6
|
+
import { SCALAR_NAMES } from './scalars';
|
|
7
7
|
import { fieldTypeToTs, getGeneratedFileHeader, getScalarFields, } from './utils';
|
|
8
8
|
/** All filter type configurations - scalar and list filters */
|
|
9
9
|
const FILTER_CONFIGS = [
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { lcFirst, toCamelCase, toConstantCase, toPascalCase, ucFirst } from 'inflekt';
|
|
5
5
|
import type { Field, FieldType, Table, TypeRegistry } from '../../types/schema';
|
|
6
|
-
export { lcFirst, toCamelCase,
|
|
6
|
+
export { lcFirst, toCamelCase, toConstantCase, toPascalCase, ucFirst };
|
|
7
7
|
export interface TableNames {
|
|
8
8
|
/** PascalCase singular (e.g., "Car") */
|
|
9
9
|
typeName: string;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { lcFirst, pluralize, toCamelCase, toConstantCase, toPascalCase, ucFirst, } from 'inflekt';
|
|
5
5
|
import { scalarToFilterType, scalarToTsType } from './scalars';
|
|
6
6
|
// Re-export string manipulation helpers from inflekt (single source of truth)
|
|
7
|
-
export { lcFirst, toCamelCase,
|
|
7
|
+
export { lcFirst, toCamelCase, toConstantCase, toPascalCase, ucFirst };
|
|
8
8
|
/**
|
|
9
9
|
* Derive all naming variants from a table
|
|
10
10
|
*/
|
package/esm/core/custom-ast.d.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* These custom AST builders handle PostgreSQL types that need subfield selections
|
|
5
5
|
* (geometry, interval, etc.). The canonical implementations now live in graphql-query.
|
|
6
6
|
*/
|
|
7
|
-
export {
|
|
7
|
+
export { geometryAst, geometryCollectionAst, geometryPointAst, getCustomAst, getCustomAstForCleanField, intervalAst, isIntervalType, requiresSubfieldSelection, } from '@constructive-io/graphql-query';
|
package/esm/core/custom-ast.js
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* These custom AST builders handle PostgreSQL types that need subfield selections
|
|
5
5
|
* (geometry, interval, etc.). The canonical implementations now live in graphql-query.
|
|
6
6
|
*/
|
|
7
|
-
export {
|
|
7
|
+
export { geometryAst, geometryCollectionAst, geometryPointAst, getCustomAst, getCustomAstForCleanField, intervalAst, isIntervalType, requiresSubfieldSelection, } from '@constructive-io/graphql-query';
|
package/esm/core/generate.js
CHANGED
|
@@ -6,22 +6,22 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import * as fs from 'node:fs';
|
|
8
8
|
import path from 'node:path';
|
|
9
|
-
import { buildClientSchema, printSchema } from 'graphql';
|
|
10
9
|
import { PgpmPackage } from '@pgpmjs/core';
|
|
10
|
+
import { buildClientSchema, printSchema } from 'graphql';
|
|
11
11
|
import { pgCache } from 'pg-cache';
|
|
12
12
|
import { createEphemeralDb } from 'pgsql-client';
|
|
13
13
|
import { deployPgpm } from 'pgsql-seed';
|
|
14
14
|
import { getConfigOptions } from '../types/config';
|
|
15
15
|
import { generate as generateReactQueryFiles } from './codegen';
|
|
16
|
-
import {
|
|
16
|
+
import { generateMultiTargetBarrel, generateRootBarrel } from './codegen/barrel';
|
|
17
17
|
import { generateCli as generateCliFiles, generateMultiTargetCli } from './codegen/cli';
|
|
18
|
-
import {
|
|
18
|
+
import { generateAgentsDocs as generateCliAgentsDocs, generateMultiTargetAgentsDocs, generateMultiTargetReadme, generateMultiTargetSkills, generateReadme as generateCliReadme, generateSkills as generateCliSkills, } from './codegen/cli/docs-generator';
|
|
19
19
|
import { resolveDocsConfig } from './codegen/docs-utils';
|
|
20
|
-
import {
|
|
20
|
+
import { generateHooksAgentsDocs, generateHooksReadme, generateHooksSkills, } from './codegen/hooks-docs-generator';
|
|
21
21
|
import { generateOrm as generateOrmFiles } from './codegen/orm';
|
|
22
|
-
import {
|
|
22
|
+
import { generateOrmAgentsDocs, generateOrmReadme, generateOrmSkills, } from './codegen/orm/docs-generator';
|
|
23
23
|
import { generateSharedTypes } from './codegen/shared';
|
|
24
|
-
import {
|
|
24
|
+
import { generateRootRootReadme, generateTargetReadme, } from './codegen/target-docs-generator';
|
|
25
25
|
import { createSchemaSource, validateSourceOptions } from './introspect';
|
|
26
26
|
import { writeGeneratedFiles } from './output';
|
|
27
27
|
import { runCodegenPipeline, validateTablesFound } from './pipeline';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Re-export schema query from @constructive-io/graphql-query.
|
|
3
3
|
*/
|
|
4
|
-
export { SCHEMA_INTROSPECTION_QUERY } from '@constructive-io/graphql-query';
|
|
5
4
|
export type { IntrospectionQueryResponse } from '@constructive-io/graphql-query';
|
|
5
|
+
export { SCHEMA_INTROSPECTION_QUERY } from '@constructive-io/graphql-query';
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Database Schema Source
|
|
3
|
-
*
|
|
4
|
-
* Loads GraphQL schema directly from a PostgreSQL database using PostGraphile
|
|
5
|
-
* introspection and converts it to introspection format.
|
|
6
|
-
* Also returns _meta table metadata correlated to the same schema build
|
|
7
|
-
* (via buildSchemaArtifacts).
|
|
8
|
-
*/
|
|
9
|
-
import { buildSchema, introspectionFromSchema } from 'graphql';
|
|
10
1
|
import { buildSchemaArtifacts } from 'graphile-schema';
|
|
2
|
+
import { buildSchema, introspectionFromSchema } from 'graphql';
|
|
11
3
|
import { createDatabasePool, resolveApiSchemas, validateRoutingSchemas, } from './api-schemas';
|
|
12
4
|
import { SchemaSourceError } from './types';
|
|
13
5
|
/**
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
* 4. Cleaning up the ephemeral database (unless keepDb is true)
|
|
9
9
|
*/
|
|
10
10
|
import { PgpmPackage } from '@pgpmjs/core';
|
|
11
|
+
import { buildSchemaSDL } from 'graphile-schema';
|
|
11
12
|
import { buildSchema, introspectionFromSchema } from 'graphql';
|
|
12
13
|
import { getPgPool, pgCache } from 'pg-cache';
|
|
13
14
|
import { createEphemeralDb } from 'pgsql-client';
|
|
14
15
|
import { deployPgpm } from 'pgsql-seed';
|
|
15
|
-
import { buildSchemaSDL } from 'graphile-schema';
|
|
16
16
|
import { resolveApiSchemas, validateRoutingSchemas } from './api-schemas';
|
|
17
17
|
import { SchemaSourceError } from './types';
|
|
18
18
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Re-export schema transformation utilities from @constructive-io/graphql-query.
|
|
3
3
|
*/
|
|
4
|
-
export { buildTypeRegistry,
|
|
4
|
+
export { buildTypeRegistry, filterOperations, getBaseTypeName, getCustomOperations, getTableOperationNames, isNonNull, isTableOperation, type TableOperationNames, type TransformSchemaResult, transformSchemaToOperations, unwrapType, } from '@constructive-io/graphql-query';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Re-export schema transformation utilities from @constructive-io/graphql-query.
|
|
3
3
|
*/
|
|
4
|
-
export { buildTypeRegistry,
|
|
4
|
+
export { buildTypeRegistry, filterOperations, getBaseTypeName, getCustomOperations, getTableOperationNames, isNonNull, isTableOperation, transformSchemaToOperations, unwrapType, } from '@constructive-io/graphql-query';
|
package/esm/core/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Re-export core types from @constructive-io/graphql-query.
|
|
3
3
|
*/
|
|
4
|
-
export { type
|
|
4
|
+
export { type ASTFunctionParams, type ASTNode, type GraphQLVariables, type GraphQLVariableValue, type IQueryBuilder, isGraphQLVariables, isGraphQLVariableValue, type MetaConstraint, type MetaField, type MetaFieldType, type MetaForeignConstraint, type MetaObject, type MetaTable, type MutationASTParams, type MutationDefinition, type NestedProperties, type ObjectArrayItem, type QueryBuilderInstance, type QueryBuilderOptions, type QueryBuilderResult, type QueryDefinition, type QueryFieldSelection, type QueryProperty, type QuerySelectionOptions, type StrictRecord, } from '@constructive-io/graphql-query';
|
package/esm/core/types.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Re-export core types from @constructive-io/graphql-query.
|
|
3
3
|
*/
|
|
4
4
|
// Re-export everything from the canonical source
|
|
5
|
-
export {
|
|
5
|
+
export { isGraphQLVariables, isGraphQLVariableValue, } from '@constructive-io/graphql-query';
|
package/esm/core/workspace.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Inspired by @pgpmjs/env walkUp / resolvePnpmWorkspace patterns.
|
|
9
9
|
*/
|
|
10
10
|
import { existsSync, readFileSync } from 'node:fs';
|
|
11
|
-
import { dirname,
|
|
11
|
+
import { dirname, parse as parsePath, resolve } from 'node:path';
|
|
12
12
|
/**
|
|
13
13
|
* Walk up directories from startDir looking for a file.
|
|
14
14
|
* Returns the directory containing the file, or null if not found.
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* The canonical implementations of convertToSelectionOptions, isRelationalField,
|
|
5
5
|
* getAvailableRelations, and validateFieldSelection now live in graphql-query.
|
|
6
6
|
*/
|
|
7
|
-
export { convertToSelectionOptions,
|
|
7
|
+
export { convertToSelectionOptions, getAvailableRelations, isRelationalField, validateFieldSelection, } from '@constructive-io/graphql-query';
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* The canonical implementations of convertToSelectionOptions, isRelationalField,
|
|
5
5
|
* getAvailableRelations, and validateFieldSelection now live in graphql-query.
|
|
6
6
|
*/
|
|
7
|
-
export { convertToSelectionOptions,
|
|
7
|
+
export { convertToSelectionOptions, getAvailableRelations, isRelationalField, validateFieldSelection, } from '@constructive-io/graphql-query';
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* The canonical implementations of buildPostGraphileCreate, buildPostGraphileUpdate,
|
|
5
5
|
* and buildPostGraphileDelete now live in graphql-query.
|
|
6
6
|
*/
|
|
7
|
-
export { buildPostGraphileCreate,
|
|
7
|
+
export { buildPostGraphileCreate, buildPostGraphileDelete, buildPostGraphileUpdate, } from '@constructive-io/graphql-query';
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* The canonical implementations of buildPostGraphileCreate, buildPostGraphileUpdate,
|
|
5
5
|
* and buildPostGraphileDelete now live in graphql-query.
|
|
6
6
|
*/
|
|
7
|
-
export { buildPostGraphileCreate,
|
|
7
|
+
export { buildPostGraphileCreate, buildPostGraphileDelete, buildPostGraphileUpdate, } from '@constructive-io/graphql-query';
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Server-aware inflection naming functions now live in graphql-query.
|
|
5
5
|
*/
|
|
6
|
-
export { normalizeInflectionValue, toCamelCaseSingular, toCreateMutationName,
|
|
6
|
+
export { normalizeInflectionValue, toCamelCaseSingular, toCreateInputTypeName, toCreateMutationName, toDeleteInputTypeName, toDeleteMutationName, toFilterTypeName, toOrderByEnumValue, toPatchFieldName, toUpdateInputTypeName, toUpdateMutationName, } from '@constructive-io/graphql-query';
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Server-aware inflection naming functions now live in graphql-query.
|
|
5
5
|
*/
|
|
6
|
-
export { normalizeInflectionValue, toCamelCaseSingular, toCreateMutationName,
|
|
6
|
+
export { normalizeInflectionValue, toCamelCaseSingular, toCreateInputTypeName, toCreateMutationName, toDeleteInputTypeName, toDeleteMutationName, toFilterTypeName, toOrderByEnumValue, toPatchFieldName, toUpdateInputTypeName, toUpdateMutationName, } from '@constructive-io/graphql-query';
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* cleanTableToMetaObject, createASTQueryBuilder, generateIntrospectionSchema,
|
|
6
6
|
* toCamelCasePlural, and toOrderByTypeName now live in graphql-query.
|
|
7
7
|
*/
|
|
8
|
-
export {
|
|
8
|
+
export { buildCount, buildFindOne, buildSelect, cleanTableToMetaObject, createASTQueryBuilder, generateIntrospectionSchema, toCamelCasePlural, toOrderByTypeName, } from '@constructive-io/graphql-query';
|
package/esm/generators/select.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* cleanTableToMetaObject, createASTQueryBuilder, generateIntrospectionSchema,
|
|
6
6
|
* toCamelCasePlural, and toOrderByTypeName now live in graphql-query.
|
|
7
7
|
*/
|
|
8
|
-
export {
|
|
8
|
+
export { buildCount, buildFindOne, buildSelect, cleanTableToMetaObject, createASTQueryBuilder, generateIntrospectionSchema, toCamelCasePlural, toOrderByTypeName, } from '@constructive-io/graphql-query';
|
package/esm/index.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export * from './core';
|
|
|
10
10
|
export * from './generators';
|
|
11
11
|
export * from './client';
|
|
12
12
|
export { defineConfig } from './types/config';
|
|
13
|
-
export type {
|
|
14
|
-
export {
|
|
13
|
+
export type { GenerateMultiOptions, GenerateMultiResult, GenerateOptions, GenerateResult } from './core/generate';
|
|
14
|
+
export { expandApiNamesToMultiTarget, expandSchemaDirToMultiTarget, generate, generateMulti, removeStaleTargetDirs, TARGETS_MANIFEST } from './core/generate';
|
|
15
15
|
export { findConfigFile, loadConfigFile } from './core/config';
|
|
16
16
|
export { runCodegenHandler } from './cli/handler';
|
|
17
17
|
export type { CodegenAnswers } from './cli/shared';
|
package/esm/index.js
CHANGED
|
@@ -15,7 +15,7 @@ export * from './generators';
|
|
|
15
15
|
export * from './client';
|
|
16
16
|
// Config definition helper
|
|
17
17
|
export { defineConfig } from './types/config';
|
|
18
|
-
export {
|
|
18
|
+
export { expandApiNamesToMultiTarget, expandSchemaDirToMultiTarget, generate, generateMulti, removeStaleTargetDirs, TARGETS_MANIFEST } from './core/generate';
|
|
19
19
|
// Config utilities
|
|
20
20
|
export { findConfigFile, loadConfigFile } from './core/config';
|
|
21
21
|
// CLI shared utilities (for packages/cli to import)
|
package/esm/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type exports for @constructive-io/graphql-codegen
|
|
3
3
|
*/
|
|
4
|
-
export type { BelongsToRelation, Field, FieldType, HasManyRelation, HasOneRelation, ManyToManyRelation, Relations, Table,
|
|
4
|
+
export type { BelongsToRelation, ConstraintInfo, Field, FieldType, ForeignKeyConstraint, HasManyRelation, HasOneRelation, ManyToManyRelation, Relations, Table, TableConstraints, TableInflection, TableQueryNames, } from './schema';
|
|
5
5
|
export type { ConnectionResult, FieldFilter, Filter, FilterOperator, OrderByItem, PageInfo, QueryOptions, RelationalFilter, } from './query';
|
|
6
6
|
export type { CreateInput, DeleteInput, MutationOptions, MutationResult, UpdateInput, } from './mutation';
|
|
7
7
|
export type { FieldSelection, FieldSelectionPreset, SelectionOptions, SimpleFieldSelection, } from './selection';
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* The canonical implementations of convertToSelectionOptions, isRelationalField,
|
|
5
5
|
* getAvailableRelations, and validateFieldSelection now live in graphql-query.
|
|
6
6
|
*/
|
|
7
|
-
export { convertToSelectionOptions,
|
|
7
|
+
export { convertToSelectionOptions, getAvailableRelations, isRelationalField, validateFieldSelection, } from '@constructive-io/graphql-query';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateFieldSelection = exports.
|
|
3
|
+
exports.validateFieldSelection = exports.isRelationalField = exports.getAvailableRelations = exports.convertToSelectionOptions = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Re-export field selector utilities from @constructive-io/graphql-query.
|
|
6
6
|
*
|
|
@@ -9,6 +9,6 @@ exports.validateFieldSelection = exports.getAvailableRelations = exports.isRelat
|
|
|
9
9
|
*/
|
|
10
10
|
var graphql_query_1 = require("@constructive-io/graphql-query");
|
|
11
11
|
Object.defineProperty(exports, "convertToSelectionOptions", { enumerable: true, get: function () { return graphql_query_1.convertToSelectionOptions; } });
|
|
12
|
-
Object.defineProperty(exports, "isRelationalField", { enumerable: true, get: function () { return graphql_query_1.isRelationalField; } });
|
|
13
12
|
Object.defineProperty(exports, "getAvailableRelations", { enumerable: true, get: function () { return graphql_query_1.getAvailableRelations; } });
|
|
13
|
+
Object.defineProperty(exports, "isRelationalField", { enumerable: true, get: function () { return graphql_query_1.isRelationalField; } });
|
|
14
14
|
Object.defineProperty(exports, "validateFieldSelection", { enumerable: true, get: function () { return graphql_query_1.validateFieldSelection; } });
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* The canonical implementations of buildPostGraphileCreate, buildPostGraphileUpdate,
|
|
5
5
|
* and buildPostGraphileDelete now live in graphql-query.
|
|
6
6
|
*/
|
|
7
|
-
export { buildPostGraphileCreate,
|
|
7
|
+
export { buildPostGraphileCreate, buildPostGraphileDelete, buildPostGraphileUpdate, } from '@constructive-io/graphql-query';
|
package/generators/mutations.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.buildPostGraphileUpdate = exports.buildPostGraphileDelete = exports.buildPostGraphileCreate = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Re-export mutation generators from @constructive-io/graphql-query.
|
|
6
6
|
*
|
|
@@ -9,5 +9,5 @@ exports.buildPostGraphileDelete = exports.buildPostGraphileUpdate = exports.buil
|
|
|
9
9
|
*/
|
|
10
10
|
var graphql_query_1 = require("@constructive-io/graphql-query");
|
|
11
11
|
Object.defineProperty(exports, "buildPostGraphileCreate", { enumerable: true, get: function () { return graphql_query_1.buildPostGraphileCreate; } });
|
|
12
|
-
Object.defineProperty(exports, "buildPostGraphileUpdate", { enumerable: true, get: function () { return graphql_query_1.buildPostGraphileUpdate; } });
|
|
13
12
|
Object.defineProperty(exports, "buildPostGraphileDelete", { enumerable: true, get: function () { return graphql_query_1.buildPostGraphileDelete; } });
|
|
13
|
+
Object.defineProperty(exports, "buildPostGraphileUpdate", { enumerable: true, get: function () { return graphql_query_1.buildPostGraphileUpdate; } });
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Server-aware inflection naming functions now live in graphql-query.
|
|
5
5
|
*/
|
|
6
|
-
export { normalizeInflectionValue, toCamelCaseSingular, toCreateMutationName,
|
|
6
|
+
export { normalizeInflectionValue, toCamelCaseSingular, toCreateInputTypeName, toCreateMutationName, toDeleteInputTypeName, toDeleteMutationName, toFilterTypeName, toOrderByEnumValue, toPatchFieldName, toUpdateInputTypeName, toUpdateMutationName, } from '@constructive-io/graphql-query';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toUpdateMutationName = exports.toUpdateInputTypeName = exports.toPatchFieldName = exports.toOrderByEnumValue = exports.toFilterTypeName = exports.toDeleteMutationName = exports.toDeleteInputTypeName = exports.toCreateMutationName = exports.toCreateInputTypeName = exports.toCamelCaseSingular = exports.normalizeInflectionValue = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Re-export naming helpers from @constructive-io/graphql-query.
|
|
6
6
|
*
|
|
@@ -9,12 +9,12 @@ exports.toOrderByEnumValue = exports.toPatchFieldName = exports.toFilterTypeName
|
|
|
9
9
|
var graphql_query_1 = require("@constructive-io/graphql-query");
|
|
10
10
|
Object.defineProperty(exports, "normalizeInflectionValue", { enumerable: true, get: function () { return graphql_query_1.normalizeInflectionValue; } });
|
|
11
11
|
Object.defineProperty(exports, "toCamelCaseSingular", { enumerable: true, get: function () { return graphql_query_1.toCamelCaseSingular; } });
|
|
12
|
-
Object.defineProperty(exports, "toCreateMutationName", { enumerable: true, get: function () { return graphql_query_1.toCreateMutationName; } });
|
|
13
|
-
Object.defineProperty(exports, "toUpdateMutationName", { enumerable: true, get: function () { return graphql_query_1.toUpdateMutationName; } });
|
|
14
|
-
Object.defineProperty(exports, "toDeleteMutationName", { enumerable: true, get: function () { return graphql_query_1.toDeleteMutationName; } });
|
|
15
12
|
Object.defineProperty(exports, "toCreateInputTypeName", { enumerable: true, get: function () { return graphql_query_1.toCreateInputTypeName; } });
|
|
16
|
-
Object.defineProperty(exports, "
|
|
13
|
+
Object.defineProperty(exports, "toCreateMutationName", { enumerable: true, get: function () { return graphql_query_1.toCreateMutationName; } });
|
|
17
14
|
Object.defineProperty(exports, "toDeleteInputTypeName", { enumerable: true, get: function () { return graphql_query_1.toDeleteInputTypeName; } });
|
|
15
|
+
Object.defineProperty(exports, "toDeleteMutationName", { enumerable: true, get: function () { return graphql_query_1.toDeleteMutationName; } });
|
|
18
16
|
Object.defineProperty(exports, "toFilterTypeName", { enumerable: true, get: function () { return graphql_query_1.toFilterTypeName; } });
|
|
19
|
-
Object.defineProperty(exports, "toPatchFieldName", { enumerable: true, get: function () { return graphql_query_1.toPatchFieldName; } });
|
|
20
17
|
Object.defineProperty(exports, "toOrderByEnumValue", { enumerable: true, get: function () { return graphql_query_1.toOrderByEnumValue; } });
|
|
18
|
+
Object.defineProperty(exports, "toPatchFieldName", { enumerable: true, get: function () { return graphql_query_1.toPatchFieldName; } });
|
|
19
|
+
Object.defineProperty(exports, "toUpdateInputTypeName", { enumerable: true, get: function () { return graphql_query_1.toUpdateInputTypeName; } });
|
|
20
|
+
Object.defineProperty(exports, "toUpdateMutationName", { enumerable: true, get: function () { return graphql_query_1.toUpdateMutationName; } });
|
package/generators/select.d.ts
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* cleanTableToMetaObject, createASTQueryBuilder, generateIntrospectionSchema,
|
|
6
6
|
* toCamelCasePlural, and toOrderByTypeName now live in graphql-query.
|
|
7
7
|
*/
|
|
8
|
-
export {
|
|
8
|
+
export { buildCount, buildFindOne, buildSelect, cleanTableToMetaObject, createASTQueryBuilder, generateIntrospectionSchema, toCamelCasePlural, toOrderByTypeName, } from '@constructive-io/graphql-query';
|
package/generators/select.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toOrderByTypeName = exports.toCamelCasePlural = exports.generateIntrospectionSchema = exports.createASTQueryBuilder = exports.cleanTableToMetaObject = exports.
|
|
3
|
+
exports.toOrderByTypeName = exports.toCamelCasePlural = exports.generateIntrospectionSchema = exports.createASTQueryBuilder = exports.cleanTableToMetaObject = exports.buildSelect = exports.buildFindOne = exports.buildCount = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Re-export select query generators from @constructive-io/graphql-query.
|
|
6
6
|
*
|
|
@@ -9,9 +9,9 @@ exports.toOrderByTypeName = exports.toCamelCasePlural = exports.generateIntrospe
|
|
|
9
9
|
* toCamelCasePlural, and toOrderByTypeName now live in graphql-query.
|
|
10
10
|
*/
|
|
11
11
|
var graphql_query_1 = require("@constructive-io/graphql-query");
|
|
12
|
-
Object.defineProperty(exports, "buildSelect", { enumerable: true, get: function () { return graphql_query_1.buildSelect; } });
|
|
13
|
-
Object.defineProperty(exports, "buildFindOne", { enumerable: true, get: function () { return graphql_query_1.buildFindOne; } });
|
|
14
12
|
Object.defineProperty(exports, "buildCount", { enumerable: true, get: function () { return graphql_query_1.buildCount; } });
|
|
13
|
+
Object.defineProperty(exports, "buildFindOne", { enumerable: true, get: function () { return graphql_query_1.buildFindOne; } });
|
|
14
|
+
Object.defineProperty(exports, "buildSelect", { enumerable: true, get: function () { return graphql_query_1.buildSelect; } });
|
|
15
15
|
Object.defineProperty(exports, "cleanTableToMetaObject", { enumerable: true, get: function () { return graphql_query_1.cleanTableToMetaObject; } });
|
|
16
16
|
Object.defineProperty(exports, "createASTQueryBuilder", { enumerable: true, get: function () { return graphql_query_1.createASTQueryBuilder; } });
|
|
17
17
|
Object.defineProperty(exports, "generateIntrospectionSchema", { enumerable: true, get: function () { return graphql_query_1.generateIntrospectionSchema; } });
|
package/index.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export * from './core';
|
|
|
10
10
|
export * from './generators';
|
|
11
11
|
export * from './client';
|
|
12
12
|
export { defineConfig } from './types/config';
|
|
13
|
-
export type {
|
|
14
|
-
export {
|
|
13
|
+
export type { GenerateMultiOptions, GenerateMultiResult, GenerateOptions, GenerateResult } from './core/generate';
|
|
14
|
+
export { expandApiNamesToMultiTarget, expandSchemaDirToMultiTarget, generate, generateMulti, removeStaleTargetDirs, TARGETS_MANIFEST } from './core/generate';
|
|
15
15
|
export { findConfigFile, loadConfigFile } from './core/config';
|
|
16
16
|
export { runCodegenHandler } from './cli/handler';
|
|
17
17
|
export type { CodegenAnswers } from './cli/shared';
|
package/index.js
CHANGED
|
@@ -21,7 +21,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
21
21
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.buildSchemaFromDatabase = exports.splitCommas = exports.seedArgvFromConfig = exports.printResult = exports.normalizeCodegenListOptions = exports.hyphenateKeys = exports.hasResolvedCodegenSource = exports.flattenDbFields = exports.filterDefined = exports.codegenQuestions = exports.camelizeArgv = exports.buildGenerateOptions = exports.buildDbConfig = exports.runCodegenHandler = exports.loadConfigFile = exports.findConfigFile = exports.TARGETS_MANIFEST = exports.removeStaleTargetDirs = exports.
|
|
24
|
+
exports.buildSchemaFromDatabase = exports.splitCommas = exports.seedArgvFromConfig = exports.printResult = exports.normalizeCodegenListOptions = exports.hyphenateKeys = exports.hasResolvedCodegenSource = exports.flattenDbFields = exports.filterDefined = exports.codegenQuestions = exports.camelizeArgv = exports.buildGenerateOptions = exports.buildDbConfig = exports.runCodegenHandler = exports.loadConfigFile = exports.findConfigFile = exports.TARGETS_MANIFEST = exports.removeStaleTargetDirs = exports.generateMulti = exports.generate = exports.expandSchemaDirToMultiTarget = exports.expandApiNamesToMultiTarget = exports.defineConfig = void 0;
|
|
25
25
|
// Core types
|
|
26
26
|
__exportStar(require("./types"), exports);
|
|
27
27
|
// Core query building
|
|
@@ -34,10 +34,10 @@ __exportStar(require("./client"), exports);
|
|
|
34
34
|
var config_1 = require("./types/config");
|
|
35
35
|
Object.defineProperty(exports, "defineConfig", { enumerable: true, get: function () { return config_1.defineConfig; } });
|
|
36
36
|
var generate_1 = require("./core/generate");
|
|
37
|
-
Object.defineProperty(exports, "generate", { enumerable: true, get: function () { return generate_1.generate; } });
|
|
38
|
-
Object.defineProperty(exports, "generateMulti", { enumerable: true, get: function () { return generate_1.generateMulti; } });
|
|
39
37
|
Object.defineProperty(exports, "expandApiNamesToMultiTarget", { enumerable: true, get: function () { return generate_1.expandApiNamesToMultiTarget; } });
|
|
40
38
|
Object.defineProperty(exports, "expandSchemaDirToMultiTarget", { enumerable: true, get: function () { return generate_1.expandSchemaDirToMultiTarget; } });
|
|
39
|
+
Object.defineProperty(exports, "generate", { enumerable: true, get: function () { return generate_1.generate; } });
|
|
40
|
+
Object.defineProperty(exports, "generateMulti", { enumerable: true, get: function () { return generate_1.generateMulti; } });
|
|
41
41
|
Object.defineProperty(exports, "removeStaleTargetDirs", { enumerable: true, get: function () { return generate_1.removeStaleTargetDirs; } });
|
|
42
42
|
Object.defineProperty(exports, "TARGETS_MANIFEST", { enumerable: true, get: function () { return generate_1.TARGETS_MANIFEST; } });
|
|
43
43
|
// Config utilities
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/graphql-codegen",
|
|
3
|
-
"version": "5.13.
|
|
3
|
+
"version": "5.13.8",
|
|
4
4
|
"description": "GraphQL SDK generator for Constructive databases with React Query hooks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
@@ -56,25 +56,25 @@
|
|
|
56
56
|
"@0no-co/graphql.web": "^1.1.2",
|
|
57
57
|
"@babel/generator": "^7.29.1",
|
|
58
58
|
"@babel/types": "^7.29.0",
|
|
59
|
-
"@constructive-io/graphql-query": "^4.11.
|
|
60
|
-
"@constructive-io/graphql-types": "^3.27.
|
|
59
|
+
"@constructive-io/graphql-query": "^4.11.8",
|
|
60
|
+
"@constructive-io/graphql-types": "^3.27.3",
|
|
61
61
|
"@inquirerer/utils": "^3.3.9",
|
|
62
|
-
"@pgpmjs/core": "^7.21.
|
|
62
|
+
"@pgpmjs/core": "^7.21.3",
|
|
63
63
|
"ajv": "^8.20.0",
|
|
64
64
|
"deepmerge": "^4.3.1",
|
|
65
65
|
"find-and-require-package-json": "^0.9.1",
|
|
66
66
|
"gql-ast": "^3.22.2",
|
|
67
|
-
"graphile-schema": "^2.10.
|
|
67
|
+
"graphile-schema": "^2.10.8",
|
|
68
68
|
"graphql": "16.13.0",
|
|
69
69
|
"inflekt": "^0.7.1",
|
|
70
70
|
"inquirerer": "^4.9.1",
|
|
71
71
|
"jiti": "^2.7.0",
|
|
72
72
|
"oxfmt": "^0.51.0",
|
|
73
|
-
"pg-cache": "^3.24.
|
|
73
|
+
"pg-cache": "^3.24.3",
|
|
74
74
|
"pg-env": "^1.27.2",
|
|
75
|
-
"pgsql-client": "^4.9.
|
|
76
|
-
"pgsql-seed": "^3.9.
|
|
77
|
-
"query-spec": "^0.10.
|
|
75
|
+
"pgsql-client": "^4.9.8",
|
|
76
|
+
"pgsql-seed": "^3.9.8",
|
|
77
|
+
"query-spec": "^0.10.3",
|
|
78
78
|
"undici": "^8.3.0"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"tsx": "^4.21.0",
|
|
102
102
|
"typescript": "^5.9.3"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "c20b6be96b39bf71c0e2df0f4b51e05deacd006b"
|
|
105
105
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type exports for @constructive-io/graphql-codegen
|
|
3
3
|
*/
|
|
4
|
-
export type { BelongsToRelation, Field, FieldType, HasManyRelation, HasOneRelation, ManyToManyRelation, Relations, Table,
|
|
4
|
+
export type { BelongsToRelation, ConstraintInfo, Field, FieldType, ForeignKeyConstraint, HasManyRelation, HasOneRelation, ManyToManyRelation, Relations, Table, TableConstraints, TableInflection, TableQueryNames, } from './schema';
|
|
5
5
|
export type { ConnectionResult, FieldFilter, Filter, FilterOperator, OrderByItem, PageInfo, QueryOptions, RelationalFilter, } from './query';
|
|
6
6
|
export type { CreateInput, DeleteInput, MutationOptions, MutationResult, UpdateInput, } from './mutation';
|
|
7
7
|
export type { FieldSelection, FieldSelectionPreset, SelectionOptions, SimpleFieldSelection, } from './selection';
|