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

graphql-tools-monorepo / loaders/url/src / UrlLoader

Class: UrlLoader

loaders/url/src.UrlLoader

This loader loads a schema from a URL. The loaded schema is a fully-executable, remote schema since it’s created using @graphql-tools/wrap.

const schema = await loadSchema('http://localhost:3000/graphql', {
  loaders: [
    new UrlLoader(),
  ]
});

Hierarchy

Implements

Table of contents

Constructors

Methods

Constructors

constructor

new UrlLoader(): UrlLoader

Returns

UrlLoader

Methods

buildHTTPExecutor

buildHTTPExecutor(endpoint, fetchFn, options?): SyncExecutor<any, ExecutionExtensions>

Parameters

NameType
endpointstring
fetchFnSyncFetchFn
options?LoadFromUrlOptions

Returns

SyncExecutor<any, ExecutionExtensions>

Defined in

packages/loaders/url/src/index.ts:127

buildHTTPExecutor(endpoint, fetchFn, options?): AsyncExecutor<any, ExecutionExtensions>

Parameters

NameType
endpointstring
fetchFnAsyncFetchFn
options?LoadFromUrlOptions

Returns

AsyncExecutor<any, ExecutionExtensions>

Defined in

packages/loaders/url/src/index.ts:133


buildSubscriptionExecutor

buildSubscriptionExecutor(subscriptionsEndpoint, fetch, syncImport, options?): SyncExecutor

Parameters

NameType
subscriptionsEndpointstring
fetchSyncFetchFn
syncImportSyncImportFn
options?LoadFromUrlOptions

Returns

SyncExecutor

Defined in

packages/loaders/url/src/index.ts:247

buildSubscriptionExecutor(subscriptionsEndpoint, fetch, asyncImport, options?): AsyncExecutor

Parameters

NameType
subscriptionsEndpointstring
fetchAsyncFetchFn
asyncImportAsyncImportFn
options?LoadFromUrlOptions

Returns

AsyncExecutor

Defined in

packages/loaders/url/src/index.ts:254


buildWSExecutor

buildWSExecutor(subscriptionsEndpoint, webSocketImpl, connectionParams?): Executor

Parameters

NameType
subscriptionsEndpointstring
webSocketImpltypeof WebSocket
connectionParams?Record<string, unknown> | () => Record<string, unknown>

Returns

Executor

Defined in

packages/loaders/url/src/index.ts:156


buildWSLegacyExecutor

buildWSLegacyExecutor(subscriptionsEndpoint, WebSocketImpl, options?): Executor

Parameters

NameType
subscriptionsEndpointstring
WebSocketImpltypeof WebSocket
options?LoadFromUrlOptions

Returns

Executor

Defined in

packages/loaders/url/src/index.ts:172


getExecutor

getExecutor(endpoint, asyncImport, options?): AsyncExecutor

Parameters

NameType
endpointstring
asyncImportAsyncImportFn
options?Omit<LoadFromUrlOptions, "endpoint">

Returns

AsyncExecutor

Defined in

packages/loaders/url/src/index.ts:293

getExecutor(endpoint, syncImport, options?): SyncExecutor

Parameters

NameType
endpointstring
syncImportSyncImportFn
options?Omit<LoadFromUrlOptions, "endpoint">

Returns

SyncExecutor

Defined in

packages/loaders/url/src/index.ts:299


getExecutorAsync

getExecutorAsync(endpoint, options?): AsyncExecutor

Parameters

NameType
endpointstring
options?Omit<LoadFromUrlOptions, "endpoint">

Returns

AsyncExecutor

Defined in

packages/loaders/url/src/index.ts:351


getExecutorSync

getExecutorSync(endpoint, options?): SyncExecutor

Parameters

NameType
endpointstring
options?Omit<LoadFromUrlOptions, "endpoint">

Returns

SyncExecutor

Defined in

packages/loaders/url/src/index.ts:358


getFetch

getFetch(customFetch, importFn): AsyncFetchFn | PromiseLike<AsyncFetchFn>

Parameters

NameType
customFetchundefined | string | FetchFn
importFnAsyncImportFn

Returns

AsyncFetchFn | PromiseLike<AsyncFetchFn>

Defined in

packages/loaders/url/src/index.ts:185

getFetch(customFetch, importFn): SyncFetchFn

Parameters

NameType
customFetchundefined | string | FetchFn
importFnSyncImportFn

Returns

SyncFetchFn

Defined in

packages/loaders/url/src/index.ts:190


getWebSocketImpl

getWebSocketImpl(importFn, options?): PromiseLike<typeof WebSocket>

Parameters

NameType
importFnAsyncImportFn
options?LoadFromUrlOptions

Returns

PromiseLike<typeof WebSocket>

Defined in

packages/loaders/url/src/index.ts:223

getWebSocketImpl(importFn, options?): typeof WebSocket

Parameters

NameType
importFnSyncImportFn
options?LoadFromUrlOptions

Returns

typeof WebSocket

Defined in

packages/loaders/url/src/index.ts:228


handleSDL

handleSDL(pointer, fetch, options): Source

Parameters

NameType
pointerstring
fetchSyncFetchFn
optionsLoadFromUrlOptions

Returns

Source

Defined in

packages/loaders/url/src/index.ts:362

handleSDL(pointer, fetch, options): Promise<Source>

Parameters

NameType
pointerstring
fetchAsyncFetchFn
optionsLoadFromUrlOptions

Returns

Promise<Source>

Defined in

packages/loaders/url/src/index.ts:363


load

load(pointer, options): Promise<Source[]>

Parameters

NameType
pointerstring
optionsLoadFromUrlOptions

Returns

Promise<Source[]>

Implementation of

Loader.load

Defined in

packages/loaders/url/src/index.ts:381


loadSync

loadSync(pointer, options): Source[]

Parameters

NameType
pointerstring
optionsLoadFromUrlOptions

Returns

Source[]

Implementation of

Loader.loadSync

Defined in

packages/loaders/url/src/index.ts:426