@graphql-codegen/typescript-vue-apollo 3.3.3-alpha-0814e49cc.0 → 3.3.3
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/package.json +4 -4
- package/typings/config.d.cts +78 -0
- package/typings/index.d.cts +6 -0
- package/typings/visitor.d.cts +25 -0
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-vue-apollo",
|
|
3
|
-
"version": "3.3.3
|
|
3
|
+
"version": "3.3.3",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating ready-to-use Vue-Apollo composition functions based on GraphQL operations",
|
|
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
|
"graphql-tag": "^2.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@graphql-codegen/plugin-helpers": "^2.6.
|
|
11
|
-
"@graphql-codegen/visitor-plugin-common": "2.12.1
|
|
10
|
+
"@graphql-codegen/plugin-helpers": "^2.6.2",
|
|
11
|
+
"@graphql-codegen/visitor-plugin-common": "2.12.1",
|
|
12
12
|
"auto-bind": "~4.0.0",
|
|
13
13
|
"change-case-all": "1.0.14",
|
|
14
14
|
"tslib": "~2.4.0"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
31
31
|
"require": {
|
|
32
|
-
"types": "./typings/index.d.
|
|
32
|
+
"types": "./typings/index.d.cts",
|
|
33
33
|
"default": "./cjs/index.js"
|
|
34
34
|
},
|
|
35
35
|
"import": {
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { RawClientSideBasePluginConfig } from '@graphql-codegen/visitor-plugin-common';
|
|
2
|
+
/**
|
|
3
|
+
* @description This plugin generates @vue/apollo-composable composition functions with TypeScript typings.
|
|
4
|
+
*
|
|
5
|
+
* It extends the basic TypeScript plugins: `@graphql-codegen/typescript`, `@graphql-codegen/typescript-operations` - and thus shares a similar configuration.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export interface VueApolloRawPluginConfig extends RawClientSideBasePluginConfig {
|
|
9
|
+
/**
|
|
10
|
+
* @description Customized the output by enabling/disabling the generated Vue composition functions.
|
|
11
|
+
* @default true
|
|
12
|
+
*
|
|
13
|
+
* @exampleMarkdown
|
|
14
|
+
* ```yaml
|
|
15
|
+
* generates:
|
|
16
|
+
* path/to/file.ts:
|
|
17
|
+
* plugins:
|
|
18
|
+
* - typescript
|
|
19
|
+
* - typescript-operations
|
|
20
|
+
* - typescript-vue-apollo
|
|
21
|
+
* config:
|
|
22
|
+
* withCompositionFunctions: true
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
withCompositionFunctions?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* @name vueApolloComposableImportFrom
|
|
28
|
+
* @default @vue/apollo-composable
|
|
29
|
+
*
|
|
30
|
+
* @exampleMarkdown
|
|
31
|
+
* ```yaml
|
|
32
|
+
* generates:
|
|
33
|
+
* path/to/file.ts:
|
|
34
|
+
* plugins:
|
|
35
|
+
* - typescript
|
|
36
|
+
* - typescript-operations
|
|
37
|
+
* - typescript-vue-apollo
|
|
38
|
+
* config:
|
|
39
|
+
* vueApolloComposableImportFrom: vue
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
vueApolloComposableImportFrom?: 'vue' | '@vue/apollo-composable' | string;
|
|
43
|
+
/**
|
|
44
|
+
* @name vueCompositionApiImportFrom
|
|
45
|
+
* @default @vue/composition-api
|
|
46
|
+
*
|
|
47
|
+
* @exampleMarkdown
|
|
48
|
+
* ```yaml
|
|
49
|
+
* generates:
|
|
50
|
+
* path/to/file.ts:
|
|
51
|
+
* plugins:
|
|
52
|
+
* - typescript
|
|
53
|
+
* - typescript-operations
|
|
54
|
+
* - typescript-vue-apollo
|
|
55
|
+
* config:
|
|
56
|
+
* vueCompositionApiImportFrom: vue
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
vueCompositionApiImportFrom?: 'vue' | '@vue/composition-api' | string;
|
|
60
|
+
/**
|
|
61
|
+
* @description Allows you to enable/disable the generation of docblocks in generated code.
|
|
62
|
+
* Some IDE's (like VSCode) add extra inline information with docblocks, you can disable this feature if your preferred IDE does not.
|
|
63
|
+
* @default true
|
|
64
|
+
*
|
|
65
|
+
* @exampleMarkdown
|
|
66
|
+
* ```yaml
|
|
67
|
+
* generates:
|
|
68
|
+
* path/to/file.ts:
|
|
69
|
+
* plugins:
|
|
70
|
+
* - typescript
|
|
71
|
+
* - typescript-operations
|
|
72
|
+
* - typescript-vue-apollo
|
|
73
|
+
* config:
|
|
74
|
+
* addDocBlocks: true
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
addDocBlocks?: boolean;
|
|
78
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Types, PluginValidateFn, PluginFunction } from '@graphql-codegen/plugin-helpers';
|
|
2
|
+
import { VueApolloVisitor } from './visitor.cjs';
|
|
3
|
+
import { VueApolloRawPluginConfig } from './config.cjs';
|
|
4
|
+
export declare const plugin: PluginFunction<VueApolloRawPluginConfig, Types.ComplexPluginOutput>;
|
|
5
|
+
export declare const validate: PluginValidateFn<any>;
|
|
6
|
+
export { VueApolloVisitor };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ClientSideBaseVisitor, ClientSideBasePluginConfig, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
|
|
2
|
+
import { VueApolloRawPluginConfig } from './config.cjs';
|
|
3
|
+
import { OperationDefinitionNode, GraphQLSchema } from 'graphql';
|
|
4
|
+
import { Types } from '@graphql-codegen/plugin-helpers';
|
|
5
|
+
export interface VueApolloPluginConfig extends ClientSideBasePluginConfig {
|
|
6
|
+
withCompositionFunctions: boolean;
|
|
7
|
+
vueApolloComposableImportFrom: 'vue' | '@vue/apollo-composable' | string;
|
|
8
|
+
vueCompositionApiImportFrom: 'vue' | '@vue/apollo-composable' | string;
|
|
9
|
+
addDocBlocks: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class VueApolloVisitor extends ClientSideBaseVisitor<VueApolloRawPluginConfig, VueApolloPluginConfig> {
|
|
12
|
+
private externalImportPrefix;
|
|
13
|
+
private imports;
|
|
14
|
+
constructor(schema: GraphQLSchema, fragments: LoadedFragment[], rawConfig: VueApolloRawPluginConfig, documents: Types.DocumentFile[]);
|
|
15
|
+
private get vueApolloComposableImport();
|
|
16
|
+
private get vueCompositionApiImport();
|
|
17
|
+
private get reactiveFunctionType();
|
|
18
|
+
private getDocumentNodeVariable;
|
|
19
|
+
getImports(): string[];
|
|
20
|
+
private buildCompositionFunctionsJSDoc;
|
|
21
|
+
private getCompositionFunctionSuffix;
|
|
22
|
+
protected buildOperation(node: OperationDefinitionNode, documentVariableName: string, operationType: 'Query' | 'Mutation' | 'Subscription', operationResultType: string, operationVariablesTypes: string): string;
|
|
23
|
+
private buildCompositionFunction;
|
|
24
|
+
private buildCompositionFunctionReturnType;
|
|
25
|
+
}
|