cacheControl type issues
See original GitHub issueUsing "apollo-server-testing": "^2.9.4",
as a dependency in our project for graphql testing. When i try to build our Typescript project get the following error
node_modules/apollo-server-testing/node_modules/apollo-cache-control/dist/index.d.ts:24:9 - error TS2717: Subsequent property declarations must have the same type. Property 'cacheControl' must be of type '{ setCacheHint: (hint: CacheHint) => void; cacheHint: CacheHint; }', but here has type '{ setCacheHint: (hint: CacheHint) => void; cacheHint: CacheHint; }'.
24 cacheControl: {
~~~~~~~~~~~~
node_modules/apollo-cache-control/dist/index.d.ts:24:9
24 cacheControl: {
~~~~~~~~~~~~
'cacheControl' was also declared here.
both the types seem same to me so not sure what’s the issue that TS is having? 😕
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:16 (4 by maintainers)
Top Results From Across the Web
Cache-Control - HTTP - MDN Web Docs
The Cache-Control HTTP header field holds directives (instructions) — in both requests and responses — that control caching in browsers and ...
Read more >Server-side caching - Apollo GraphQL Docs
Type -level definitions. This example defines cache control settings for all schema fields that return a Post object:.
Read more >What is Cache-Control and How HTTP Cache Headers Work
Cache-control is an HTTP header used to specify browser caching policies in both client requests and server responses. Policies include how a resource...
Read more >How do I solve this Apollo Control Cache error?
node_modules/apollo-cache-control/dist/index.d.ts:24:9 - error TS2717: Subsequent property declarations must have the same type.
Read more >apollo/cache-control-types - npm package
Learn more about @apollo/cache-control-types: package health score, popularity, security, maintenance, ... No known security issues.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I faced the same issue while I was working on NestJS and GraphQL. But I fixed it. You can fix it by following these steps.
Remove the following packages (@nestjs/graphql graphql-tools graphql apollo-server-express) by yarn remove @nestjs/graphql graphql-tools graphql apollo-server-express
Once done install these packages again at the same time using yarn yarn add @nestjs/graphql graphql-tools graphql apollo-server-express
Note: If you are using fastify you will do the same steps with fastify instead of express i.e apollo-server-fastify
What worked for me was to remove
node_modules
directory andpackage-lock.json
file and reinstall dependencies.