@constructive-io/graphql-codegen 2.17.11

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/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './gql';
2
+ export * from './codegen';
3
+ export * from './options';
package/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./gql"), exports);
18
+ __exportStar(require("./codegen"), exports);
19
+ __exportStar(require("./options"), exports);
package/options.d.ts ADDED
@@ -0,0 +1,37 @@
1
+ export type DocumentFormat = 'gql' | 'ts';
2
+ export type FilenameConvention = 'underscore' | 'dashed' | 'camelcase' | 'camelUpper';
3
+ export interface GraphQLCodegenOptions {
4
+ input: {
5
+ schema: string;
6
+ endpoint?: string;
7
+ headers?: Record<string, string>;
8
+ };
9
+ output: {
10
+ root: string;
11
+ typesFile: string;
12
+ operationsDir: string;
13
+ sdkFile: string;
14
+ reactQueryFile?: string;
15
+ };
16
+ documents: {
17
+ format: DocumentFormat;
18
+ convention: FilenameConvention;
19
+ allowQueries?: string[];
20
+ excludeQueries?: string[];
21
+ excludePatterns?: string[];
22
+ };
23
+ features: {
24
+ emitTypes: boolean;
25
+ emitOperations: boolean;
26
+ emitSdk: boolean;
27
+ emitReactQuery?: boolean;
28
+ };
29
+ reactQuery?: {
30
+ fetcher?: 'fetch' | 'graphql-request' | 'hardcoded' | string;
31
+ legacyMode?: boolean;
32
+ exposeDocument?: boolean;
33
+ addInfiniteQuery?: boolean;
34
+ };
35
+ }
36
+ export declare const defaultGraphQLCodegenOptions: GraphQLCodegenOptions;
37
+ export declare function mergeGraphQLCodegenOptions(base: GraphQLCodegenOptions, overrides: Partial<GraphQLCodegenOptions>): GraphQLCodegenOptions;
package/options.js ADDED
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defaultGraphQLCodegenOptions = void 0;
4
+ exports.mergeGraphQLCodegenOptions = mergeGraphQLCodegenOptions;
5
+ exports.defaultGraphQLCodegenOptions = {
6
+ input: { schema: '', endpoint: '', headers: {} },
7
+ output: {
8
+ root: 'graphql/codegen/dist',
9
+ typesFile: 'types/generated.ts',
10
+ operationsDir: 'operations',
11
+ sdkFile: 'sdk.ts',
12
+ reactQueryFile: 'react-query.ts'
13
+ },
14
+ documents: { format: 'gql', convention: 'dashed', allowQueries: [], excludeQueries: [], excludePatterns: [] },
15
+ features: { emitTypes: true, emitOperations: true, emitSdk: true, emitReactQuery: true },
16
+ reactQuery: { fetcher: 'graphql-request', legacyMode: false, exposeDocument: false, addInfiniteQuery: false }
17
+ };
18
+ function mergeGraphQLCodegenOptions(base, overrides) {
19
+ return {
20
+ input: { ...(base.input || {}), ...(overrides.input || {}) },
21
+ output: { ...(base.output || {}), ...(overrides.output || {}) },
22
+ documents: { ...(base.documents || {}), ...(overrides.documents || {}) },
23
+ features: { ...(base.features || {}), ...(overrides.features || {}) }
24
+ };
25
+ }
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@constructive-io/graphql-codegen",
3
+ "version": "2.17.11",
4
+ "description": "Generate queries and mutations for use with Graphile",
5
+ "author": "Constructive <developers@constructive.io>",
6
+ "main": "index.js",
7
+ "module": "esm/index.js",
8
+ "types": "index.d.ts",
9
+ "homepage": "https://github.com/constructive-io/constructive",
10
+ "license": "MIT",
11
+ "publishConfig": {
12
+ "access": "public",
13
+ "directory": "dist"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/constructive-io/constructive"
18
+ },
19
+ "bugs": {
20
+ "url": "https://github.com/constructive-io/constructive/issues"
21
+ },
22
+ "scripts": {
23
+ "clean": "makage clean",
24
+ "prepack": "npm run build",
25
+ "build": "makage build",
26
+ "build:dev": "makage build --dev",
27
+ "lint": "eslint . --fix",
28
+ "test": "jest --passWithNoTests",
29
+ "test:watch": "jest --watch"
30
+ },
31
+ "devDependencies": {
32
+ "@constructive-io/graphql-test": "^2.11.5",
33
+ "@types/babel__generator": "^7.27.0",
34
+ "@types/pluralize": "0.0.33",
35
+ "makage": "^0.1.8"
36
+ },
37
+ "dependencies": {
38
+ "@babel/generator": "^7.26.3",
39
+ "@babel/parser": "^7.28.5",
40
+ "@babel/types": "^7.26.3",
41
+ "@graphql-codegen/core": "5.0.0",
42
+ "@graphql-codegen/typescript": "5.0.5",
43
+ "@graphql-codegen/typescript-graphql-request": "6.0.1",
44
+ "@graphql-codegen/typescript-operations": "5.0.5",
45
+ "@graphql-codegen/typescript-react-query": "6.1.1",
46
+ "gql-ast": "^2.4.3",
47
+ "graphql": "15.10.1",
48
+ "graphql-request": "6.1.0",
49
+ "graphql-tag": "2.12.6",
50
+ "inflection": "^1.12.0",
51
+ "introspectron": "^2.14.10",
52
+ "pluralize": "^8.0.0"
53
+ },
54
+ "keywords": [
55
+ "graphql",
56
+ "codegen",
57
+ "generator",
58
+ "graphile",
59
+ "constructive"
60
+ ],
61
+ "gitHead": "22cfe32e994e26a6490e04e28bab26d1e7e6345c"
62
+ }