{"id":15397019,"url":"https://github.com/ryanhefner/apollo-contentful-rest-link","last_synced_at":"2026-04-18T15:32:55.966Z","repository":{"id":57182293,"uuid":"287160869","full_name":"ryanhefner/apollo-contentful-rest-link","owner":"ryanhefner","description":"🔗 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-13T12:53:40.000Z","size":1694,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T02:14:26.581Z","etag":null,"topics":["apollo","apollo-link","contentful","contentful-api","graphql","graphql-anywhere"],"latest_commit_sha":null,"homepage":"https://www.pkgstats.com/pkg:apollo-contentful-rest-link","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-08-13T02:22:30.000Z","updated_at":"2023-07-13T12:53:49.000Z","dependencies_parsed_at":"2024-10-19T04:25:16.556Z","dependency_job_id":null,"html_url":"https://github.com/ryanhefner/apollo-contentful-rest-link","commit_stats":{"total_commits":49,"total_committers":1,"mean_commits":49.0,"dds":0.0,"last_synced_commit":"1eb2313874aefe4216e6d6c67847096d220b59ba"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhefner%2Fapollo-contentful-rest-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhefner%2Fapollo-contentful-rest-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhefner%2Fapollo-contentful-rest-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanhefner%2Fapollo-contentful-rest-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanhefner","download_url":"https://codeload.github.com/ryanhefner/apollo-contentful-rest-link/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245944109,"owners_count":20697960,"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","graphql","graphql-anywhere"],"created_at":"2024-10-01T15:35:51.186Z","updated_at":"2026-04-18T15:32:55.898Z","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-contentful-rest-link\n\n[![npm](https://img.shields.io/npm/v/apollo-contentful-rest-link?style=flat-square)](https://www.pkgstats.com/pkg:apollo-contentful-rest-link)\n[![NPM](https://img.shields.io/npm/l/apollo-contentful-rest-link?style=flat-square)](https://www.pkgstats.com/pkg:apollo-contentful-rest-link)\n[![npm](https://img.shields.io/npm/dt/apollo-contentful-rest-link?style=flat-square)](https://www.pkgstats.com/pkg:apollo-contentful-rest-link)\n[![Coveralls github](https://img.shields.io/coveralls/github/ryanhefner/apollo-contentful-rest-link?style=flat-square)](https://coveralls.io/github/ryanhefner/apollo-contentful-rest-link)\n![CircleCI](https://img.shields.io/circleci/build/github/ryanhefner/apollo-contentful-rest-link?style=flat-square)\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-contentful-rest-link)\n\n```sh\nnpm install --save apollo-contentful-rest-link\n```\n\nVia [Yarn](https://yarn.fyi/apollo-contentful-rest-link)\n\n```sh\nyarn add apollo-contentful-rest-link\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-contentful-rest-link'\nimport introspectionQueryResultData from 'schema/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-contentful-rest-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanhefner%2Fapollo-contentful-rest-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanhefner%2Fapollo-contentful-rest-link/lists"}