@graphql-codegen/typescript-stencil-apollo 2.3.3-alpha-0814e49cc.0 → 2.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 +29 -0
- package/typings/index.d.cts +6 -0
- package/typings/visitor.d.cts +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-stencil-apollo",
|
|
3
|
-
"version": "2.3.3
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating Stencil Components 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",
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"stencil-apollo": "^0.1.3"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@graphql-codegen/plugin-helpers": "^2.6.
|
|
12
|
-
"@graphql-codegen/visitor-plugin-common": "2.12.1
|
|
11
|
+
"@graphql-codegen/plugin-helpers": "^2.6.2",
|
|
12
|
+
"@graphql-codegen/visitor-plugin-common": "2.12.1",
|
|
13
13
|
"auto-bind": "~4.0.0",
|
|
14
14
|
"change-case-all": "1.0.14",
|
|
15
15
|
"tslib": "~2.4.0"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"exports": {
|
|
31
31
|
".": {
|
|
32
32
|
"require": {
|
|
33
|
-
"types": "./typings/index.d.
|
|
33
|
+
"types": "./typings/index.d.cts",
|
|
34
34
|
"default": "./cjs/index.js"
|
|
35
35
|
},
|
|
36
36
|
"import": {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { RawClientSideBasePluginConfig } from '@graphql-codegen/visitor-plugin-common';
|
|
2
|
+
/**
|
|
3
|
+
* @description This plugin generates Stencil Apollo functional components typings
|
|
4
|
+
*
|
|
5
|
+
* It extends the basic TypeScript plugins: `@graphql-codegen/typescript`, `@graphql-codegen/typescript-operations` - and thus shares a similar configuration.
|
|
6
|
+
*/
|
|
7
|
+
export interface StencilApolloRawPluginConfig extends RawClientSideBasePluginConfig {
|
|
8
|
+
/**
|
|
9
|
+
* @description Customize the output of the plugin - you can choose to generate a Component class or a function component.
|
|
10
|
+
* @default functional
|
|
11
|
+
*
|
|
12
|
+
* @exampleMarkdown
|
|
13
|
+
* ```yaml
|
|
14
|
+
* generates:
|
|
15
|
+
* path/to/file.ts:
|
|
16
|
+
* plugins:
|
|
17
|
+
* - typescript
|
|
18
|
+
* - typescript-operations
|
|
19
|
+
* - typescript-stencil-apollo
|
|
20
|
+
* config:
|
|
21
|
+
* componentType: class
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
componentType?: StencilComponentType;
|
|
25
|
+
}
|
|
26
|
+
export declare enum StencilComponentType {
|
|
27
|
+
functional = "functional",
|
|
28
|
+
class = "class"
|
|
29
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PluginValidateFn, PluginFunction } from '@graphql-codegen/plugin-helpers';
|
|
2
|
+
import { StencilApolloVisitor } from './visitor.cjs';
|
|
3
|
+
import { StencilApolloRawPluginConfig } from './config.cjs';
|
|
4
|
+
export declare const plugin: PluginFunction<StencilApolloRawPluginConfig>;
|
|
5
|
+
export declare const validate: PluginValidateFn<any>;
|
|
6
|
+
export { StencilApolloVisitor };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ClientSideBaseVisitor, ClientSideBasePluginConfig, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
|
|
2
|
+
import { StencilComponentType, StencilApolloRawPluginConfig } from './config.cjs';
|
|
3
|
+
import { OperationDefinitionNode, GraphQLSchema } from 'graphql';
|
|
4
|
+
export interface StencilApolloPluginConfig extends ClientSideBasePluginConfig {
|
|
5
|
+
componentType: StencilComponentType;
|
|
6
|
+
}
|
|
7
|
+
export declare class StencilApolloVisitor extends ClientSideBaseVisitor<StencilApolloRawPluginConfig, StencilApolloPluginConfig> {
|
|
8
|
+
constructor(schema: GraphQLSchema, fragments: LoadedFragment[], rawConfig: StencilApolloRawPluginConfig);
|
|
9
|
+
getImports(): string[];
|
|
10
|
+
private _buildOperationFunctionalComponent;
|
|
11
|
+
private _buildClassComponent;
|
|
12
|
+
protected buildOperation(node: OperationDefinitionNode, documentVariableName: string, operationType: string, operationResultType: string, operationVariablesTypes: string): string;
|
|
13
|
+
}
|