@graphql-codegen/typescript-apollo-client-helpers 2.2.6 → 3.0.0-alpha-20230524083052-08ce957b4
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/cjs/config.js +0 -2
- package/cjs/index.js +4 -2
- package/esm/config.js +0 -1
- package/esm/index.js +4 -2
- package/package.json +7 -4
- package/typings/config.d.cts +1 -1
- package/typings/config.d.ts +1 -1
- package/typings/index.d.cts +1 -1
- package/typings/index.d.ts +1 -1
package/cjs/config.js
CHANGED
package/cjs/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validate = exports.plugin = void 0;
|
|
4
|
-
const graphql_1 = require("graphql");
|
|
5
4
|
const path_1 = require("path");
|
|
5
|
+
const graphql_1 = require("graphql");
|
|
6
6
|
const plugin = (schema, documents, config) => {
|
|
7
7
|
const results = [];
|
|
8
8
|
results.push(generateTypePoliciesSignature(schema, config));
|
|
@@ -27,7 +27,9 @@ function generateTypePoliciesSignature(schema, config) {
|
|
|
27
27
|
.map(f => `'${f}'`)
|
|
28
28
|
.join(' | ')} | ${keySpecifierVarName})[];`);
|
|
29
29
|
perTypePolicies.push(`export type ${fieldPolicyVarName} = {
|
|
30
|
-
${fieldsNames
|
|
30
|
+
${fieldsNames
|
|
31
|
+
.map(fieldName => `\t${fieldName}?: FieldPolicy<any> | FieldReadFunction<any>`)
|
|
32
|
+
.join(',\n')}
|
|
31
33
|
};`);
|
|
32
34
|
return {
|
|
33
35
|
...prev,
|
package/esm/config.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isInterfaceType, isObjectType } from 'graphql';
|
|
2
1
|
import { extname } from 'path';
|
|
2
|
+
import { isInterfaceType, isObjectType } from 'graphql';
|
|
3
3
|
export const plugin = (schema, documents, config) => {
|
|
4
4
|
const results = [];
|
|
5
5
|
results.push(generateTypePoliciesSignature(schema, config));
|
|
@@ -23,7 +23,9 @@ function generateTypePoliciesSignature(schema, config) {
|
|
|
23
23
|
.map(f => `'${f}'`)
|
|
24
24
|
.join(' | ')} | ${keySpecifierVarName})[];`);
|
|
25
25
|
perTypePolicies.push(`export type ${fieldPolicyVarName} = {
|
|
26
|
-
${fieldsNames
|
|
26
|
+
${fieldsNames
|
|
27
|
+
.map(fieldName => `\t${fieldName}?: FieldPolicy<any> | FieldReadFunction<any>`)
|
|
28
|
+
.join(',\n')}
|
|
27
29
|
};`);
|
|
28
30
|
return {
|
|
29
31
|
...prev,
|
package/package.json
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-apollo-client-helpers",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha-20230524083052-08ce957b4",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating TypeScript helpers for Apollo Client > 3",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"
|
|
10
|
-
"@graphql-codegen/plugin-helpers": "^2.7.2",
|
|
9
|
+
"@graphql-codegen/plugin-helpers": "^3.0.0",
|
|
11
10
|
"@graphql-codegen/visitor-plugin-common": "2.13.1",
|
|
12
11
|
"auto-bind": "~4.0.0",
|
|
12
|
+
"change-case-all": "1.0.15",
|
|
13
13
|
"tslib": "~2.4.0"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/dotansimha/graphql-code-generator.git",
|
|
17
|
+
"url": "https://github.com/dotansimha/graphql-code-generator-community.git",
|
|
18
18
|
"directory": "packages/plugins/typescript/apollo-client-helpers"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">= 16.0.0"
|
|
23
|
+
},
|
|
21
24
|
"main": "cjs/index.js",
|
|
22
25
|
"module": "esm/index.js",
|
|
23
26
|
"typings": "typings/index.d.ts",
|
package/typings/config.d.cts
CHANGED
package/typings/config.d.ts
CHANGED
package/typings/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PluginFunction, PluginValidateFn } from '@graphql-codegen/plugin-helpers';
|
|
2
2
|
import { ApolloClientHelpersConfig } from './config.cjs';
|
|
3
3
|
export declare const plugin: PluginFunction<ApolloClientHelpersConfig>;
|
|
4
4
|
export declare const validate: PluginValidateFn<ApolloClientHelpersConfig>;
|
package/typings/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PluginFunction, PluginValidateFn } from '@graphql-codegen/plugin-helpers';
|
|
2
2
|
import { ApolloClientHelpersConfig } from './config.js';
|
|
3
3
|
export declare const plugin: PluginFunction<ApolloClientHelpersConfig>;
|
|
4
4
|
export declare const validate: PluginValidateFn<ApolloClientHelpersConfig>;
|