Socket
Socket
Sign inDemoInstall

@ruiaraujo/graphql-schema-typescript

Package Overview
Dependencies
66
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.1.0

src/__tests__/__snapshots__/schemaInterfaceFields.test.ts.snap

1

lib/typescriptResolverGenerator.d.ts

@@ -23,2 +23,3 @@ import { GenerateTypescriptOptions } from './types';

private generateCustomScalarResolver;
private generateUnionTypeResolver;
private generateTypeResolver;

@@ -25,0 +26,0 @@ private generateObjectResolver;

49

lib/typescriptResolverGenerator.js

@@ -59,2 +59,3 @@ "use strict";

}
case 'INTERFACE':
case 'OBJECT': {

@@ -64,5 +65,4 @@ _this.generateObjectResolver(type, isSubscription);

}
case 'INTERFACE':
case 'UNION': {
_this.generateTypeResolver(type);
_this.generateUnionTypeResolver(type);
break;

@@ -85,27 +85,36 @@ }

};
TSResolverGenerator.prototype.generateUnionTypeResolver = function (type) {
var _a;
var interfaceName = this.generateTypeResolver(type);
(_a = this.resolverObject).push.apply(_a, [
"" + type.name + this.getModifier() + ": {",
"__resolveType: " + interfaceName,
'};',
''
]);
};
TSResolverGenerator.prototype.generateTypeResolver = function (type) {
var _a, _b;
var possbileTypes = type.possibleTypes.map(function (pt) { return "'" + pt.name + "'"; });
var interfaceName = "" + this.options.typePrefix + type.name + "TypeResolver";
var _a;
var possibleTypes = type.possibleTypes.map(function (pt) { return "'" + pt.name + "'"; });
var interfaceName = "" + this.options.typePrefix + type.name + "ResolveType";
var infoModifier = this.options.optionalResolverInfo ? '?' : '';
(_a = this.resolverInterfaces).push.apply(_a, [
"export interface " + interfaceName + "<TParent = " + this.guessTParent(type.name) + "> {",
"(parent: TParent, context: " + this.contextType + ", info" + infoModifier + ": " + this.options.resolveInfoType + "): " + possbileTypes.join(' | ') + ";",
"(parent: TParent, context: " + this.contextType + ", info" + infoModifier + ": " + this.options.resolveInfoType + "): " + possibleTypes.join(' | ') + ";",
'}'
]);
(_b = this.resolverObject).push.apply(_b, [
"" + type.name + this.getModifier() + ": {",
"__resolveType: " + interfaceName,
'};',
''
]);
return interfaceName;
};
TSResolverGenerator.prototype.generateObjectResolver = function (objectType, isSubscription) {
TSResolverGenerator.prototype.generateObjectResolver = function (type, isSubscription) {
var _a, _b;
var _this = this;
if (isSubscription === void 0) { isSubscription = false; }
var typeResolverName = "" + this.options.typePrefix + objectType.name + "TypeResolver";
var typeResolverName = "" + this.options.typePrefix + type.name + "TypeResolver";
var typeResolverBody = [];
var fieldResolversTypeDefs = [];
objectType.fields.forEach(function (field) {
if (type.kind === 'INTERFACE') {
var interfaceName = this.generateTypeResolver(type);
typeResolverBody.push("__resolveType: " + interfaceName);
}
type.fields.forEach(function (field) {
// generate args type

@@ -115,3 +124,3 @@ var argsType = '{}';

if (field.args.length > 0) {
argsType = objectType.name + "To" + uppercaseFirstFieldName + "Args";
argsType = type.name + "To" + uppercaseFirstFieldName + "Args";
var argsBody_1 = [];

@@ -129,4 +138,4 @@ field.args.forEach(function (arg) {

// generate field type
var fieldResolverName = objectType.name + "To" + uppercaseFirstFieldName + "Resolver";
var TParent = _this.guessTParent(objectType.name);
var fieldResolverName = type.name + "To" + uppercaseFirstFieldName + "Resolver";
var TParent = _this.guessTParent(type.name);
var TResult = _this.guessTResult(field);

@@ -162,3 +171,3 @@ var infoModifier = _this.options.optionalResolverInfo ? '?' : '';

(_a = this.resolverInterfaces).push.apply(_a, __spreadArrays([
"export interface " + typeResolverName + "<TParent = " + this.guessTParent(objectType.name) + "> {"
"export interface " + typeResolverName + "<TParent = " + this.guessTParent(type.name) + "> {"
], typeResolverBody, [

@@ -170,3 +179,3 @@ '}',

(_b = this.resolverObject).push.apply(_b, [
"" + objectType.name + this.getModifier() + ": " + typeResolverName + ";"
"" + type.name + this.getModifier() + ": " + typeResolverName + ";"
]);

@@ -173,0 +182,0 @@ };

{
"name": "@ruiaraujo/graphql-schema-typescript",
"version": "0.0.1",
"version": "0.1.0",
"description": "Generate TypeScript from GraphQL's schema type definitions",

@@ -36,2 +36,3 @@ "main": "./lib/index.js",

"jest": "^25.1.0",
"prettier": "^2.0.4",
"ts-jest": "^25.2.1",

@@ -38,0 +39,0 @@ "tslint": "5.8.0",

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult | Promise<TResult>;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult | Promise<TResult>;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult | Promise<TResult>;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult | Promise<TResult>;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult | Promise<TResult>;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult | Promise<TResult>;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: string, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: string, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: string, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: string, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: string, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: string, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: string, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: string, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: string, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: string, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -224,8 +224,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -308,6 +305,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -314,0 +330,0 @@ }

@@ -224,8 +224,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -308,6 +305,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -314,0 +330,0 @@ }

@@ -223,8 +223,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -307,6 +304,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -313,0 +329,0 @@ }

@@ -223,8 +223,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -307,6 +304,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -313,0 +329,0 @@ }

@@ -207,8 +207,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -291,6 +288,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -297,0 +313,0 @@ }

@@ -207,8 +207,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -291,6 +288,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -297,0 +313,0 @@ }

@@ -222,8 +222,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -306,6 +303,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -312,0 +328,0 @@ }

@@ -222,8 +222,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -306,6 +303,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -312,0 +328,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -199,8 +199,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -283,6 +280,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -289,0 +305,0 @@ }

@@ -199,8 +199,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -283,6 +280,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -289,0 +305,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info?: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info?: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info?: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info?: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info?: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info?: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info?: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info?: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info?: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info?: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User: GQLUserTypeResolver;
IProduct: {
__resolveType: GQLIProductTypeResolver
};
IProduct: GQLIProductTypeResolver;
SearchResult: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id: IProductToIdResolver<TParent>;
name: IProductToNameResolver<TParent>;
relatedProducts: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User: GQLUserTypeResolver;
IProduct: {
__resolveType: GQLIProductTypeResolver
};
IProduct: GQLIProductTypeResolver;
SearchResult: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id: IProductToIdResolver<TParent>;
name: IProductToNameResolver<TParent>;
relatedProducts: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = GQLIProduct> {
export interface GQLIProductResolveType<TParent = GQLIProduct> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = GQLSearchResult> {
export interface GQLIProductTypeResolver<TParent = GQLIProduct> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = GQLIProduct, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = GQLIProduct, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = GQLIProduct, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = GQLSearchResult> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = GQLIProduct> {
export interface GQLIProductResolveType<TParent = GQLIProduct> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = GQLSearchResult> {
export interface GQLIProductTypeResolver<TParent = GQLIProduct> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = GQLIProduct, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = GQLIProduct, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = GQLIProduct, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = GQLSearchResult> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = string> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = string> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = Array<GQLIProduct>> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = string> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = string> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = Array<GQLIProduct>> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -227,8 +227,5 @@ /* tslint:disable */

User?: MyPrefixUserTypeResolver;
IProduct?: {
__resolveType: MyPrefixIProductTypeResolver
};
IProduct?: MyPrefixIProductTypeResolver;
SearchResult?: {
__resolveType: MyPrefixSearchResultTypeResolver
__resolveType: MyPrefixSearchResultResolveType
};

@@ -311,6 +308,25 @@

export interface MyPrefixIProductTypeResolver<TParent = any> {
export interface MyPrefixIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface MyPrefixSearchResultTypeResolver<TParent = any> {
export interface MyPrefixIProductTypeResolver<TParent = any> {
__resolveType: MyPrefixIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface MyPrefixSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -317,0 +333,0 @@ }

@@ -227,8 +227,5 @@ /* tslint:disable */

User?: MyPrefixUserTypeResolver;
IProduct?: {
__resolveType: MyPrefixIProductTypeResolver
};
IProduct?: MyPrefixIProductTypeResolver;
SearchResult?: {
__resolveType: MyPrefixSearchResultTypeResolver
__resolveType: MyPrefixSearchResultResolveType
};

@@ -311,6 +308,25 @@

export interface MyPrefixIProductTypeResolver<TParent = any> {
export interface MyPrefixIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface MyPrefixSearchResultTypeResolver<TParent = any> {
export interface MyPrefixIProductTypeResolver<TParent = any> {
__resolveType: MyPrefixIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface MyPrefixSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -317,0 +333,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult | Promise<TResult>;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult | Promise<TResult>;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult | Promise<TResult>;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -222,8 +222,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -306,6 +303,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -312,0 +328,0 @@ }

@@ -225,8 +225,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -309,6 +306,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -315,0 +331,0 @@ }

@@ -223,8 +223,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -307,6 +304,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -313,0 +329,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -207,8 +207,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -291,6 +288,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -297,0 +313,0 @@ }

@@ -199,8 +199,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -283,6 +280,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -289,0 +305,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info?: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info?: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info?: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info?: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info?: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: UserTypeResolver;
IProduct?: {
__resolveType: IProductTypeResolver
};
IProduct?: IProductTypeResolver;
SearchResult?: {
__resolveType: SearchResultTypeResolver
__resolveType: SearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface IProductTypeResolver<TParent = any> {
export interface IProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface SearchResultTypeResolver<TParent = any> {
export interface IProductTypeResolver<TParent = any> {
__resolveType: IProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface SearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User: GQLUserTypeResolver;
IProduct: {
__resolveType: GQLIProductTypeResolver
};
IProduct: GQLIProductTypeResolver;
SearchResult: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id: IProductToIdResolver<TParent>;
name: IProductToNameResolver<TParent>;
relatedProducts: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -15,7 +15,18 @@ /* tslint:disable */

*******************************/
export interface GQLQuery {
test: string;
export interface GQLQuery extends GQLIQuery {
foo?: string;
}
export interface GQLIQuery {
foo?: string;
}
/** Use this to resolve interface type IQuery */
export type GQLPossibleIQueryTypeNames = 'Query';
export interface GQLIQueryNameMap {
IQuery: GQLIQuery;
Query: GQLQuery;
}
/*********************************

@@ -33,14 +44,22 @@ * *

Query?: GQLQueryTypeResolver;
IQuery?: GQLIQueryTypeResolver;
}
export interface GQLQueryTypeResolver<TParent = any> {
test?: QueryToTestResolver<TParent>;
foo?: QueryToFooResolver<TParent>;
}
export interface QueryToTestResolver<TParent = any, TResult = any> {
export interface QueryToFooResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface QueryToFooResolver<TParent = any, TResult = any> {
export interface GQLIQueryResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'Query';
}
export interface GQLIQueryTypeResolver<TParent = any> {
__resolveType: GQLIQueryResolveType
foo?: IQueryToFooResolver<TParent>;
}
export interface IQueryToFooResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = GQLIProduct> {
export interface GQLIProductResolveType<TParent = GQLIProduct> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = GQLSearchResult> {
export interface GQLIProductTypeResolver<TParent = GQLIProduct> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = GQLIProduct, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = GQLIProduct, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = GQLIProduct, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = GQLSearchResult> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = string> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = string> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = Array<GQLIProduct>> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -221,8 +221,5 @@ /* tslint:disable */

User?: GQLUserTypeResolver;
IProduct?: {
__resolveType: GQLIProductTypeResolver
};
IProduct?: GQLIProductTypeResolver;
SearchResult?: {
__resolveType: GQLSearchResultTypeResolver
__resolveType: GQLSearchResultResolveType
};

@@ -305,6 +302,25 @@

export interface GQLIProductTypeResolver<TParent = any> {
export interface GQLIProductResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'ProductA' | 'ProductB';
}
export interface GQLSearchResultTypeResolver<TParent = any> {
export interface GQLIProductTypeResolver<TParent = any> {
__resolveType: GQLIProductResolveType
id?: IProductToIdResolver<TParent>;
name?: IProductToNameResolver<TParent>;
relatedProducts?: IProductToRelatedProductsResolver<TParent>;
}
export interface IProductToIdResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToNameResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface IProductToRelatedProductsResolver<TParent = any, TResult = any> {
(parent: TParent, args: {}, context: any, info: GraphQLResolveInfo): TResult;
}
export interface GQLSearchResultResolveType<TParent = any> {
(parent: TParent, context: any, info: GraphQLResolveInfo): 'User' | 'ProductA' | 'ProductB';

@@ -311,0 +327,0 @@ }

@@ -49,3 +49,3 @@ import { defaultOptions, GenerateTypescriptOptions } from './types';

public generate(): GenerateResolversResult {
const { introspectionResult } = this;
const {introspectionResult} = this;
const gqlTypes = introspectionResult.__schema.types.filter(type => !isBuiltinType(type));

@@ -85,2 +85,3 @@ this.queryType = introspectionResult.__schema.queryType;

case 'INTERFACE':
case 'OBJECT': {

@@ -91,5 +92,4 @@ this.generateObjectResolver(type, isSubscription);

case 'INTERFACE':
case 'UNION': {
this.generateTypeResolver(type);
this.generateUnionTypeResolver(type);
break;

@@ -121,5 +121,15 @@ }

private generateUnionTypeResolver(type: IntrospectionUnionType) {
const interfaceName = this.generateTypeResolver(type);
this.resolverObject.push(...[
`${type.name}${this.getModifier()}: {`,
`__resolveType: ${interfaceName}`,
'};',
''
]);
}
private generateTypeResolver(type: IntrospectionUnionType | IntrospectionInterfaceType) {
const possbileTypes = type.possibleTypes.map(pt => `'${pt.name}'`);
const interfaceName = `${this.options.typePrefix}${type.name}TypeResolver`;
const possibleTypes = type.possibleTypes.map(pt => `'${pt.name}'`);
const interfaceName = `${this.options.typePrefix}${type.name}ResolveType`;
const infoModifier = this.options.optionalResolverInfo ? '?' : '';

@@ -129,20 +139,19 @@

`export interface ${interfaceName}<TParent = ${this.guessTParent(type.name)}> {`,
`(parent: TParent, context: ${this.contextType}, info${infoModifier}: ${this.options.resolveInfoType}): ${possbileTypes.join(' | ')};`,
`(parent: TParent, context: ${this.contextType}, info${infoModifier}: ${this.options.resolveInfoType}): ${possibleTypes.join(' | ')};`,
'}'
]);
this.resolverObject.push(...[
`${type.name}${this.getModifier()}: {`,
`__resolveType: ${interfaceName}`,
'};',
''
]);
return interfaceName;
}
private generateObjectResolver(objectType: IntrospectionObjectType, isSubscription: boolean = false) {
const typeResolverName = `${this.options.typePrefix}${objectType.name}TypeResolver`;
private generateObjectResolver(type: IntrospectionObjectType | IntrospectionInterfaceType, isSubscription: boolean = false) {
const typeResolverName = `${this.options.typePrefix}${type.name}TypeResolver`;
const typeResolverBody: string[] = [];
const fieldResolversTypeDefs: string[] = [];
objectType.fields.forEach(field => {
if (type.kind === 'INTERFACE') {
const interfaceName = this.generateTypeResolver(type);
typeResolverBody.push(`__resolveType: ${interfaceName}`);
}
type.fields.forEach(field => {
// generate args type

@@ -154,6 +163,6 @@ let argsType = '{}';

if (field.args.length > 0) {
argsType = `${objectType.name}To${uppercaseFirstFieldName}Args`;
argsType = `${type.name}To${uppercaseFirstFieldName}Args`;
const argsBody: string[] = [];
field.args.forEach(arg => {
const { fieldName, fieldType } = createFieldRef(arg, this.options.typePrefix, false);
const {fieldName, fieldType} = createFieldRef(arg, this.options.typePrefix, false);
argsBody.push(`${fieldName}: ${fieldType};`);

@@ -170,5 +179,5 @@ });

// generate field type
const fieldResolverName = `${objectType.name}To${uppercaseFirstFieldName}Resolver`;
const fieldResolverName = `${type.name}To${uppercaseFirstFieldName}Resolver`;
const TParent = this.guessTParent(objectType.name);
const TParent = this.guessTParent(type.name);
const TResult = this.guessTResult(field);

@@ -180,4 +189,4 @@ const infoModifier = this.options.optionalResolverInfo ? '?' : '';

: !!this.options.asyncResult
? 'TResult | Promise<TResult>'
: 'TResult';
? 'TResult | Promise<TResult>'
: 'TResult';
const subscriptionReturnType =

@@ -189,3 +198,3 @@ this.options.asyncResult ? 'AsyncIterator<TResult> | Promise<AsyncIterator<TResult>>' : 'AsyncIterator<TResult>';

`(parent: TParent, args: ${argsType}, context: ${this.contextType}, info${infoModifier}: ${
this.options.resolveInfoType}): ${returnType};`,
this.options.resolveInfoType}): ${returnType};`,
'}',

@@ -212,3 +221,3 @@ ''

this.resolverInterfaces.push(...[
`export interface ${typeResolverName}<TParent = ${this.guessTParent(objectType.name)}> {`,
`export interface ${typeResolverName}<TParent = ${this.guessTParent(type.name)}> {`,
...typeResolverBody,

@@ -222,3 +231,3 @@ '}',

this.resolverObject.push(...[
`${objectType.name}${this.getModifier()}: ${typeResolverName};`
`${type.name}${this.getModifier()}: ${typeResolverName};`
]);

@@ -258,3 +267,3 @@ }

// set strict-nulls to always true so that fieldType could possibly null;
const { fieldType } = createFieldRef(field, this.options.typePrefix, true);
const {fieldType} = createFieldRef(field, this.options.typePrefix, true);
return fieldType;

@@ -261,0 +270,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc