@graphql-codegen/typescript-resolvers 5.0.0-alpha-20250816104654-3cefeabda1bcfa915d43b4515cb86dd2dfb9df5b → 5.0.0-alpha-20250827103001-1f42d2b3d7d1c009e2fc2ed9b513fdda20e78b50
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/index.js +7 -6
- package/esm/index.js +7 -6
- package/package.json +5 -5
package/cjs/index.js
CHANGED
|
@@ -43,6 +43,7 @@ const plugin = async (schema, documents, config) => {
|
|
|
43
43
|
].join('\n')
|
|
44
44
|
: '';
|
|
45
45
|
const importType = config.useTypeImports ? 'import type' : 'import';
|
|
46
|
+
const emptyObjectType = `Record<PropertyKey, never>`;
|
|
46
47
|
const prepend = [];
|
|
47
48
|
const defsToInclude = [];
|
|
48
49
|
const directiveResolverMappings = {};
|
|
@@ -58,7 +59,7 @@ export type Resolver${capitalizedDirectiveName}WithResolve<TResult, TParent, TCo
|
|
|
58
59
|
resolve: ${resolverFnName}<TResult, TParent, TContext, TArgs>;
|
|
59
60
|
};`;
|
|
60
61
|
const resolverTypeName = `Resolver${capitalizedDirectiveName}`;
|
|
61
|
-
const resolverType = `export type ${resolverTypeName}<TResult, TParent = {}, TContext = {}, TArgs = {}> =`;
|
|
62
|
+
const resolverType = `export type ${resolverTypeName}<TResult, TParent = ${emptyObjectType}, TContext = ${emptyObjectType}, TArgs = ${emptyObjectType}> =`;
|
|
62
63
|
if (parsedMapper.isExternal) {
|
|
63
64
|
if (parsedMapper.default) {
|
|
64
65
|
prepend.push(`${importType} ${resolverFnName} from '${parsedMapper.source}';`);
|
|
@@ -107,7 +108,7 @@ export type NewStitchingResolver<TResult, TParent, TContext, TArgs> = {
|
|
|
107
108
|
export type ResolverWithResolve<TResult, TParent, TContext, TArgs> = {
|
|
108
109
|
resolve: ResolverFn<TResult, TParent, TContext, TArgs>;
|
|
109
110
|
};`;
|
|
110
|
-
const resolverType = `export type Resolver<TResult, TParent = {}, TContext = {}, TArgs = {}> =`;
|
|
111
|
+
const resolverType = `export type Resolver<TResult, TParent = ${emptyObjectType}, TContext = ${emptyObjectType}, TArgs = ${emptyObjectType}> =`;
|
|
111
112
|
const resolverFnUsage = `ResolverFn<TResult, TParent, TContext, TArgs>`;
|
|
112
113
|
const resolverWithResolveUsage = `ResolverWithResolve<TResult, TParent, TContext, TArgs>`;
|
|
113
114
|
const stitchingResolverUsage = `StitchingResolver<TResult, TParent, TContext, TArgs>`;
|
|
@@ -210,21 +211,21 @@ export type SubscriptionObject<TResult, TKey extends string, TParent, TContext,
|
|
|
210
211
|
| SubscriptionSubscriberObject<TResult, TKey, TParent, TContext, TArgs>
|
|
211
212
|
| SubscriptionResolverObject<TResult, TParent, TContext, TArgs>;
|
|
212
213
|
|
|
213
|
-
export type SubscriptionResolver<TResult, TKey extends string, TParent = {}, TContext = {}, TArgs = {}> =
|
|
214
|
+
export type SubscriptionResolver<TResult, TKey extends string, TParent = ${emptyObjectType}, TContext = ${emptyObjectType}, TArgs = ${emptyObjectType}> =
|
|
214
215
|
| ((...args: any[]) => SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>)
|
|
215
216
|
| SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>;
|
|
216
217
|
|
|
217
|
-
export type TypeResolveFn<TTypes, TParent = {}, TContext = {}> = (
|
|
218
|
+
export type TypeResolveFn<TTypes, TParent = ${emptyObjectType}, TContext = ${emptyObjectType}> = (
|
|
218
219
|
parent: TParent,
|
|
219
220
|
context: TContext,
|
|
220
221
|
info${optionalSignForInfoArg}: GraphQLResolveInfo
|
|
221
222
|
) => ${namespacedImportPrefix}Maybe<TTypes> | Promise<${namespacedImportPrefix}Maybe<TTypes>>;
|
|
222
223
|
|
|
223
|
-
export type IsTypeOfResolverFn<T = {}, TContext = {}> = (obj: T, context: TContext, info${optionalSignForInfoArg}: GraphQLResolveInfo) => boolean | Promise<boolean>;
|
|
224
|
+
export type IsTypeOfResolverFn<T = ${emptyObjectType}, TContext = ${emptyObjectType}> = (obj: T, context: TContext, info${optionalSignForInfoArg}: GraphQLResolveInfo) => boolean | Promise<boolean>;
|
|
224
225
|
|
|
225
226
|
export type NextResolverFn<T> = () => Promise<T>;
|
|
226
227
|
|
|
227
|
-
export type DirectiveResolverFn<TResult = {}, TParent = {}, TContext = {}, TArgs = {}> = (
|
|
228
|
+
export type DirectiveResolverFn<TResult = ${emptyObjectType}, TParent = ${emptyObjectType}, TContext = ${emptyObjectType}, TArgs = ${emptyObjectType}> = (
|
|
228
229
|
next: NextResolverFn<TResult>,
|
|
229
230
|
parent: TParent,
|
|
230
231
|
args: TArgs,
|
package/esm/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export const plugin = async (schema, documents, config) => {
|
|
|
16
16
|
].join('\n')
|
|
17
17
|
: '';
|
|
18
18
|
const importType = config.useTypeImports ? 'import type' : 'import';
|
|
19
|
+
const emptyObjectType = `Record<PropertyKey, never>`;
|
|
19
20
|
const prepend = [];
|
|
20
21
|
const defsToInclude = [];
|
|
21
22
|
const directiveResolverMappings = {};
|
|
@@ -31,7 +32,7 @@ export type Resolver${capitalizedDirectiveName}WithResolve<TResult, TParent, TCo
|
|
|
31
32
|
resolve: ${resolverFnName}<TResult, TParent, TContext, TArgs>;
|
|
32
33
|
};`;
|
|
33
34
|
const resolverTypeName = `Resolver${capitalizedDirectiveName}`;
|
|
34
|
-
const resolverType = `export type ${resolverTypeName}<TResult, TParent = {}, TContext = {}, TArgs = {}> =`;
|
|
35
|
+
const resolverType = `export type ${resolverTypeName}<TResult, TParent = ${emptyObjectType}, TContext = ${emptyObjectType}, TArgs = ${emptyObjectType}> =`;
|
|
35
36
|
if (parsedMapper.isExternal) {
|
|
36
37
|
if (parsedMapper.default) {
|
|
37
38
|
prepend.push(`${importType} ${resolverFnName} from '${parsedMapper.source}';`);
|
|
@@ -80,7 +81,7 @@ export type NewStitchingResolver<TResult, TParent, TContext, TArgs> = {
|
|
|
80
81
|
export type ResolverWithResolve<TResult, TParent, TContext, TArgs> = {
|
|
81
82
|
resolve: ResolverFn<TResult, TParent, TContext, TArgs>;
|
|
82
83
|
};`;
|
|
83
|
-
const resolverType = `export type Resolver<TResult, TParent = {}, TContext = {}, TArgs = {}> =`;
|
|
84
|
+
const resolverType = `export type Resolver<TResult, TParent = ${emptyObjectType}, TContext = ${emptyObjectType}, TArgs = ${emptyObjectType}> =`;
|
|
84
85
|
const resolverFnUsage = `ResolverFn<TResult, TParent, TContext, TArgs>`;
|
|
85
86
|
const resolverWithResolveUsage = `ResolverWithResolve<TResult, TParent, TContext, TArgs>`;
|
|
86
87
|
const stitchingResolverUsage = `StitchingResolver<TResult, TParent, TContext, TArgs>`;
|
|
@@ -183,21 +184,21 @@ export type SubscriptionObject<TResult, TKey extends string, TParent, TContext,
|
|
|
183
184
|
| SubscriptionSubscriberObject<TResult, TKey, TParent, TContext, TArgs>
|
|
184
185
|
| SubscriptionResolverObject<TResult, TParent, TContext, TArgs>;
|
|
185
186
|
|
|
186
|
-
export type SubscriptionResolver<TResult, TKey extends string, TParent = {}, TContext = {}, TArgs = {}> =
|
|
187
|
+
export type SubscriptionResolver<TResult, TKey extends string, TParent = ${emptyObjectType}, TContext = ${emptyObjectType}, TArgs = ${emptyObjectType}> =
|
|
187
188
|
| ((...args: any[]) => SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>)
|
|
188
189
|
| SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>;
|
|
189
190
|
|
|
190
|
-
export type TypeResolveFn<TTypes, TParent = {}, TContext = {}> = (
|
|
191
|
+
export type TypeResolveFn<TTypes, TParent = ${emptyObjectType}, TContext = ${emptyObjectType}> = (
|
|
191
192
|
parent: TParent,
|
|
192
193
|
context: TContext,
|
|
193
194
|
info${optionalSignForInfoArg}: GraphQLResolveInfo
|
|
194
195
|
) => ${namespacedImportPrefix}Maybe<TTypes> | Promise<${namespacedImportPrefix}Maybe<TTypes>>;
|
|
195
196
|
|
|
196
|
-
export type IsTypeOfResolverFn<T = {}, TContext = {}> = (obj: T, context: TContext, info${optionalSignForInfoArg}: GraphQLResolveInfo) => boolean | Promise<boolean>;
|
|
197
|
+
export type IsTypeOfResolverFn<T = ${emptyObjectType}, TContext = ${emptyObjectType}> = (obj: T, context: TContext, info${optionalSignForInfoArg}: GraphQLResolveInfo) => boolean | Promise<boolean>;
|
|
197
198
|
|
|
198
199
|
export type NextResolverFn<T> = () => Promise<T>;
|
|
199
200
|
|
|
200
|
-
export type DirectiveResolverFn<TResult = {}, TParent = {}, TContext = {}, TArgs = {}> = (
|
|
201
|
+
export type DirectiveResolverFn<TResult = ${emptyObjectType}, TParent = ${emptyObjectType}, TContext = ${emptyObjectType}, TArgs = ${emptyObjectType}> = (
|
|
201
202
|
next: NextResolverFn<TResult>,
|
|
202
203
|
parent: TParent,
|
|
203
204
|
args: TArgs,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-resolvers",
|
|
3
|
-
"version": "5.0.0-alpha-
|
|
3
|
+
"version": "5.0.0-alpha-20250827103001-1f42d2b3d7d1c009e2fc2ed9b513fdda20e78b50",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating TypeScript types for resolvers signature",
|
|
5
5
|
"peerDependenciesMeta": {
|
|
6
6
|
"graphql-sock": {
|
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
"graphql-sock": "^1.0.0"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@graphql-codegen/plugin-helpers": "6.0.0-alpha-
|
|
16
|
-
"@graphql-codegen/typescript": "5.0.0-alpha-
|
|
17
|
-
"@graphql-codegen/visitor-plugin-common": "6.0.0-alpha-
|
|
15
|
+
"@graphql-codegen/plugin-helpers": "6.0.0-alpha-20250827103001-1f42d2b3d7d1c009e2fc2ed9b513fdda20e78b50",
|
|
16
|
+
"@graphql-codegen/typescript": "5.0.0-alpha-20250827103001-1f42d2b3d7d1c009e2fc2ed9b513fdda20e78b50",
|
|
17
|
+
"@graphql-codegen/visitor-plugin-common": "6.0.0-alpha-20250827103001-1f42d2b3d7d1c009e2fc2ed9b513fdda20e78b50",
|
|
18
18
|
"@graphql-tools/utils": "^10.0.0",
|
|
19
|
-
"auto-bind": "
|
|
19
|
+
"auto-bind": "^5.0.0",
|
|
20
20
|
"tslib": "~2.6.0"
|
|
21
21
|
},
|
|
22
22
|
"repository": {
|