• Docs
  • API Reference
  • Classes
  • 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()

Methods

buildHTTPExecutor

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

Parameters

NameType
endpointstring
fetchSyncFetchFn
options?LoadFromUrlOptions

Returns

SyncExecutor<any, ExecutionExtensions>

Defined in

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

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

Parameters

NameType
endpointstring
fetchAsyncFetchFn
options?LoadFromUrlOptions

Returns

AsyncExecutor<any, ExecutionExtensions>

Defined in

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


buildSubscriptionExecutor

buildSubscriptionExecutor(subscriptionsEndpoint, fetch, syncImport, options?): SyncExecutor<Record<string, any>, Record<string, any>>

Parameters

NameType
subscriptionsEndpointstring
fetchSyncFetchFn
syncImportSyncImportFn
options?LoadFromUrlOptions

Returns

SyncExecutor<Record<string, any>, Record<string, any>>

Defined in

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

buildSubscriptionExecutor(subscriptionsEndpoint, fetch, asyncImport, options?): AsyncExecutor<Record<string, any>, Record<string, any>>

Parameters

NameType
subscriptionsEndpointstring
fetchAsyncFetchFn
asyncImportAsyncImportFn
options?LoadFromUrlOptions

Returns

AsyncExecutor<Record<string, any>, Record<string, any>>

Defined in

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


buildWSExecutor

buildWSExecutor(subscriptionsEndpoint, webSocketImpl, connectionParams?): Executor<Record<string, any>, Record<string, any>>

Parameters

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

Returns

Executor<Record<string, any>, Record<string, any>>

Defined in

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


buildWSLegacyExecutor

buildWSLegacyExecutor(subscriptionsEndpoint, WebSocketImpl, options?): Executor<Record<string, any>, Record<string, any>>

Parameters

NameType
subscriptionsEndpointstring
WebSocketImpltypeof WebSocket
options?LoadFromUrlOptions

Returns

Executor<Record<string, any>, Record<string, any>>

Defined in

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


createFormDataFromVariables

createFormDataFromVariables<TVariables>(__namedParameters): string | FormData | Promise<FormData>

Type parameters

Name
TVariables

Parameters

NameType
__namedParametersObject
__namedParameters.extensions?any
__namedParameters.operationName?string
__namedParameters.querystring
__namedParameters.variablesTVariables

Returns

string | FormData | Promise<FormData>

Defined in

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


getExecutor

getExecutor(endpoint, asyncImport, options?): AsyncExecutor<Record<string, any>, Record<string, any>>

Parameters

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

Returns

AsyncExecutor<Record<string, any>, Record<string, any>>

Defined in

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

getExecutor(endpoint, syncImport, options?): SyncExecutor<Record<string, any>, Record<string, any>>

Parameters

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

Returns

SyncExecutor<Record<string, any>, Record<string, any>>

Defined in

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


getExecutorAsync

getExecutorAsync(endpoint, options?): AsyncExecutor<Record<string, any>, Record<string, any>>

Parameters

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

Returns

AsyncExecutor<Record<string, any>, Record<string, any>>

Defined in

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


getExecutorSync

getExecutorSync(endpoint, options?): SyncExecutor<Record<string, any>, Record<string, any>>

Parameters

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

Returns

SyncExecutor<Record<string, any>, Record<string, any>>

Defined in

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


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:673

getFetch(customFetch, importFn): SyncFetchFn

Parameters

NameType
customFetchundefined | string | FetchFn
importFnSyncImportFn

Returns

SyncFetchFn

Defined in

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


getWebSocketImpl

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

Parameters

NameType
importFnAsyncImportFn
options?LoadFromUrlOptions

Returns

PromiseLike<typeof WebSocket>

Defined in

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

getWebSocketImpl(importFn, options?): typeof WebSocket

Parameters

NameType
importFnSyncImportFn
options?LoadFromUrlOptions

Returns

typeof WebSocket

Defined in

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


handleSDL

handleSDL(pointer, fetch, options): Source

Parameters

NameType
pointerstring
fetchSyncFetchFn
optionsLoadFromUrlOptions

Returns

Source

Defined in

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

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

Parameters

NameType
pointerstring
fetchAsyncFetchFn
optionsLoadFromUrlOptions

Returns

Promise<Source>

Defined in

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


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:835


loadSync

loadSync(pointer, options): Source[]

Parameters

NameType
pointerstring
optionsLoadFromUrlOptions

Returns

Source[]

Implementation of

Loader.loadSync

Defined in

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


prepareGETUrl

prepareGETUrl(__namedParameters): string

Parameters

NameType
__namedParametersObject
__namedParameters.baseUrlstring
__namedParameters.extensions?any
__namedParameters.operationName?string
__namedParameters.querystring
__namedParameters.variablesany

Returns

string

Defined in

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