@graphql-codegen/c-sharp-operations 2.3.1-alpha-0814e49cc.0 → 2.3.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/c-sharp-operations",
3
- "version": "2.3.1-alpha-0814e49cc.0",
3
+ "version": "2.3.1",
4
4
  "description": "GraphQL Code Generator plugin for generating CSharp code based on GraphQL operations",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
@@ -8,9 +8,9 @@
8
8
  "graphql-tag": "2.12.6"
9
9
  },
10
10
  "dependencies": {
11
- "@graphql-codegen/plugin-helpers": "^2.6.1-alpha-0814e49cc.0",
12
- "@graphql-codegen/visitor-plugin-common": "^2.12.1-alpha-0814e49cc.0",
13
- "@graphql-codegen/c-sharp-common": "0.1.1-alpha-0814e49cc.0",
11
+ "@graphql-codegen/plugin-helpers": "^2.6.2",
12
+ "@graphql-codegen/visitor-plugin-common": "^2.12.1",
13
+ "@graphql-codegen/c-sharp-common": "0.1.1",
14
14
  "auto-bind": "~4.0.0",
15
15
  "change-case-all": "1.0.14",
16
16
  "tslib": "~2.4.0"
@@ -27,7 +27,7 @@
27
27
  "exports": {
28
28
  ".": {
29
29
  "require": {
30
- "types": "./typings/index.d.ts",
30
+ "types": "./typings/index.d.cts",
31
31
  "default": "./cjs/index.js"
32
32
  },
33
33
  "import": {
@@ -0,0 +1,71 @@
1
+ import { RawClientSideBasePluginConfig } from '@graphql-codegen/visitor-plugin-common';
2
+ /**
3
+ * @description This plugin generates C# `class` based on your GraphQL operations.
4
+ */
5
+ export interface CSharpOperationsRawPluginConfig extends RawClientSideBasePluginConfig {
6
+ /**
7
+ * @default GraphQLCodeGen
8
+ * @description Allow you to customize the namespace name.
9
+ *
10
+ * @exampleMarkdown
11
+ * ```yaml
12
+ * config:
13
+ * namespaceName: MyCompany.MyNamespace
14
+ * ```
15
+ */
16
+ namespaceName?: string;
17
+ /**
18
+ * @description Defined the global value of `namedClient`.
19
+ *
20
+ * @exampleMarkdown
21
+ * ```yaml
22
+ * config:
23
+ * namedClient: 'customName'
24
+ * ```
25
+ */
26
+ namedClient?: string;
27
+ /**
28
+ * @description Allows to define a custom suffix for query operations.
29
+ * @default GQL
30
+ *
31
+ * @exampleMarkdown
32
+ * ```yaml
33
+ * config:
34
+ * querySuffix: 'QueryService'
35
+ * ```
36
+ */
37
+ querySuffix?: string;
38
+ /**
39
+ * @description Allows to define a custom suffix for mutation operations.
40
+ * @default GQL
41
+ *
42
+ * @exampleMarkdown
43
+ * ```yaml
44
+ * config:
45
+ * mutationSuffix: 'MutationService'
46
+ * ```
47
+ */
48
+ mutationSuffix?: string;
49
+ /**
50
+ * @description Allows to define a custom suffix for Subscription operations.
51
+ * @default GQL
52
+ *
53
+ * @exampleMarkdown
54
+ * ```yaml
55
+ * config:
56
+ * subscriptionSuffix: 'SubscriptionService'
57
+ * ```
58
+ */
59
+ subscriptionSuffix?: string;
60
+ /**
61
+ * @description Allows to generate operation methods with class definitions for request/response parameters
62
+ * @default false
63
+ *
64
+ * @exampleMarkdown
65
+ * ```yaml
66
+ * config:
67
+ * typesafeOperation: true
68
+ * ```
69
+ */
70
+ typesafeOperation?: boolean;
71
+ }
@@ -0,0 +1,7 @@
1
+ import { PluginValidateFn, PluginFunction } from '@graphql-codegen/plugin-helpers';
2
+ import { CSharpOperationsVisitor } from './visitor.cjs';
3
+ import { CSharpOperationsRawPluginConfig } from './config.cjs';
4
+ export declare const plugin: PluginFunction<CSharpOperationsRawPluginConfig>;
5
+ export declare const addToSchema: import("graphql").DocumentNode;
6
+ export declare const validate: PluginValidateFn<any>;
7
+ export { CSharpOperationsVisitor };
@@ -0,0 +1,36 @@
1
+ import { ClientSideBaseVisitor, ClientSideBasePluginConfig, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
2
+ import { OperationDefinitionNode, GraphQLSchema, TypeNode, InputObjectTypeDefinitionNode, EnumTypeDefinitionNode } from 'graphql';
3
+ import { CSharpOperationsRawPluginConfig } from './config.cjs';
4
+ import { Types } from '@graphql-codegen/plugin-helpers';
5
+ import { CSharpFieldType } from '@graphql-codegen/c-sharp-common';
6
+ export interface CSharpOperationsPluginConfig extends ClientSideBasePluginConfig {
7
+ namespaceName: string;
8
+ namedClient: string;
9
+ querySuffix: string;
10
+ mutationSuffix: string;
11
+ subscriptionSuffix: string;
12
+ typesafeOperation: boolean;
13
+ }
14
+ export declare class CSharpOperationsVisitor extends ClientSideBaseVisitor<CSharpOperationsRawPluginConfig, CSharpOperationsPluginConfig> {
15
+ private _operationsToInclude;
16
+ private _schemaAST;
17
+ constructor(schema: GraphQLSchema, fragments: LoadedFragment[], rawConfig: CSharpOperationsRawPluginConfig, documents?: Types.DocumentFile[]);
18
+ private overruleConfigSettings;
19
+ private _operationHasDirective;
20
+ private _extractDirective;
21
+ private _namedClient;
22
+ private _extractNamedClient;
23
+ protected _gql(node: OperationDefinitionNode): string;
24
+ private _getDocumentNodeVariable;
25
+ private _gqlInputSignature;
26
+ getCSharpImports(): string;
27
+ private _operationSuffix;
28
+ protected resolveFieldType(typeNode: TypeNode, hasDefaultValue?: Boolean): CSharpFieldType;
29
+ private _getResponseFieldRecursive;
30
+ private _getResponseClass;
31
+ private _getVariablesClass;
32
+ private _getOperationMethod;
33
+ OperationDefinition(node: OperationDefinitionNode): string;
34
+ InputObjectTypeDefinition(node: InputObjectTypeDefinitionNode): string;
35
+ EnumTypeDefinition(node: EnumTypeDefinitionNode): string;
36
+ }