{"id":22004552,"url":"https://github.com/slicknode/slicknode-apollo","last_synced_at":"2026-04-15T15:44:23.376Z","repository":{"id":57363080,"uuid":"149664384","full_name":"slicknode/slicknode-apollo","owner":"slicknode","description":null,"archived":false,"fork":false,"pushed_at":"2018-12-01T21:38:17.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-28T12:46:16.789Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/slicknode.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-09-20T20:06:40.000Z","updated_at":"2018-12-01T21:38:19.000Z","dependencies_parsed_at":"2022-09-26T16:32:23.323Z","dependency_job_id":null,"html_url":"https://github.com/slicknode/slicknode-apollo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slicknode%2Fslicknode-apollo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slicknode%2Fslicknode-apollo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slicknode%2Fslicknode-apollo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slicknode%2Fslicknode-apollo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slicknode","download_url":"https://codeload.github.com/slicknode/slicknode-apollo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245062889,"owners_count":20554812,"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":[],"created_at":"2024-11-30T00:16:28.536Z","updated_at":"2026-04-15T15:44:23.340Z","avatar_url":"https://github.com/slicknode.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DEPRECATED: \n\nThis project is deprecated in favor of [`slicknode-apollo-link`](https://github.com/slicknode/slicknode-apollo-link).\nThis allows for more fine grained control of the network / request layer and can be combined\nwith all other apollo link components. \n\n\n# Slicknode Apollo\n\nApollo client with recommended defaults and built in authentication to work with\nSlicknode GraphQL servers. \n\n\n## Installation\n\nInstall the client and required packages via npm:\n\n    npm install slicknode-apollo graphql --save\n\n\n## Usage\n\nWith the dependencies installed, you can create an instance of the ApolloClient with Slicknode\nsupport enabled. You only need the endpoint of your Slicknode GraphQL server that you can\nget via `slicknode endpoint` from your project. \n\n```javascript\nimport ApolloClient from 'slicknode-apollo';\n\nconst client = new ApolloClient({\n  endpoint: 'https://myproject.slicknode.com'\n});\n```\n\nThis client is a regular ApolloClient instance with the data fetching logic for Slicknode\npreconfigured. Authentication headers are automatically added, when the `accessToken` expires\nand a query is fetched via the client, it is automatically refreshed in the background\nwithout requiring any interruption to the user. \n\n\n## Authentication\n\nYou can use any of the available Authenticators to obtain a set of auth tokens and their expiration\ntimes. We'll use the `slicknode-auth-email-password` authenticator as an example. For more details\ncheck the documentation of the authenticators.\n\nAlways make sure that you have the module installed in your Slicknode server, otherwise the required\nmutations are not available. \n\n\n### Example Email / Password\n\nInstall the dependencies via npm\n\n    npm install slicknode-auth-email-password --save\n\nThen in your application you can authenticate the user:\n\n```javascript\nimport loginEmailPassword from 'slicknode-auth-email-password';\n\nclient.authenticate(loginEmailPassword('email@example.com', 'password123'))\n    .then(() =\u003e {\n      console.log('Login successful, redirect to user home page');\n    })\n    .catch(err =\u003e {\n      console.log('Something went wrong, try again: ' + err.message);\n    });\n```\n\n### Logout\n\nTo delete all the access and refresh tokens from the builtin token storage, simply log the user out:\n\n```javascript\nclient.logout()\n  .then(() =\u003e {\n    console.log('Login successful');\n  })\n  .catch(err =\u003e {\n    console.log('Something went wrong: ' + err.message);\n  });\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslicknode%2Fslicknode-apollo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslicknode%2Fslicknode-apollo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslicknode%2Fslicknode-apollo/lists"}