Skip to content

TypeScript compilation error with latest apollo packages #577

@bbugh

Description

@bbugh

It looks like Apollo changed some types in the latest versions, and vue-apollo is no longer compiling.

I'm on "vue-apollo": "^3.0.0-beta.28",

Here are the packages I upgraded to:

  "dependencies": {
    "apollo-cache-inmemory": "^1.5.1",
    "apollo-client": "^2.5.1",
    "apollo-link": "^1.2.11",
    "apollo-link-context": "^1.0.17",
    "apollo-link-error": "^1.1.10",
    "apollo-link-http": "^1.5.14",
    "apollo-link-ws": "^1.0.17",
    "apollo-utilities": "^1.2.1",
  },
  "devDependencies": {
    "@types/graphql": "^14.2.0",
  }
ERROR in /Users/bbugh/projects/project-name/develop/node_modules/apollo-client/core/LocalState.d.ts
ERROR in /Users/bbugh/projects/project-name/develop/node_modules/apollo-client/core/LocalState.d.ts(39,23):
TS2315: Type 'ExecutionResult' is not generic.

ERROR in /Users/bbugh/projects/project-name/develop/node_modules/apollo-client/core/LocalState.d.ts
ERROR in /Users/bbugh/projects/project-name/develop/node_modules/apollo-client/core/LocalState.d.ts(43,17):
TS2315: Type 'ExecutionResult' is not generic.

ERROR in /Users/bbugh/projects/project-name/develop/node_modules/vue-apollo/types/options.d.ts
ERROR in /Users/bbugh/projects/project-name/develop/node_modules/vue-apollo/types/options.d.ts(47,18):
TS2430: Interface 'VueApolloMutationOptions<V, R>' incorrectly extends interface 'MutationOptions<R, OperationVariables>'.
  Types of property 'mutation' are incompatible.
    Type 'import("/Users/bbugh/projects/project-name/develop/node_modules/@types/graphql/language/ast").DocumentNode' is not assignable to type 'import("/Users/bbugh/projects/project-name/develop/node_modules/apollo-client/node_modules/@types/graphql/language/ast").DocumentNode'.
      Types of property 'loc' are incompatible.
        Type 'import("/Users/bbugh/projects/project-name/develop/node_modules/@types/graphql/language/ast").Location | undefined' is not assignable to type 'import("/Users/bbugh/projects/project-name/develop/node_modules/apollo-client/node_modules/@types/graphql/language/ast").Location | undefined'.
          Type 'import("/Users/bbugh/projects/project-name/develop/node_modules/@types/graphql/language/ast").Location' is not assignable to type 'import("/Users/bbugh/projects/project-name/develop/node_modules/apollo-client/node_modules/@types/graphql/language/ast").Location'.
            Types of property 'startToken' are incompatible.
              Type 'import("/Users/bbugh/projects/project-name/develop/node_modules/@types/graphql/language/ast").Token' is not assignable to type 'import("/Users/bbugh/projects/project-name/develop/node_modules/apollo-client/node_modules/@types/graphql/language/ast").Token'.
                Types of property 'kind' are incompatible.
                  Type '"<SOF>" | "<EOF>" | "!" | "$" | "(" | ")" | "..." | ":" | "=" | "@" | "[" | "]" | "{" | "|" | "}" | "Name" | "Int" | "Float" | "String" | "BlockString" | "Comment" | "&"' is not assignable to type 'TokenKind'.
                    Type '"&"' is not assignable to type 'TokenKind'.

ERROR in /Users/bbugh/projects/project-name/develop/node_modules/vue-apollo/types/options.d.ts
ERROR in /Users/bbugh/projects/project-name/develop/node_modules/vue-apollo/types/options.d.ts(53,18):
TS2430: Interface 'VueApolloSubscriptionOptions<V, R>' incorrectly extends interface 'SubscriptionOptions<OperationVariables>'.
  Types of property 'query' are incompatible.
    Type 'import("/Users/bbugh/projects/project-name/develop/node_modules/@types/graphql/language/ast").DocumentNode' is not assignable to type 'import("/Users/bbugh/projects/project-name/develop/node_modules/apollo-client/node_modules/@types/graphql/language/ast").DocumentNode'.

The ExecutionResult errors may be related to apollographql/apollo-link#910, but the VueApolloSubscriptionOptions<V, R> are in vue-apollo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions