UNPKG

@apollo/client

Version:

A fully-featured caching GraphQL client.

1 lines 24 kB
{"version":3,"file":"ApolloLink.cjs","sources":["../../../../src/link/core/ApolloLink.ts"],"sourcesContent":["import type {\n DocumentNode,\n FormattedExecutionResult,\n OperationTypeNode,\n} from \"graphql\";\nimport type { Observable } from \"rxjs\";\nimport { EMPTY } from \"rxjs\";\n\nimport type {\n ApolloClient,\n DefaultContext,\n OperationVariables,\n} from \"@apollo/client\";\nimport type { TypeOverrides } from \"@apollo/client\";\nimport type { NotImplementedHandler } from \"@apollo/client/incremental\";\nimport { createOperation } from \"@apollo/client/link/utils\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport type { ApplyHKTImplementationWithDefault } from \"@apollo/client/utilities/internal\";\nimport {\n invariant,\n newInvariantError,\n} from \"@apollo/client/utilities/invariant\";\n\nexport declare namespace ApolloLink {\n /**\n * Context provided for link execution, such as the client executing the\n * request. It is separate from the request operation context.\n */\n export interface ExecuteContext {\n /**\n * The Apollo Client instance that executed the GraphQL request.\n */\n client: ApolloClient;\n }\n\n /** {@inheritDoc @apollo/client/link!ApolloLink.DocumentationTypes.ForwardFunction:function(1)} */\n export type ForwardFunction = (\n operation: ApolloLink.Operation\n ) => Observable<ApolloLink.Result>;\n\n /**\n * The input object provided to `ApolloLink.execute` to send a GraphQL request through\n * the link chain.\n */\n export interface Request {\n /**\n * The parsed GraphQL document that will be sent with the GraphQL request to\n * the server.\n */\n query: DocumentNode;\n\n /**\n * The variables provided for the query.\n */\n variables?: OperationVariables;\n\n /**\n * Context provided to the link chain. Context is not sent to the server and\n * is used to communicate additional metadata from a request to individual\n * links in the link chain.\n */\n context?: DefaultContext;\n\n /**\n * A map of extensions that will be sent with the GraphQL request to the\n * server.\n */\n extensions?: Record<string, any>;\n }\n\n /** {@inheritDoc @apollo/client/link!ApolloLink.DocumentationTypes.RequestHandler:function(1)} */\n export type RequestHandler = (\n operation: ApolloLink.Operation,\n forward: ApolloLink.ForwardFunction\n ) => Observable<ApolloLink.Result>;\n\n export type AdditionalResultTypes<\n TData = Record<string, any>,\n TExtensions = Record<string, any>,\n > = ApplyHKTImplementationWithDefault<\n TypeOverrides,\n \"AdditionalApolloLinkResultTypes\",\n NotImplementedHandler.TypeOverrides,\n TData,\n TExtensions\n >;\n\n export type Result<\n TData = Record<string, any>,\n TExtensions = Record<string, any>,\n > =\n | FormattedExecutionResult<TData, TExtensions>\n | AdditionalResultTypes<TData, TExtensions>;\n\n /**\n * The currently executed operation object provided to an `ApolloLink.RequestHandler`\n * for each link in the link chain.\n */\n export interface Operation {\n /**\n * A `DocumentNode` that describes the operation taking place.\n */\n query: DocumentNode;\n\n /**\n * A map of GraphQL variables being sent with the operation.\n */\n variables: OperationVariables;\n\n /**\n * The string name of the GraphQL operation. If it is anonymous,\n * `operationName` will be `undefined`.\n */\n operationName: string | undefined;\n\n /**\n * The type of the GraphQL operation, such as query or mutation.\n */\n operationType: OperationTypeNode;\n\n /**\n * A map that stores extensions data to be sent to the server.\n */\n extensions: Record<string, any>;\n\n /**\n * A function that takes either a new context object, or a function which\n * takes in the previous context and returns a new one. See [managing\n * context](https://apollographql.com/docs/react/api/link/introduction#managing-context).\n */\n setContext: {\n (context: Partial<ApolloLink.OperationContext>): void;\n (\n updateContext: (\n previousContext: Readonly<ApolloLink.OperationContext>\n ) => Partial<ApolloLink.OperationContext>\n ): void;\n };\n\n /**\n * A function that gets the current context of the request. This can be used\n * by links to determine which actions to perform. See [managing context](https://apollographql.com/docs/react/api/link/introduction#managing-context)\n */\n getContext: () => Readonly<ApolloLink.OperationContext>;\n\n /**\n * The Apollo Client instance executing the request.\n */\n readonly client: ApolloClient;\n }\n\n /**\n * The `context` object that can be read and modified by links using the\n * `operation.getContext()` and `operation.setContext()` methods.\n */\n export interface OperationContext extends DefaultContext {}\n\n export namespace DocumentationTypes {\n /**\n * A request handler is responsible for performing some logic and executing the\n * request, either by [forwarding](https://apollographql.com/docs/react/api/link/introduction#the-request-handler) the operation to the next link in the\n * chain, or sending the operation to the destination that executes it, such as\n * a GraphQL server.\n *\n * @param operation - The `Operation` object that provides information about the\n * currently executed GraphQL request.\n *\n * @param forward - A function that is called to execute the next link in the\n * chain.\n */\n export function RequestHandler(\n operation: ApolloLink.Operation,\n forward: ApolloLink.ForwardFunction\n ): Observable<ApolloLink.Result>;\n\n /**\n * A function that when called will execute the next link in the link chain.\n *\n * @example\n *\n * ```ts\n * const link = new ApolloLink((operation, forward) => {\n * // process the request\n *\n * // Call `forward` to execute the next link in the chain\n * return forward(operation);\n * });\n * ```\n *\n * @param operation - The current `ApolloLink.Operation` object for the\n * request.\n */\n export function ForwardFunction(\n operation: ApolloLink.Operation\n ): Observable<ApolloLink.Result>;\n }\n}\n\n/**\n * The base class for all links in Apollo Client. A link represents either a\n * self-contained modification to a GraphQL operation or a side effect (such as\n * logging).\n *\n * @remarks\n *\n * Links enable you to customize Apollo Client's request flow by composing\n * together different pieces of functionality into a chain of links. Each\n * link represents a specific capability, such as adding authentication headers,\n * retrying failed requests, batching operations, or sending requests to a\n * GraphQL server.\n *\n * Every link must define a request handler via its constructor or by extending\n * this class and implementing the `request` method.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink } from \"@apollo/client\";\n *\n * const link = new ApolloLink((operation, forward) => {\n * console.log(\"Operation:\", operation.operationName);\n * return forward(operation);\n * });\n * ```\n */\nexport class ApolloLink {\n /**\n * Creates a link that completes immediately and does not emit a result.\n *\n * @example\n *\n * ```ts\n * const link = ApolloLink.empty();\n * ```\n */\n public static empty(): ApolloLink {\n return new ApolloLink(() => EMPTY);\n }\n\n /**\n * Composes multiple links into a single composed link that executes each\n * provided link in serial order.\n *\n * @example\n *\n * ```ts\n * import { from, HttpLink, ApolloLink } from \"@apollo/client\";\n * import { RetryLink } from \"@apollo/client/link/retry\";\n * import MyAuthLink from \"../auth\";\n *\n * const link = ApolloLink.from([\n * new RetryLink(),\n * new MyAuthLink(),\n * new HttpLink({ uri: \"http://localhost:4000/graphql\" }),\n * ]);\n * ```\n *\n * @param links - An array of `ApolloLink` instances or request handlers that\n * are executed in serial order.\n */\n public static from(links: ApolloLink[]): ApolloLink {\n if (links.length === 0) return ApolloLink.empty();\n\n const [first, ...rest] = links;\n return first.concat(...rest);\n }\n\n /**\n * Creates a link that conditionally routes a request to different links.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const link = ApolloLink.split(\n * (operation) => operation.getContext().version === 1,\n * new HttpLink({ uri: \"http://localhost:4000/v1/graphql\" }),\n * new HttpLink({ uri: \"http://localhost:4000/v2/graphql\" })\n * );\n * ```\n *\n * @param test - A predicate function that receives the current `operation`\n * and returns a boolean indicating which link to execute. Returning `true`\n * executes the `left` link. Returning `false` executes the `right` link.\n *\n * @param left - The link that executes when the `test` function returns\n * `true`.\n *\n * @param right - The link that executes when the `test` function returns\n * `false`. If the `right` link is not provided, the request is forwarded to\n * the next link in the chain.\n */\n public static split(\n test: (op: ApolloLink.Operation) => boolean,\n left: ApolloLink,\n right: ApolloLink = new ApolloLink((op, forward) => forward(op))\n ): ApolloLink {\n const link = new ApolloLink((operation, forward) => {\n const result = test(operation);\n\n if (__DEV__) {\n if (typeof result !== \"boolean\") {\n invariant.warn(\n \"[ApolloLink.split]: The test function returned a non-boolean value which could result in subtle bugs (e.g. such as using an `async` function which always returns a truthy value). Got `%o`.\",\n result\n );\n }\n }\n\n return result ?\n left.request(operation, forward)\n : right.request(operation, forward);\n });\n return Object.assign(link, { left, right });\n }\n\n /**\n * Executes a GraphQL request against a link. The `execute` function begins\n * the request by calling the request handler of the link.\n *\n * @example\n *\n * ```ts\n * const observable = ApolloLink.execute(link, { query, variables }, { client });\n *\n * observable.subscribe({\n * next(value) {\n * console.log(\"Received\", value);\n * },\n * error(error) {\n * console.error(\"Oops got error\", error);\n * },\n * complete() {\n * console.log(\"Request complete\");\n * },\n * });\n * ```\n *\n * @param link - The `ApolloLink` instance to execute the request.\n *\n * @param request - The GraphQL request details, such as the `query` and\n * `variables`.\n *\n * @param context - The execution context for the request, such as the\n * `client` making the request.\n */\n public static execute(\n link: ApolloLink,\n request: ApolloLink.Request,\n context: ApolloLink.ExecuteContext\n ): Observable<ApolloLink.Result> {\n return link.request(createOperation(request, context), () => {\n if (__DEV__) {\n invariant.warn(\n \"The terminating link provided to `ApolloLink.execute` called `forward` instead of handling the request. \" +\n \"This results in an observable that immediately completes and does not emit a value. \" +\n \"Please provide a terminating link that properly handles the request.\\n\\n\" +\n \"If you are using a split link, ensure each branch contains a terminating link that handles the request.\"\n );\n }\n return EMPTY;\n });\n }\n\n /**\n * Combines multiple links into a single composed link.\n *\n * @example\n *\n * ```ts\n * const link = ApolloLink.concat(firstLink, secondLink, thirdLink);\n * ```\n *\n * @param links - The links to concatenate into a single link. Each link will\n * execute in serial order.\n *\n * @deprecated Use `ApolloLink.from` instead. `ApolloLink.concat` will be\n * removed in a future major version.\n */\n public static concat(...links: ApolloLink[]) {\n return ApolloLink.from(links);\n }\n\n constructor(request?: ApolloLink.RequestHandler) {\n if (request) this.request = request;\n }\n\n /**\n * Concatenates a link that conditionally routes a request to different links.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const previousLink = new ApolloLink((operation, forward) => {\n * // Handle the request\n *\n * return forward(operation);\n * });\n *\n * const link = previousLink.split(\n * (operation) => operation.getContext().version === 1,\n * new HttpLink({ uri: \"http://localhost:4000/v1/graphql\" }),\n * new HttpLink({ uri: \"http://localhost:4000/v2/graphql\" })\n * );\n * ```\n *\n * @param test - A predicate function that receives the current `operation`\n * and returns a boolean indicating which link to execute. Returning `true`\n * executes the `left` link. Returning `false` executes the `right` link.\n *\n * @param left - The link that executes when the `test` function returns\n * `true`.\n *\n * @param right - The link that executes when the `test` function returns\n * `false`. If the `right` link is not provided, the request is forwarded to\n * the next link in the chain.\n */\n public split(\n test: (op: ApolloLink.Operation) => boolean,\n left: ApolloLink,\n right?: ApolloLink\n ): ApolloLink {\n return this.concat(ApolloLink.split(test, left, right));\n }\n\n /**\n * Combines the link with other links into a single composed link.\n *\n * @example\n *\n * ```ts\n * import { ApolloLink, HttpLink } from \"@apollo/client\";\n *\n * const previousLink = new ApolloLink((operation, forward) => {\n * // Handle the request\n *\n * return forward(operation);\n * });\n *\n * const link = previousLink.concat(\n * link1,\n * link2,\n * new HttpLink({ uri: \"http://localhost:4000/graphql\" })\n * );\n * ```\n */\n public concat(...links: ApolloLink[]): ApolloLink {\n if (links.length === 0) {\n return this;\n }\n\n return links.reduce(this.combine.bind(this), this);\n }\n\n private combine(left: ApolloLink, right: ApolloLink) {\n const link = new ApolloLink((operation, forward) => {\n return left.request(operation, (op) => right.request(op, forward));\n });\n\n return Object.assign(link, { left, right });\n }\n\n /**\n * Runs the request handler for the provided operation.\n *\n * > [!NOTE]\n * > This is called by the `ApolloLink.execute` function for you and should\n * > not be called directly. Prefer using `ApolloLink.execute` to make the\n * > request instead.\n */\n public request(\n operation: ApolloLink.Operation,\n forward: ApolloLink.ForwardFunction\n ): Observable<ApolloLink.Result> {\n throw newInvariantError(\"request is not implemented\");\n }\n\n /**\n * @internal\n * Used to iterate through all links that are concatenations or `split` links.\n */\n readonly left?: ApolloLink;\n /**\n * @internal\n * Used to iterate through all links that are concatenations or `split` links.\n */\n readonly right?: ApolloLink;\n\n /**\n * @internal\n * Can be provided by a link that has an internal cache to report it's memory details.\n */\n declare getMemoryInternals?: () => unknown;\n}\n"],"names":[],"mappings":";;;;;;;AAMA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AASA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CA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