{"id":13725504,"url":"https://github.com/dai-shi/apollo-link-lazy","last_synced_at":"2025-04-15T01:09:26.169Z","repository":{"id":36940706,"uuid":"232130468","full_name":"dai-shi/apollo-link-lazy","owner":"dai-shi","description":"Apollo Link for lazy loading","archived":false,"fork":false,"pushed_at":"2023-01-07T14:49:32.000Z","size":2935,"stargazers_count":14,"open_issues_count":21,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T13:05:29.132Z","etag":null,"topics":["apollo-client","apollo-link","apollographql","lazy-loading"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/apollo-link-lazy","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dai-shi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-06T15:33:54.000Z","updated_at":"2022-04-19T06:25:28.000Z","dependencies_parsed_at":"2023-01-17T07:30:59.712Z","dependency_job_id":null,"html_url":"https://github.com/dai-shi/apollo-link-lazy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dai-shi%2Fapollo-link-lazy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dai-shi%2Fapollo-link-lazy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dai-shi%2Fapollo-link-lazy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dai-shi%2Fapollo-link-lazy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dai-shi","download_url":"https://codeload.github.com/dai-shi/apollo-link-lazy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248824693,"owners_count":21167345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apollo-client","apollo-link","apollographql","lazy-loading"],"created_at":"2024-08-03T01:02:25.312Z","updated_at":"2025-04-15T01:09:26.153Z","avatar_url":"https://github.com/dai-shi.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# apollo-link-lazy\n\n[![CI](https://img.shields.io/github/workflow/status/dai-shi/apollo-link-lazy/CI)](https://github.com/dai-shi/apollo-link-lazy/actions?query=workflow%3ACI)\n[![npm](https://img.shields.io/npm/v/apollo-link-lazy)](https://www.npmjs.com/package/apollo-link-lazy)\n[![size](https://img.shields.io/bundlephobia/minzip/apollo-link-lazy)](https://bundlephobia.com/result?p=apollo-link-lazy)\n\nApollo Link for lazy loading\n\n## Introduction\n\nThis is a tiny library to lazy load Apollo Link.\nIt can be useful for code splitting.\n\n## Install\n\n```bash\nnpm install apollo-link-lazy\n```\n\n## Usage\n\n```javascript\nimport ApolloClient from 'apollo-client';\nimport { InMemoryCache } from 'apollo-cache-inmemory';\nimport { lazy } from 'apollo-link-lazy';\n\nconst client = new ApolloClient({\n  cache: new InMemoryCache(),\n  link: lazy(() =\u003e import('./link')),\n});\n```\n\n## API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n### lazy\n\nLazy load ApolloLink promise\n\nType: Lazy\n\n#### Parameters\n\n-   `factory`  \n\n#### Examples\n\n```javascript\nimport { lazy } from 'apollo-link-lazy';\n\nconst link = lazy(() =\u003e import('./link'));\n```\n\n## Examples\n\nThe [examples](examples) folder contains working examples.\nYou can run one of them with\n\n```bash\nPORT=8080 npm run examples:01_minimal\n```\n\nand open \u003chttp://localhost:8080\u003e in your web browser.\n\nYou can also try them in codesandbox.io:\n[01](https://codesandbox.io/s/github/dai-shi/apollo-link-lazy/tree/master/examples/01_minimal)\n[02](https://codesandbox.io/s/github/dai-shi/apollo-link-lazy/tree/master/examples/02_typescript)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdai-shi%2Fapollo-link-lazy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdai-shi%2Fapollo-link-lazy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdai-shi%2Fapollo-link-lazy/lists"}