https://supabase.com/ logo
Join Discord
Powered by
# help
  • n

    Needle

    06/13/2022, 2:19 PM
    Hello @Dembe! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
  • h

    hieu

    07/26/2021, 9:47 AM
    Thanks for the details @User . Let wait for @User reply then
    w
    • 2
    • 1
  • f

    fenix

    07/27/2021, 5:11 PM
    You changed the call to
    Copy code
    javascript
    supabase.from('game_directory').select(`*, users_games(*)`).eq('id', user.id);
    right?
  • f

    Flyken

    07/27/2021, 5:12 PM
    yea
  • f

    Flyken

    07/27/2021, 5:12 PM
    but just to be sure let me copy pasta
  • f

    Flyken

    07/27/2021, 5:12 PM
    same
  • f

    Flyken

    07/27/2021, 5:12 PM
    also, it only seems to work after a save, not a refresh
  • f

    Flyken

    07/27/2021, 5:13 PM
    when i refresh it returns undefined
  • f

    frubalu

    07/27/2021, 5:13 PM
    not to butt in here 😬 but shouldn't it be
    supabase.from('game_directories')...
    ?
  • f

    Flyken

    07/27/2021, 5:13 PM
    no
  • f

    Flyken

    07/27/2021, 5:13 PM
    the games don't have directories
  • f

    Flyken

    07/27/2021, 5:13 PM
    so its a directory of games, hence, game_directory :)
  • f

    Flyken

    07/27/2021, 5:13 PM
    also heres my stuff just to get an overall view
  • f

    Flyken

    07/27/2021, 5:13 PM
    Copy code
    js
    const fetchGames = async () => {
        if (!user) return;
    
        let { data, error } = await supabase.from('game_directory').select(`*, users_games(*)`).eq('id', user.id);
    
        if (error) return error;
        if (data) return data;
        };
    
        useEffect(() => {
            fetchGames()
                .then((res) => {
                    console.log(res);
                })
                .catch((error) => {
                    console.log(error);
                });
        }, []);
  • f

    frubalu

    07/27/2021, 5:13 PM
    i see, nvm!
  • f

    Flyken

    07/27/2021, 5:14 PM
    this returns undefined on refresh, but if i edit the file, save, then look at console without refreshing the page, it'll return
  • f

    Flyken

    07/27/2021, 5:14 PM
    seems like its outrunning itself some how?
  • f

    frubalu

    07/27/2021, 5:14 PM
    did i see you say that you're using NextJS?
  • f

    Flyken

    07/27/2021, 5:14 PM
    yes
  • f

    frubalu

    07/27/2021, 5:16 PM
    if you
    console.log(error)
    , does that return anything?
  • f

    Flyken

    07/27/2021, 5:17 PM

    https://cdn.discordapp.com/attachments/843999948717555735/869627128017195098/unknown.pngâ–¾

  • f

    Flyken

    07/27/2021, 5:17 PM
    the marked out bit is my auth id
  • f

    frubalu

    07/27/2021, 5:17 PM
    are you using GraphQL?
  • f

    Flyken

    07/27/2021, 5:17 PM
    uuuhhhh
  • f

    Flyken

    07/27/2021, 5:18 PM
    im using whatever supabase uses :l
  • f

    Flyken

    07/27/2021, 5:18 PM
    ¯\_(ツ)_/¯
  • f

    frubalu

    07/27/2021, 5:18 PM
    oh haha. reason i ask, is because i'll usually see those errors when types are mismatched for the mutation inputs
  • f

    frubalu

    07/27/2021, 5:19 PM
    so the name of the table you're trying to query from inside of Supabase is called
    game_directory
    ?
  • f

    Flyken

    07/27/2021, 5:19 PM
    uh
  • f

    Flyken

    07/27/2021, 5:19 PM
    see this is where its confusing
12345...316Latest