Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions graphql/codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,29 @@
"main": "index.js",
"module": "index.mjs",
"types": "index.d.ts",
"exports": {
".": {
"import": "./esm/index.js",
"require": "./index.js",
"types": "./index.d.ts"
},
"./orm": {
"import": "./esm/core/codegen/orm/index.js",
"require": "./core/codegen/orm/index.js",
"types": "./core/codegen/orm/index.d.ts"
},
"./cli": {
"import": "./esm/core/codegen/cli/index.js",
"require": "./core/codegen/cli/index.js",
"types": "./core/codegen/cli/index.d.ts"
}
},
"typesVersions": {
"*": {
"orm": ["core/codegen/orm/index.d.ts"],
"cli": ["core/codegen/cli/index.d.ts"]
}
},
"bin": {
"graphql-codegen": "cli/index.js"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ import type {
GraphQLAdapter,
GraphQLError,
QueryResult,
} from '@constructive-io/graphql-types';
} from '@constructive-io/graphql-query/runtime';

export type {
GraphQLAdapter,
GraphQLError,
QueryResult,
} from '@constructive-io/graphql-types';
} from '@constructive-io/graphql-query/runtime';

/**
* Default adapter that uses fetch for HTTP requests.
Expand Down
4 changes: 2 additions & 2 deletions graphql/codegen/src/core/codegen/templates/orm-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import type {
GraphQLAdapter,
GraphQLError,
QueryResult,
} from '@constructive-io/graphql-types';
} from '@constructive-io/graphql-query/runtime';

export type {
GraphQLAdapter,
GraphQLError,
QueryResult,
} from '@constructive-io/graphql-types';
} from '@constructive-io/graphql-query/runtime';

/**
* Default adapter that uses fetch for HTTP requests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Any changes here will affect all generated ORM clients.
*/

import { parseType, print } from '@0no-co/graphql.web';
import { parseType, print } from '@constructive-io/graphql-query/runtime';
import * as t from 'gql-ast';
import type {
ArgumentNode,
Expand Down
141 changes: 0 additions & 141 deletions graphql/orm-test/__tests__/helpers/codegen-helper.ts

This file was deleted.

2 changes: 1 addition & 1 deletion graphql/orm-test/__tests__/mega-query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { join } from 'path';
import { getConnectionsObject, seed } from 'graphile-test';
import type { GraphQLQueryFnObj, GraphQLResponse } from 'graphile-test';
import { ConstructivePreset } from 'graphile-settings';
import { runCodegenAndLoad } from './helpers/codegen-helper';
import { runCodegenAndLoad } from '@constructive-io/graphql-test';
import { GraphileTestAdapter } from './helpers/graphile-adapter';

jest.setTimeout(120000);
Expand Down
2 changes: 1 addition & 1 deletion graphql/orm-test/__tests__/orm-m2n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { getConnectionsObject, seed } from 'graphile-test';
import type { GraphQLQueryFnObj } from 'graphile-test';
import type { PgTestClient } from 'pgsql-test';
import { ConstructivePreset } from 'graphile-settings';
import { runCodegenAndLoad } from './helpers/codegen-helper';
import { runCodegenAndLoad } from '@constructive-io/graphql-test';
import { GraphileTestAdapter } from './helpers/graphile-adapter';

jest.setTimeout(120000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { join } from 'path';
import { getConnectionsObject, seed } from 'graphile-test';
import type { GraphQLQueryFnObj } from 'graphile-test';
import { ConstructivePreset } from 'graphile-settings';
import { runCodegenAndLoad } from './helpers/codegen-helper';
import { runCodegenAndLoad } from '@constructive-io/graphql-test';
import { GraphileTestAdapter } from './helpers/graphile-adapter';

jest.setTimeout(120000);
Expand Down
2 changes: 1 addition & 1 deletion graphql/orm-test/__tests__/postgis-spatial.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { join } from 'path';
import { getConnectionsObject, seed } from 'graphile-test';
import type { GraphQLQueryFnObj } from 'graphile-test';
import { ConstructivePreset } from 'graphile-settings';
import { runCodegenAndLoad } from './helpers/codegen-helper';
import { runCodegenAndLoad } from '@constructive-io/graphql-test';
import { GraphileTestAdapter } from './helpers/graphile-adapter';

jest.setTimeout(120000);
Expand Down
1 change: 1 addition & 0 deletions graphql/orm-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@0no-co/graphql.web": "^1.1.2",
"@constructive-io/graphql-codegen": "workspace:^",
"@constructive-io/graphql-query": "workspace:^",
"@constructive-io/graphql-test": "workspace:^",
"@constructive-io/graphql-types": "workspace:^",
"@types/pg": "^8.18.0",
"gql-ast": "workspace:^",
Expand Down
14 changes: 14 additions & 0 deletions graphql/query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
"main": "index.js",
"module": "esm/index.js",
"types": "index.d.ts",
"exports": {
".": {
"import": "./esm/index.js",
"require": "./index.js",
"types": "./index.d.ts"
},
"./runtime": {
"import": "./esm/runtime/index.js",
"require": "./runtime/index.js",
"types": "./runtime/index.d.ts"
}
},
"homepage": "https://github.com/constructive-io/constructive",
"license": "MIT",
"publishConfig": {
Expand All @@ -29,6 +41,8 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@0no-co/graphql.web": "^1.1.2",
"@constructive-io/graphql-types": "workspace:^",
"ajv": "^8.18.0",
"gql-ast": "workspace:^",
"grafast": "1.0.0",
Expand Down
23 changes: 23 additions & 0 deletions graphql/query/src/runtime/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Runtime sub-export for generated ORM code.
*
* Generated ORM clients need runtime dependencies at execution time.
* This module re-exports two of the three so generated code can consolidate imports:
* - @0no-co/graphql.web — parseType, print
* - @constructive-io/graphql-types — GraphQLAdapter, GraphQLError, QueryResult
*
* gql-ast is intentionally NOT re-exported here because the templates
* use `import * as t from 'gql-ast'` — mixing it into this namespace
* would pollute `t` with unrelated symbols like parseType and print.
*
* Usage in generated templates:
* import { parseType, print } from '@constructive-io/graphql-query/runtime';
* import * as t from 'gql-ast';
* import type { GraphQLAdapter } from '@constructive-io/graphql-query/runtime';
*/

// From @0no-co/graphql.web — GraphQL parsing/printing
export { parseType, print } from '@0no-co/graphql.web';

// From @constructive-io/graphql-types — adapter interface + result types
export type { GraphQLAdapter, GraphQLError, QueryResult } from '@constructive-io/graphql-types';
5 changes: 3 additions & 2 deletions graphql/server-test/__tests__/cli-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import * as ts from 'typescript';
import { getConnections, seed } from '../src';
import type { ServerInfo } from '../src/types';
import type { Table } from '@constructive-io/graphql-codegen';
import { generateCli } from '@constructive-io/graphql-codegen/core/codegen/cli';
import { generateOrm } from '@constructive-io/graphql-codegen/core/codegen/orm';
import { generateCli } from '@constructive-io/graphql-codegen/cli';
import { generateOrm } from '@constructive-io/graphql-codegen/orm';

jest.setTimeout(120000);

Expand All @@ -53,6 +53,7 @@ function resolveNodePaths(): string[] {
'nested-obj',
'graphql',
'@constructive-io/graphql-types',
'@constructive-io/graphql-query',
'@agentic-kit/ollama',
];
const dirs = new Set<string>();
Expand Down
1 change: 1 addition & 0 deletions graphql/server-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@0no-co/graphql.web": "^1.2.0",
"@agentic-kit/ollama": "^1.0.3",
"@constructive-io/graphql-codegen": "workspace:^",
"@constructive-io/graphql-query": "workspace:^",
"@types/express": "^5.0.6",
"@types/pg": "^8.18.0",
"@types/supertest": "^7.2.0",
Expand Down
5 changes: 4 additions & 1 deletion graphql/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
"makage": "^0.3.0"
},
"dependencies": {
"@constructive-io/graphql-codegen": "workspace:^",
"@constructive-io/graphql-env": "workspace:^",
"@constructive-io/graphql-query": "workspace:^",
"@constructive-io/graphql-types": "workspace:^",
"@pgpmjs/types": "workspace:^",
"grafast": "1.0.0",
Expand All @@ -47,7 +49,8 @@
"mock-req": "^0.2.0",
"pg": "^8.20.0",
"pgsql-test": "workspace:^",
"postgraphile": "5.0.0"
"postgraphile": "5.0.0",
"typescript": "^5.0.0"
},
"keywords": [
"testing",
Expand Down
Loading
Loading