question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cacheControl type issues

See original GitHub issue

Using "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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

21reactions
umarnaeem432commented, Mar 4, 2020

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

13reactions
mjraadicommented, Nov 22, 2019

What worked for me was to remove node_modules directory and package-lock.json file and reinstall dependencies.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found