Email or username:

Password:

Forgot your password?
Alex Gleason

Overall I love TypeScript. But sometimes it’s so frustrating…

No overload matches this call.
  Overload 1 of 2, '(queryKey: QueryKey, updater: Updater<InfiniteQueryObserverLoadingErrorResult<Record<{ account: EmbeddedEntity<Account | ReducerAccount>; id: string; unread: number; last_message: string | null; updated_at: Date; }> & Readonly<...>, unknown> | InfiniteQueryObserverLoadingResult<...> | InfiniteQueryObserverRefetchErrorResult<...> | InfiniteQueryObserverSuccessResult<...> | undefined, InfiniteQueryObserverLoadingErrorResult<...> | ... 3 more ... | undefined>, options?: SetDataOptions | undefined): [...][]', gave the following error.
    Argument of type '(chatPages: UseInfiniteQueryResult<Chat>) => { pages: any[]; pageParams: unknown[]; } | undefined' is not assignable to parameter of type 'Updater<InfiniteQueryObserverLoadingErrorResult<Record<{ account: EmbeddedEntity<Account | ReducerAccount>; id: string; unread: number; last_message: string | null; updated_at: Date; }> & Readonly<...>, unknown> | InfiniteQueryObserverLoadingResult<...> | InfiniteQueryObserverRefetchErrorResult<...> | InfiniteQueryO...'.
      Type '(chatPages: UseInfiniteQueryResult<Chat>) => { pages: any[]; pageParams: unknown[]; } | undefined' is not assignable to type 'DataUpdateFunction<InfiniteQueryObserverLoadingErrorResult<Record<{ account: EmbeddedEntity<Account | ReducerAccount>; id: string; unread: number; last_message: string | null; updated_at: Date; }> & Readonly<...>, unknown> | InfiniteQueryObserverLoadingResult<...> | InfiniteQueryObserverRefetchErrorResult<...> | Inf...'.
        Types of parameters 'chatPages' and 'input' are incompatible.
          Type 'InfiniteQueryObserverLoadingErrorResult<Record<{ account: EmbeddedEntity<Account | ReducerAccount>; id: string; unread: number; last_message: string | null; updated_at: Date; }> & Readonly<...>, unknown> | InfiniteQueryObserverLoadingResult<...> | InfiniteQueryObserverRefetchErrorResult<...> | InfiniteQueryObserverS...' is not assignable to type 'UseInfiniteQueryResult<Record<{ account: EmbeddedEntity<Account | ReducerAccount>; id: string; unread: number; last_message: string | null; updated_at: Date; }> & Readonly<...>, unknown>'.
            Type 'undefined' is not assignable to type 'UseInfiniteQueryResult<Record<{ account: EmbeddedEntity<Account | ReducerAccount>; id: string; unread: number; last_message: string | null; updated_at: Date; }> & Readonly<...>, unknown>'.
  Overload 2 of 2, '(filters: QueryFilters, updater: Updater<InfiniteQueryObserverLoadingErrorResult<Record<{ account: EmbeddedEntity<Account | ReducerAccount>; id: string; unread: number; last_message: string | null; updated_at: Date; }> & Readonly<...>, unknown> | InfiniteQueryObserverLoadingResult<...> | InfiniteQueryObserverRefetchErrorResult<...> | InfiniteQueryObserverSuccessResult<...> | undefined, InfiniteQueryObserverLoadingErrorResult<...> | ... 3 more ... | undefined>, options?: SetDataOptions | undefined): [...][]', gave the following error.
    Type 'string[]' has no properties in common with type 'QueryFilters'.ts(2769)
9 comments
Josh Adams
It doesn't look inscrutable, just like it's telling you a couple things it could have been but how far off each was
Alex Gleason
I expect a stack trace. I don't expect a query plan. It needs one of those websites where you can paste the TypeScript error in and it tells you in English what's going on.

Anyway I fixed it, the two objects were indeed different. But it's like I Spy in that message!
NEETzsche
@e @alex @josh As though JavaScript weren't soyware enough.
ew
@NEETzsche @alex @josh productivity is better due to the tooling
ew
@NEETzsche @alex @josh

auto-generating your own admin interface
https://adminjs.co/
auto-generating your own api calls
https://www.the-guild.dev/graphql/codegen
auto-generating your own api layer
https://www.graphile.org/postgraphile/
auto-generating your own validation layers
https://www.npmjs.com/package/typescript-json-schema
auto-generating typed sql calls
https://github.com/adelsz/pgtyped

I can keep going lol
@NEETzsche @alex @josh

auto-generating your own admin interface
https://adminjs.co/
auto-generating your own api calls
Alex Gleason
I want to see your repo of what you're building.
Go Up