{"id":15466957,"url":"https://github.com/correttojs/graphql-codegen-apollo-cache","last_synced_at":"2025-04-30T22:24:32.960Z","repository":{"id":39453148,"uuid":"272070155","full_name":"correttojs/graphql-codegen-apollo-cache","owner":"correttojs","description":"GraphQL Code Generator plugin for generating a functions to read and write from the apollo cache","archived":false,"fork":false,"pushed_at":"2023-01-10T01:06:01.000Z","size":2029,"stargazers_count":10,"open_issues_count":24,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T22:01:59.862Z","etag":null,"topics":["apollo-cache-inmemory","apollo-client","codegen","graphql","graphql-code-generator","graphql-codegen","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/correttojs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-06-13T19:08:36.000Z","updated_at":"2024-01-26T14:59:41.000Z","dependencies_parsed_at":"2023-02-08T16:16:41.761Z","dependency_job_id":null,"html_url":"https://github.com/correttojs/graphql-codegen-apollo-cache","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/correttojs%2Fgraphql-codegen-apollo-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/correttojs%2Fgraphql-codegen-apollo-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/correttojs%2Fgraphql-codegen-apollo-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/correttojs%2Fgraphql-codegen-apollo-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/correttojs","download_url":"https://codeload.github.com/correttojs/graphql-codegen-apollo-cache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251662171,"owners_count":21623604,"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-cache-inmemory","apollo-client","codegen","graphql","graphql-code-generator","graphql-codegen","typescript"],"created_at":"2024-10-02T01:16:08.016Z","updated_at":"2025-04-30T22:24:32.941Z","avatar_url":"https://github.com/correttojs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NOTE: You can use [TypedDocumentNode](https://github.com/dotansimha/graphql-typed-document-node) instead\n\nsee the [example](example/src/index.ts)\n\n# Graphql generator Apollo Cache Plugin\n\nGraphQL Code Generator plugin for generating a functions to read and write from the apollo cache\n\n\n\n## Install\n`npm i graphql-codegen-apollo-cache`\n\n## Configuration\n- `excludePatterns` (default: null): regexp to exclude operation names\n- `excludePatternsOptions` (default: ''): regexp flags to exclude operation names\n- `reactApolloVersion` (default: 2): apollo client version\n- `apolloCacheImportFrom` (default: apollo-cache-inmemory): apollo-cache-inmemory dependency\n- `apolloImportFrom` (default: apollo-client v2 or @apollo/client v3): apollo client dependency\n- `dataIdFromObjectImport` (default: apollo-cache-inmemory): custom dataIdFromObject dependency\n- `dataIdFromObjectName`:  dataIdFromObject function name\n- `generateFragmentsRead`(default: true): generate fragments read functions\n- `generateFragmentsWrite`(default: true): generate fragments write functions\n- `generateQueriesWrite`(default: true): generate query read functions\n- `generateQueriesWrite`(default: true): generate query write functions\n- `customImports` (default: ''): full custom import declaration\n- `pre` (default: ''): custom code before each function\n- `post` (default: ''):  custom code after each function\n\n## Example config\n\n```\noverwrite: true\nschema:\n    - 'https://myschema/graphql'\ndocuments:\n    - 'src/**/*.graphql'\ngenerates:\n    src/@types/codegen/graphql.tsx:\n        plugins:\n            - 'typescript'\n            - 'typescript-operations'\n            - 'typescript-react-apollo'\n    src/@types/codegen/cache.tsx:\n        config:\n            documentMode: external\n            importDocumentNodeExternallyFrom: ./graphql\n        preset: import-types\n        presetConfig:\n            typesPath: ./graphql\n        plugins:\n            - ./build/src/index.js\nhooks:\n    afterAllFileWrite:\n        - prettier --write\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorrettojs%2Fgraphql-codegen-apollo-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorrettojs%2Fgraphql-codegen-apollo-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorrettojs%2Fgraphql-codegen-apollo-cache/lists"}