{"id":15046886,"url":"https://github.com/ryanhefner/apollo-link-contentful","last_synced_at":"2025-06-16T01:34:16.766Z","repository":{"id":57182315,"uuid":"294400148","full_name":"ryanhefner/apollo-link-contentful","owner":"ryanhefner","description":"🔗 An ApolloLink that lets you perform GraphQL queries against Contentful’s Rest API. No more, query size limits! No more, query complexities!!","archived":false,"fork":false,"pushed_at":"2023-07-13T13:15:53.000Z","size":562,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-29T03:21:20.937Z","etag":null,"topics":["apollo","apollo-link","contentful","contentful-api","contentful-js-sdk"],"latest_commit_sha":null,"homepage":"https://www.pkgstats.com/pkg:apollo-link-contentful","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/ryanhefner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ryanhefner","patreon":"ryanhefner","open_collective":"ryanhefner","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-09-10T12:15:13.000Z","updated_at":"2023-03-20T16:47:26.000Z","dependencies_parsed_at":"2024-06-21T13:10:59.018Z","dependency_job_id":"68862fd5-7868-44ba-9459-6239b00c27cc","html_url":"https://github.com/ryanhefner/apollo-link-contentful","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"df79263a5a026f82782a0be05e2be1a62711e54a"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhefner%2Fapollo-link-contentful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhefner%2Fapollo-link-contentful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhefner%2Fapollo-link-contentful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhefner%2Fapollo-link-contentful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanhefner","download_url":"https://codeload.github.com/ryanhefner/apollo-link-contentful/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219858899,"owners_count":16556039,"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","apollo-link","contentful","contentful-api","contentful-js-sdk"],"created_at":"2024-09-24T20:53:42.416Z","updated_at":"2024-10-11T20:01:36.550Z","avatar_url":"https://github.com/ryanhefner.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ryanhefner","https://patreon.com/ryanhefner","https://opencollective.com/ryanhefner"],"categories":[],"sub_categories":[],"readme":"# 🔗 apollo-link-contentful\n\n[![npm](https://img.shields.io/npm/v/apollo-link-contentful?style=flat-square)](https://www.pkgstats.com/pkg:apollo-link-contentful)\n[![NPM](https://img.shields.io/npm/l/apollo-link-contentful?style=flat-square)](https://www.pkgstats.com/pkg:apollo-link-contentful)\n[![npm](https://img.shields.io/npm/dt/apollo-link-contentful?style=flat-square)](https://www.pkgstats.com/pkg:apollo-link-contentful)\n[![Coveralls github](https://img.shields.io/coveralls/github/ryanhefner/apollo-link-contentful?style=flat-square)](https://coveralls.io/github/ryanhefner/apollo-link-contentful)\n![CircleCI](https://img.shields.io/circleci/build/github/ryanhefner/apollo-link-contentful?style=flat-square)\n\n\u003e 🚨 very alpha! in active development. 🚨\n\u003e All minor version changes (0.X.0) are likely to have breaking changes.\n\nPerform GraphQL queries against Contentful’s Rest API. No more, query size limits! No more, query complexities!!\n\n## Install\n\nVia [npm](https://npmjs.com/package/apollo-link-contentful)\n\n```sh\nnpm install --save apollo-link-contentful\n```\n\nVia [Yarn](https://yarn.fyi/apollo-link-contentful)\n\n```sh\nyarn add apollo-link-contentful\n```\n\n## How to use\n\n`ContentfulRestLink` makes it easy to query the Contentful REST API via GraphQL +\nApollo, without all the fuss about query size, nor complexity, limit issues. Simply\nsetup the `link` when you are creating your `ApolloClient`, then feel free to\nperform your `GraphQL` queries like you normally do.\n\nThe `ContentfulRestLink` class accepts two arguments, `clientOptions` and `queryDefaults` _(optional)_.\n\n* `clientOptions` - Accepts all Contentful Client options, reference available [here](https://contentful.github.io/contentful.js/contentful/7.14.6/contentful.html#.createClient).\n\n_The only exception is that if you plan to use the Contentful Preview API, you’ll have to include an optional `previewAccessToken`, which will create a client for all queries where `preview` variable is `true`._\n\n* `queryDefaults` - This is just a handy tool if you happen to have some defaults\nthat you would like to include for all queries being made to Contentful. Handy ones\nthat you might use would be, `{ include: 10, locale: 'en-US' }`. Where `include` sets\nthe depth of linked references to include in responses, [Link docs](https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/links),\nand `locale` specifies the localization of the entry(ies) returned, [Localization docs](https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/localization).\n\n## Example\n\n```js\nimport { ApolloClient, InMemoryCache } from '@apollo/client'\nimport { ContentfulRestLink } from 'apollo-link-contentful'\nimport possibleTypes from 'types/possibleTypes.json'\n\nconst space = process.env.CONTENTFUL_SPACE\nconst accessToken = process.env.CONTENTFUL_ACCESS_TOKEN\n\nconst apolloClient = new ApolloClient({\n  link: new ContentfulRestLink({\n    space,\n    accessToken,\n  }, {\n    include: 10,\n  }),\n  cache: new InMemoryCache({ possibleTypes }),\n});\n```\n\n## License\n\n[MIT](LICENSE) © [Ryan Hefner](https://www.ryanhefner.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanhefner%2Fapollo-link-contentful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanhefner%2Fapollo-link-contentful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanhefner%2Fapollo-link-contentful/lists"}