{"id":15043106,"url":"https://github.com/peterpme/apollo-tote","last_synced_at":"2025-04-14T20:31:14.852Z","repository":{"id":57182408,"uuid":"101833491","full_name":"peterpme/apollo-tote","owner":"peterpme","description":"👜 A declarative approach to handling Apollo GraphQL queries in React","archived":false,"fork":false,"pushed_at":"2017-12-20T06:18:55.000Z","size":43,"stargazers_count":77,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T09:01:46.929Z","etag":null,"topics":["apollo","graphql","react"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterpme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-30T03:28:10.000Z","updated_at":"2022-02-03T01:14:50.000Z","dependencies_parsed_at":"2022-09-11T22:40:17.658Z","dependency_job_id":null,"html_url":"https://github.com/peterpme/apollo-tote","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterpme%2Fapollo-tote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterpme%2Fapollo-tote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterpme%2Fapollo-tote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterpme%2Fapollo-tote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterpme","download_url":"https://codeload.github.com/peterpme/apollo-tote/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248955503,"owners_count":21189138,"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","graphql","react"],"created_at":"2024-09-24T20:48:34.969Z","updated_at":"2025-04-14T20:31:14.498Z","avatar_url":"https://github.com/peterpme.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# apollo-tote\n\n👜 A declarative approach to handling Apollo queries in React\n\n[![npm version](https://badge.fury.io/js/apollo-tote.svg)](https://badge.fury.io/js/apollo-tote)\n\n## Installation\n\n```sh\nyarn add apollo-tote\n```\n\nor\n\n```sh\nnpm install --save apollo-tote\n```\n\n## Usage Examples\n\n- Fetch `current user` query. If an api token exists but is no longer valid (ie: cleared database), log user out.\n\n```jsx\n\u003cApolloTote\n    query={`\n      query {\n        user {\n          id\n        }\n      }\n    `}\n    test={data =\u003e !!(data \u0026\u0026 data.user \u0026\u0026 data.user.id)}\n    handleFail={() =\u003e Store.dispatch({ type: 'LOG_OUT' })}\n    handlePass={() =\u003e Store.dispatch({ type: 'LOG_IN' })}\n    renderError={error =\u003e this._renderError(error)}\n    renderLoading={() =\u003e \u003cApp.Loading /\u003e}\n    render={() =\u003e \u003cApp /\u003e}\n/\u003e\n```\n\n- Render loading component until data comes back.\n```jsx\n\u003cApolloTote\n    query={`\n      query {\n        user {\n          imageUrl\n        }\n      }\n    `}\n    renderLoading={() =\u003e \u003cAvatar.Loading /\u003e}\n    render={value =\u003e \u003cAvatar imageUrl={value.user.imageUrl} /\u003e}\n/\u003e\n```\n\n## PropTypes\n\n- `skip`: Boolean - Should we skip over query and just render?\n- `query`: String - Your graphql query\n- `variables`: String - Graphql query variables\n- `test`: Function (Optional) - helper to handle a successful query's response\n- `handlePass`: Function (Optional) - a function to render a successful `test`\n- `handleFail`: Function (Optional) - a function to render a failed `test`\n- `renderError`: Function - error function\n- `renderLoading`: Function - loading function\n- `render`: Function - a function that renders the result of your query\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterpme%2Fapollo-tote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterpme%2Fapollo-tote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterpme%2Fapollo-tote/lists"}