Catch the highlights of GraphQLConf 2023! Click for recordings. Or check out our recap blog post.
Docs
API Reference
Classes
ModuleLoader

graphql-tools-monorepo / loaders/module/src / ModuleLoader

Class: ModuleLoader

loaders/module/src.ModuleLoader

  • This loader loads documents and type definitions from a Node module
const schema = await loadSchema('module:someModuleName#someNamedExport', {
  loaders: [new ModuleLoader()],
})

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new ModuleLoader(): ModuleLoader

Returns

ModuleLoader

Methods

canLoad

canLoad(pointer): Promise<boolean>

Parameters

NameType
pointerstring

Returns

Promise<boolean>

Defined in

packages/loaders/module/src/index.ts:44


canLoadSync

canLoadSync(pointer): boolean

Parameters

NameType
pointerstring

Returns

boolean

Defined in

packages/loaders/module/src/index.ts:58


load

load(pointer): Promise<Source[]>

Parameters

NameType
pointerstring

Returns

Promise<Source[]>

Implementation of

Loader.load

Defined in

packages/loaders/module/src/index.ts:71


loadSync

loadSync(pointer): Source[]

Parameters

NameType
pointerstring

Returns

Source[]

Implementation of

Loader.loadSync

Defined in

packages/loaders/module/src/index.ts:85