loaders_code_file_src.codefileloader

Class: CodeFileLoader#

loaders/code-file/src.CodeFileLoader

This loader loads GraphQL documents and type definitions from code files using graphql-tag-pluck.

const documents = await loadDocuments('queries/*.js', {
loaders: [
new CodeFileLoader()
]
});

Supported extensions include: .ts, .tsx, .js, .jsx, .vue

Hierarchy#

  • CodeFileLoader

Implements#

Table of contents#

Constructors#

Methods#

Constructors#

constructor#

+ new CodeFileLoader(): CodeFileLoader

Returns: CodeFileLoader

Methods#

canLoad#

canLoad(pointer: string, options: CodeFileLoaderOptions): Promise<boolean\>

Parameters:#

NameType
pointerstring
optionsCodeFileLoaderOptions

Returns: Promise<boolean\>

Defined in: packages/loaders/code-file/src/index.ts:57


canLoadSync#

canLoadSync(pointer: string, options: CodeFileLoaderOptions): boolean

Parameters:#

NameType
pointerstring
optionsCodeFileLoaderOptions

Returns: boolean

Defined in: packages/loaders/code-file/src/index.ts:76


load#

load(pointer: string, options: CodeFileLoaderOptions): Promise<Source\>

Parameters:#

NameType
pointerstring
optionsCodeFileLoaderOptions

Returns: Promise<Source\>

Defined in: packages/loaders/code-file/src/index.ts:92


loadSync#

loadSync(pointer: string, options: CodeFileLoaderOptions): Source

Parameters:#

NameType
pointerstring
optionsCodeFileLoaderOptions

Returns: Source

Defined in: packages/loaders/code-file/src/index.ts:135


loaderId#

loaderId(): string

Returns: string

Defined in: packages/loaders/code-file/src/index.ts:53