Nathaniel Babalola
08/21/2021, 10:48 AMprisma.user I was impressed, I have gone on to create 9 more models after this and the only thing it suggests is the other model names await prisma.modelname , after this there's no types again once you start using create, findMany
..e.t.c
When I hover my mouse over , it just shows type any
Can someone please help me out on how to fix this, it prevents me from making some errors as I know what method and properties are safe to useRyan
08/23/2021, 5:55 AMprisma generate.Nathaniel Babalola
08/23/2021, 12:00 PMtypes on the first two pics are for create and findUnique on model user.Nathaniel Babalola
08/23/2021, 12:02 PMcreate is showing type anyRyan
08/23/2021, 12:05 PMprisma is being imported correctly here?Nathaniel Babalola
08/23/2021, 12:58 PMRyan
08/23/2021, 1:44 PMRyan
08/23/2021, 1:44 PMPrismaClient and import it in all your controllers. Don’t create a new instance for each controller.Nathaniel Babalola
08/24/2021, 12:37 PMUserDelegate of type interface of Prisma.UserDelegate<GlobalRejectSettings> while for get passport() it's PassportDelegate has a type of anyNathaniel Babalola
08/24/2021, 12:42 PMindex.d.ts, the get user() function can get the UserDelegate interface, but it just seems like the get passport() function can't access PassportDelegate interface. And this is the case for the other models except user model. @RyanRyan
08/24/2021, 12:51 PMNathaniel Babalola
08/24/2021, 12:56 PMNathaniel Babalola
08/24/2021, 7:13 PMNathaniel Babalola
08/24/2021, 10:41 PMuser model was created in the Prisma namespace in index.d.ts . I removed the Prisma from Prisma.PaymentDelegate<GlobalReject> to become just Payment<GlobalReject> and the types have now started working. look at the second picture.
So why is Prisma creating the types for these models outside the Prisma namespace which is not available to their get() methods ?
Seems these modifications I made will be overwritten when I run prisma generate againRyan
08/25/2021, 5:37 AMprisma and @prisma/client.
The customerSupport create works fine.Ryan
08/25/2021, 5:38 AMschema.prisma over and run prisma generate.Nathaniel Babalola
08/25/2021, 9:29 PMuser has intellisense types. The same issue with the index.d.ts is still happening. Take a look at the following pictures. PassportDelegate is showing type any.
meaning it's still outside the Prisma namespaceRyan
08/26/2021, 6:40 AMNathaniel Babalola
08/26/2021, 7:26 AMRyan
08/26/2021, 8:57 AMcustomerSupport with types. It’s present in the seed.ts file.Nathaniel Babalola
08/26/2021, 9:05 AMschema.prisma file with the models , I decided to move the user model to the bottom. Meaning the Passport model was first, apparently it now became only the PassportDelegate to be in the prisma namespace.
Lol this is so confusing, it's only including the first Model in the schema file in the Prisma namespace.Ryan
08/26/2021, 9:08 AMNathaniel Babalola
08/26/2021, 9:15 AMUserDelegate is now type any and PassPortDelegate is now an interfaceRyan
08/26/2021, 9:18 AMNathaniel Babalola
08/26/2021, 9:28 AMRyan
08/26/2021, 9:29 AM