apollo-server: Typescript Error after update to apollo-server-express 2.11.0

I update apollo-server-express package from 2.10.1 to 2.11.0 and during the build process of the application I get the following Typescript error message:

node_modules/@apollo/gateway/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.

When I return back to version 2.10.1, everything is ok.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 15
  • Comments: 19 (5 by maintainers)

Most upvoted comments

FYI I had the same issue updating from apollo-server@2.13.0 to apollo-server@2.13.1.

Fixed by installing apollo-cache-control@^0.10.1-alpha.0.

@abernix Is it correct that apollo-server-core 2.13.1 references a lot of alpha dependencies?

apollo-server-core@^2.13.1:
  version "2.13.1"
  resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-2.13.1.tgz#eac223696ae9da5f4990273ea89c74b77af0e156"
  integrity sha512-4jKF0VbpoxprhcruaGoHG5ScrquSSkQ/LVFrOLp/ukUFuooLEMb1O18tAQdgVahkNgLkRKdNJYLLyoQoj+i3dA==
  dependencies:
    "@apollographql/apollo-tools" "^0.4.3"
    "@apollographql/graphql-playground-html" "1.6.24"
    "@types/graphql-upload" "^8.0.0"
    "@types/ws" "^7.0.0"
    apollo-cache-control "^0.10.1-alpha.0"
    apollo-datasource "^0.7.1-alpha.0"
    apollo-engine-reporting "^1.8.1-alpha.0"
    apollo-server-caching "^0.5.1"
    apollo-server-env "^2.4.4-alpha.0"
    apollo-server-errors "^2.4.1"
    apollo-server-plugin-base "^0.8.1-alpha.0"
    apollo-server-types "^0.4.1-alpha.0"
    apollo-tracing "^0.10.1-alpha.0"
    fast-json-stable-stringify "^2.0.0"
    graphql-extensions "^0.12.1-alpha.0"
    graphql-tag "^2.9.2"
    graphql-tools "^4.0.0"
    graphql-upload "^8.0.2"
    loglevel "^1.6.7"
    sha.js "^2.4.11"
    subscriptions-transport-ws "^0.9.11"
    ws "^6.0.0"