{"_id":"@anglinb/graphql-codegen-apollo-next-ssr","_rev":"1-5154156884f958db63f964dc900e3eee","name":"@anglinb/graphql-codegen-apollo-next-ssr","dist-tags":{"latest":"1.6.2"},"versions":{"1.6.2":{"name":"@anglinb/graphql-codegen-apollo-next-ssr","version":"1.6.2","description":"GraphQL Code Generator plugin for generating a functions to read and write from the apollo cache","license":"MIT","scripts":{"test":"jest","prepublish":"tsc","build":"tsc","codegen":"graphql-codegen --config codegen.yml","release":"standard-version"},"repository":{"type":"git","url":"git+https://github.com/correttojs/graphql-codegen-apollo-next-ssr.git"},"dependencies":{"@graphql-codegen/plugin-helpers":"^1.18.4","@graphql-codegen/visitor-plugin-common":"^1.20.0","auto-bind":"~4.0.0"},"peerDependencies":{"graphql":"^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"},"main":"build/src/index.js","devDependencies":{"@graphql-codegen/cli":"1.21.6","@graphql-codegen/fragment-matcher":"2.0.1","@graphql-codegen/import-types-preset":"1.18.5","@graphql-codegen/introspection":"1.18.2","@graphql-codegen/testing":"1.17.7","@graphql-codegen/typescript":"1.22.4","@graphql-codegen/typescript-operations":"1.18.3","@graphql-codegen/typescript-react-apollo":"2.3.0","@types/jest":"26.0.23","@types/node":"15.3.1","apollo-cache-inmemory":"1.6.6","apollo-client":"2.6.10","graphql":"15.5.1","graphql-codegen":"0.4.0","jest":"26.6.3","standard-version":"9.3.0","ts-jest":"26.5.6","typescript":"4.3.5"},"author":{"name":"Fabio Benedetti"},"keywords":["graphql","codegen","apollo-client","nextjs","grapgql-codegen"],"gitHead":"51c857d573954fc75ef9730b79e446c319c5167c","bugs":{"url":"https://github.com/correttojs/graphql-codegen-apollo-next-ssr/issues"},"homepage":"https://github.com/correttojs/graphql-codegen-apollo-next-ssr#readme","_id":"@anglinb/graphql-codegen-apollo-next-ssr@1.6.2","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-cOddWx/K0br1Zs0NzqCEiGS+V1HDU3L2vLBuJtz0UrblrkwQMgLI/dw49mBngV338/yrD3wiihKkXugiIqqFBg==","shasum":"d79c62086a611f0357a2ab7b7bdbfedd00b26945","tarball":"https://registry.npmjs.org/@anglinb/graphql-codegen-apollo-next-ssr/-/graphql-codegen-apollo-next-ssr-1.6.2.tgz","fileCount":19,"unpackedSize":119645,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg37ryCRA9TVsSAnZWagAAVYYP/2dVbftWYAANN+2wjJRz\nUWcroBTljhpo41j7bcjXGDbg+WCzR2Wq4ZirLlDKrnDVvybaQNhTrKRu/6rN\nm+P8MtQAFW7LrlxEtelzMDFGO1QSJ2SGz2+6cl9I8UqubdJyjBUpOWDMoBH7\n9v+pRzHMkl0C99Cc0yDKgZ9as1s6eexG5dAiR/zruuJgGQtaJAPbAWUV8NkD\n4bL+JpognxepbpDckRTkLnUeWcRxRT90w8UPwlB3VocBlmw6uYutFWCYr50+\nmJ3DVm/pb4wPJ+R9PdASfwYhBbqcN/INEm7+jrgGzJRSNM2wpS82mv4oeDWy\nvCF/XA8vRPj2mEoNjldIFgE4ARtsk+16eKg1Zg9XTpUTvtILCh+aJii7hQJI\n/MBtSKLZkkcg+vJMcInK4JEPdudW0lGYi+4nRxP1FGLWJgEZC0MWG2VxBuDE\nAWDZ9d3RuDLawX7nEcAQW6s+6Wex+faai0zx7fYZ8F1gmUXnXr0i9Dh5KISq\ncq8GwdYfzAm6GUEMng7pj99xyAMpSdtUPxJl8v2ZS8nK220c6Xme7IlQ2FhF\nJZIKa7nGQ59OuGej+uE4rfHalOh0RmHQL7T37g7lySzddDcVYTcbyoyh/8ma\nFXh2BBA36r5Wh/Y20jhUQ2+fhig76FODwDdwuMFNKMiAnshqW0gV3xqhFp7e\nfjY3\r\n=iCbs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCj1d2reFMjq5/3ohhJZtL84TLKkmMZtOHrqPwlch+X5QIgM8a+LIs4n/3N38n/IAz3f69mLvZgAM0zp6chZ1UfgRs="}]},"_npmUser":{"name":"anglinb","email":"brianranglin@gmail.com"},"directories":{},"maintainers":[{"name":"anglinb","email":"brianranglin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-codegen-apollo-next-ssr_1.6.2_1625275121771_0.8505516895421343"},"_hasShrinkwrap":false}},"time":{"created":"2021-07-03T01:18:41.692Z","1.6.2":"2021-07-03T01:18:41.934Z","modified":"2022-04-04T14:06:11.336Z"},"maintainers":[{"name":"anglinb","email":"brianranglin@gmail.com"}],"description":"GraphQL Code Generator plugin for generating a functions to read and write from the apollo cache","homepage":"https://github.com/correttojs/graphql-codegen-apollo-next-ssr#readme","keywords":["graphql","codegen","apollo-client","nextjs","grapgql-codegen"],"repository":{"type":"git","url":"git+https://github.com/correttojs/graphql-codegen-apollo-next-ssr.git"},"author":{"name":"Fabio Benedetti"},"bugs":{"url":"https://github.com/correttojs/graphql-codegen-apollo-next-ssr/issues"},"license":"MIT","readme":"# graphql-codegen-apollo-next-ssr\nGenerate apollo code for nextjs ssr\n\n## Motivations\n\nNextjs recently introduced `getServerSideProps` which doesn't allow to use the HOC pattern adopted by the official apollo graphql plugin (based on `getInitialProps`). At the same time the SSR method offered by apollo client (`getDataFromTree` ) enforces the react app to render multiple times in order to collect and fetch all the relevant queries.\nBy declaring a top level query we can save rendering time and provide a simpler pattern which works with `getServerSideProps `. This plugin generates a typesafe version of `getServerSideProps ` for each server query, and the corresponding HOC to wrap the react component returning the cache result. The limitation/advantage of this solution is that all the queries embedded into inner react components are ignored, unless covered by the top level 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- `apolloCacheImportFrom` (default: apollo-cache-inmemory v2 or @apollo/client v3): apollo cache client dependency\n- `apolloStateKey` (default: apolloState): Key used for storing Apollo state\n- `withHooks` (default: false): Customized the output by enabling/disabling the generated React Hooks.\n- `withHOC` (default: true):  Customized the output by enabling/disabling the HOC.\n- `customImports` (default: ''): full custom import declaration\n- `contextType` (default: 'any'): Contex type passed to getApolloClient\n- `contextTypeRequired` (default: false): If the context should be required when called from getServerSideProps\n- `pre` (default: ''): custom code before each function\n- `post` (default: ''):  custom code after each function\n- `apolloClientInstanceImport`(default: ''): Add apolloClient instance imports\n- `replaceQuery` (default: false): Replace \"query\" keyword inside the generated operations \n- `replacePage` (default: false): Replace \"page\" keyword inside the generated operations \n- `reactImport` (default: import type React from 'react';): custom react import \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/page.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```\n","readmeFilename":"README.md"}