UNPKG

@graphql-codegen/visitor-plugin-common

Version:
8 lines (7 loc) 857 B
/** * `typedDocumentStringTemplate` is a utility template required by plugins * that use documentMode=string. * The class acts as a wrapper of string but allows it to type the string with * GraphQL Result and Variables type. */ export declare const typedDocumentStringTemplate = "export class TypedDocumentString<TResult, TVariables>\n extends String\n implements DocumentTypeDecoration<TResult, TVariables>\n{\n __apiType?: NonNullable<DocumentTypeDecoration<TResult, TVariables>['__apiType']>;\n private value: string;\n public __meta__?: Record<string, any> | undefined;\n\n constructor(value: string, __meta__?: Record<string, any> | undefined) {\n super(value);\n this.value = value;\n this.__meta__ = __meta__;\n }\n\n override toString(): string & DocumentTypeDecoration<TResult, TVariables> {\n return this.value;\n }\n}";