Typescript Type declaration on Inner Join?

I've got a query using the JS SDK that joins an inner table, but I'm not sure how I'm supposed to type it correctly.

albums_genres.album_id has a squiggly and the error Argument of type '"album_genres.album_id"' is not assignable to parameter of type 'keyof AlbumGenre'.ts(2345)

const { data: genres, error } = await supabase
  .from<AlbumGenre>("genres")
  .select("id, genre, album_genres!inner( sub_genre )")
  .eq("album_genres.album_id", album_id);


and my current type is

type AlbumGenre = {
  id: number;
  genre: string;
  album_genres?: {
    album_id: number;
    genre_id: number;
    sub_genre: boolean;
  }[];
};
Was this page helpful?