Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface 'ApolloQueryControllerOptions<D, V>' cannot simultaneously extend types 'ApolloControllerOptions<D, V>' and 'Partial<WatchQueryOptions<Variables<D, V>, Data<D>>>' #277

Open
LasseRosenow opened this issue Feb 21, 2023 · 3 comments · May be fixed by #278
Labels
bug Something isn't working

Comments

@LasseRosenow
Copy link

Package

@apollo-elements/core

Description

I get this error when building my project:

node_modules/@apollo-elements/core/apollo-query-controller.d.ts:6:18 - error TS2320: Interface 'ApolloQueryControllerOptions<D, V>' cannot simultaneously extend types 'ApolloControllerOptions<D, V>' and 'Partial<WatchQueryOptions<Variables<D, V>, Data<D>>>'.
  Named property 'context' of types 'ApolloControllerOptions<D, V>' and 'Partial<WatchQueryOptions<Variables<D, V>, Data<D>>>' are not identical.

export interface ApolloQueryControllerOptions<D, V = VariablesOf<D>> extends ApolloControllerOptions<D, V>, Partial<WatchQueryOptions<Variables<D, V>, Data<D>>> {
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

and

node_modules/@apollo-elements/core/apollo-query-controller.d.ts:6:135 - error TS2344: Type 'Variables<D, V>' does not satisfy the constraint 'OperationVariables'.
  Type 'unknown' is not assignable to type 'OperationVariables'.

export interface ApolloQueryControllerOptions<D, V = VariablesOf<D>> extends ApolloControllerOptions<D, V>, Partial<WatchQueryOptions<Variables<D, V>, Data<D>>> {

and

node_modules/@apollo-elements/core/types.d.ts:13:78 - error TS2344: Type 'Variables<D, V>' does not satisfy the constraint 'OperationVariables'.
  Type 'unknown' is not assignable to type 'OperationVariables'.

export declare type NextFetchPolicyFunction<D, V> = (this: WatchQueryOptions<Variables<D, V>, Data<V>>, lastFetchPolicy: WatchQueryFetchPolicy) => WatchQueryFetchPolicy;
                                                                                ~~~~~~~~~~~~~~~

Steps To Reproduce

  1. Create a new project for example with "lit" framework
  2. Use up to date packages (typescript etc.)
  3. run build
  4. see error

Expected Behavior

No error

@LasseRosenow LasseRosenow added the bug Something isn't working label Feb 21, 2023
@LasseRosenow LasseRosenow changed the title Apollo Elements Bug Interface 'ApolloQueryControllerOptions<D, V>' cannot simultaneously extend types 'ApolloControllerOptions<D, V>' and 'Partial<WatchQueryOptions<Variables<D, V>, Data<D>>>'. Feb 22, 2023
@LasseRosenow LasseRosenow changed the title Interface 'ApolloQueryControllerOptions<D, V>' cannot simultaneously extend types 'ApolloControllerOptions<D, V>' and 'Partial<WatchQueryOptions<Variables<D, V>, Data<D>>>'. Interface 'ApolloQueryControllerOptions<D, V>' cannot simultaneously extend types 'ApolloControllerOptions<D, V>' and 'Partial<WatchQueryOptions<Variables<D, V>, Data<D>>>' Feb 22, 2023
@bennypowers
Copy link
Member

Which typescript version?
Paste your package JSON please

@bennypowers bennypowers linked a pull request Feb 22, 2023 that will close this issue
@LasseRosenow
Copy link
Author

LasseRosenow commented Feb 26, 2023

Typescript: 4.9

{
  "name": "uk2-architecture",
  "version": "0.0.0",
  "scripts": {
    "start": "npm run start:dev",
    "start:dev": "vite --mode development --host",
    "start:prod": "vite --mode production",
    "build:dev": "graphql-codegen && tsc && vite build --mode development",
    "build:prod": "graphql-codegen && tsc && vite build --mode production",
    "serve": "vite preview",
    "graphql-codegen": "graphql-codegen"
  },
  "dependencies": {
    "@apollo-elements/core": "^2.1.2",
    "@apollo/client": "^3.7.9",
    "@fontsource/playfair-display": "^4.5.13",
    "@fontsource/quicksand": "^4.5.12",
    "@googlemaps/js-api-loader": "^1.15.1",
    "lit": "2.6.1"
  },
  "devDependencies": {
    "@graphql-codegen/cli": "^3.1.0",
    "@graphql-codegen/typed-document-node": "^3.0.1",
    "@graphql-codegen/typescript": "^3.0.1",
    "@graphql-codegen/typescript-operations": "^3.0.1",
    "@types/google.maps": "^3.52.0",
    "@typescript-eslint/eslint-plugin": "^5.53.0",
    "@typescript-eslint/parser": "^5.53.0",
    "eslint": "^8.34.0",
    "graphql": "^16.6.0",
    "postcss-lit": "^1.0.1",
    "stylelint": "^15.2.0",
    "stylelint-config-standard": "^30.0.1",
    "ts-lit-plugin": "^1.2.1",
    "tslib": "^2.5.0",
    "typescript": "^4.9.5",
    "vite": "^4.1.4"
  },
  "staticFiles": {
    "staticPath": "public",
    "watcherGlob": "**"
  }
}

@kito99
Copy link

kito99 commented Apr 15, 2024

@bennypowers we run into this with just about every recent version of typescript, even the one in package.json (4.6.3). Which version are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants