Error: GraphQL error: db is not defined

Hello here,

I’ve had a couple of issues while trying to… install a lib to check isbn numbers.
Leaving out the painful details ( had to reinstall all modules a couple of times ), for some reason yet to discover my redwood app is not fully working.

I manage to run yarn rw dev and the homepage shows up nicely.
However as soon as I use GraphQL i get this:

Error: GraphQL error: db is not defined

I’ve reinstalled my dependencies using yarn and had no problem on my latest try, so I don’t know where I should start looking to debug this one, except:

  • Redwoodjs module seems complete
    - upgraded from 0.2.X to 0.6.0

I’d really appreciate any help :slight_smile:

Hi @noire.munich It does sound like you might have upgraded Redwood but possibly missed some manual file changes required in v0.3.2. If you jumped from v0.2 to v0.6, this might be possible in your case.

You should look back through the “How to upgrade” section of each version release notes. Or just start with a new installation using yarn create redwood-app.

Does that make sense? And possible for you?


Hello @thedavid and many thanks for your help.
I missed the How to upgrade sections - to my shame! Thank you for pointing it out.
I could bubble it all up to 0.6.0. The only odd thing I found was an error about a db.x.findMany() statement. It was empty so I couldn’t figure what caused the issue ( invalid statement ).

I removed the schema, the migration files, rebuilt the schema and seeded it: it worked again.
A quick glance to the upgrade sections related to prisma changes didn’t hint me specifically to breaking changes on findMany(), so… I don’t know what happened, but it got fixed easily.

Thanks again for your help, all works well now and I’m delighted to hear about the yarn rw upgrade \o/

1 Like

Great to hear it’s working!

Regarding db.x.findMany() --> there’s a chance you originally used a yarn rw generate command that created a template which was updated in a more recent version. So when in doubt, just blame the generators :wink:

Keep us posted if anything else comes up. And enjoy!

1 Like