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
-
UrlLoader
Implements
Table of contents
Constructors
Methods
- buildHTTPExecutor
- buildSubscriptionExecutor
- buildWSExecutor
- buildWSLegacyExecutor
- getExecutor
- getExecutorAsync
- getExecutorSync
- getFetch
- getWebSocketImpl
- handleSDL
- load
- loadSync
Constructors
constructor
• new UrlLoader(): UrlLoader
Returns
Methods
buildHTTPExecutor
▸ buildHTTPExecutor(endpoint
, fetchFn
, options?
): SyncExecutor
<any
, ExecutionExtensions
>
Parameters
Name | Type |
---|---|
endpoint | string |
fetchFn | SyncFetchFn |
options? | LoadFromUrlOptions |
Returns
SyncExecutor
<any
, ExecutionExtensions
>
Defined in
packages/loaders/url/src/index.ts:127
▸ buildHTTPExecutor(endpoint
, fetchFn
, options?
): AsyncExecutor
<any
, ExecutionExtensions
>
Parameters
Name | Type |
---|---|
endpoint | string |
fetchFn | AsyncFetchFn |
options? | LoadFromUrlOptions |
Returns
AsyncExecutor
<any
, ExecutionExtensions
>
Defined in
packages/loaders/url/src/index.ts:133
buildSubscriptionExecutor
▸ buildSubscriptionExecutor(subscriptionsEndpoint
, fetch
, syncImport
, options?
): SyncExecutor
Parameters
Name | Type |
---|---|
subscriptionsEndpoint | string |
fetch | SyncFetchFn |
syncImport | SyncImportFn |
options? | LoadFromUrlOptions |
Returns
Defined in
packages/loaders/url/src/index.ts:247
▸ buildSubscriptionExecutor(subscriptionsEndpoint
, fetch
, asyncImport
, options?
): AsyncExecutor
Parameters
Name | Type |
---|---|
subscriptionsEndpoint | string |
fetch | AsyncFetchFn |
asyncImport | AsyncImportFn |
options? | LoadFromUrlOptions |
Returns
Defined in
packages/loaders/url/src/index.ts:254
buildWSExecutor
▸ buildWSExecutor(subscriptionsEndpoint
, webSocketImpl
, connectionParams?
): Executor
Parameters
Name | Type |
---|---|
subscriptionsEndpoint | string |
webSocketImpl | typeof WebSocket |
connectionParams? | Record <string , unknown > | () => Record <string , unknown > |
Returns
Defined in
packages/loaders/url/src/index.ts:156
buildWSLegacyExecutor
▸ buildWSLegacyExecutor(subscriptionsEndpoint
, WebSocketImpl
, options?
): Executor
Parameters
Name | Type |
---|---|
subscriptionsEndpoint | string |
WebSocketImpl | typeof WebSocket |
options? | LoadFromUrlOptions |
Returns
Defined in
packages/loaders/url/src/index.ts:172
getExecutor
▸ getExecutor(endpoint
, asyncImport
, options?
): AsyncExecutor
Parameters
Name | Type |
---|---|
endpoint | string |
asyncImport | AsyncImportFn |
options? | Omit <LoadFromUrlOptions , "endpoint" > |
Returns
Defined in
packages/loaders/url/src/index.ts:293
▸ getExecutor(endpoint
, syncImport
, options?
): SyncExecutor
Parameters
Name | Type |
---|---|
endpoint | string |
syncImport | SyncImportFn |
options? | Omit <LoadFromUrlOptions , "endpoint" > |
Returns
Defined in
packages/loaders/url/src/index.ts:299
getExecutorAsync
▸ getExecutorAsync(endpoint
, options?
): AsyncExecutor
Parameters
Name | Type |
---|---|
endpoint | string |
options? | Omit <LoadFromUrlOptions , "endpoint" > |
Returns
Defined in
packages/loaders/url/src/index.ts:350
getExecutorSync
▸ getExecutorSync(endpoint
, options?
): SyncExecutor
Parameters
Name | Type |
---|---|
endpoint | string |
options? | Omit <LoadFromUrlOptions , "endpoint" > |
Returns
Defined in
packages/loaders/url/src/index.ts:357
getFetch
▸ getFetch(customFetch
, importFn
): AsyncFetchFn
| PromiseLike
<AsyncFetchFn
>
Parameters
Name | Type |
---|---|
customFetch | undefined | string | FetchFn |
importFn | AsyncImportFn |
Returns
AsyncFetchFn
| PromiseLike
<AsyncFetchFn
>
Defined in
packages/loaders/url/src/index.ts:185
▸ getFetch(customFetch
, importFn
): SyncFetchFn
Parameters
Name | Type |
---|---|
customFetch | undefined | string | FetchFn |
importFn | SyncImportFn |
Returns
Defined in
packages/loaders/url/src/index.ts:190
getWebSocketImpl
▸ getWebSocketImpl(importFn
, options?
): PromiseLike
<typeof WebSocket
>
Parameters
Name | Type |
---|---|
importFn | AsyncImportFn |
options? | LoadFromUrlOptions |
Returns
PromiseLike
<typeof WebSocket
>
Defined in
packages/loaders/url/src/index.ts:223
▸ getWebSocketImpl(importFn
, options?
): typeof WebSocket
Parameters
Name | Type |
---|---|
importFn | SyncImportFn |
options? | LoadFromUrlOptions |
Returns
typeof WebSocket
Defined in
packages/loaders/url/src/index.ts:228
handleSDL
▸ handleSDL(pointer
, fetch
, options
): Source
Parameters
Name | Type |
---|---|
pointer | string |
fetch | SyncFetchFn |
options | LoadFromUrlOptions |
Returns
Defined in
packages/loaders/url/src/index.ts:361
▸ handleSDL(pointer
, fetch
, options
): Promise
<Source
>
Parameters
Name | Type |
---|---|
pointer | string |
fetch | AsyncFetchFn |
options | LoadFromUrlOptions |
Returns
Promise
<Source
>
Defined in
packages/loaders/url/src/index.ts:362
load
▸ load(pointer
, options
): Promise
<Source
[]>
Parameters
Name | Type |
---|---|
pointer | string |
options | LoadFromUrlOptions |
Returns
Promise
<Source
[]>
Implementation of
Defined in
packages/loaders/url/src/index.ts:380
loadSync
▸ loadSync(pointer
, options
): Source
[]
Parameters
Name | Type |
---|---|
pointer | string |
options | LoadFromUrlOptions |
Returns
Source
[]