Manthan Mallikarjun
05/25/2020, 11:16 PMManthan Mallikarjun
05/25/2020, 11:17 PMimport { prisma } from '../../../prisma/prisma';
const mock = mockDeep<typeof prisma>();
jest.mock('../../../prisma/prisma', () => mock);
it('...', () => {
mock.user.count.mockResolvedValue(2);
fn()
})
and the function call does this:
const userCount = await prisma.user.count({ where: ... });
Manthan Mallikarjun
05/25/2020, 11:17 PMundefined
for userCount instead of 2Manthan Mallikarjun
05/25/2020, 11:17 PMManthan Mallikarjun
05/26/2020, 12:16 AMManthan Mallikarjun
05/26/2020, 1:30 AMPhilipp Rajah Moura Srivastava
05/26/2020, 4:31 AMmape
05/26/2020, 8:47 AMMatheus Assis
05/26/2020, 12:02 PMJovaanc
05/26/2020, 12:10 PMJovaanc
05/26/2020, 12:23 PMDulara Malindu Colombage
05/26/2020, 1:40 PMDulara Malindu Colombage
05/26/2020, 1:41 PMDulara Malindu Colombage
05/26/2020, 1:50 PMDulara Malindu Colombage
05/26/2020, 2:03 PMJohn Cantrell
05/26/2020, 9:20 PMJohn Cantrell
05/26/2020, 9:20 PMJohn Cantrell
05/26/2020, 9:26 PMJohn Cantrell
05/26/2020, 9:41 PMJohn Cantrell
05/26/2020, 10:03 PMAlice
05/27/2020, 2:40 AMAlice
05/27/2020, 2:41 AMcreate table scm_dashboard.dashboard_config2
(
`id` varchar(255),
`userId` varchar(255) DEFAULT NULL,
`vizState` varchar(255) DEFAULT NULL,
`changedAt` varchar(255) DEFAULT NULL,
`createdAt` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
)
Alice
05/27/2020, 2:41 AMAlice
05/27/2020, 2:42 AMJovaanc
05/27/2020, 8:57 AMJovaanc
05/27/2020, 11:48 AMJovaanc
05/27/2020, 11:52 AMMatheus Assis
05/27/2020, 2:46 PMUser
that has posts: Post
How would I filter the list of users that has posted an specific post for example:
query GetUser {
users (after: { posts_some: { title_eq: 'My post' } }) {
name
}
}
I'm using nexus and prisma2, and nexus is not allowing me to filter that deep with t.crud.users()
Matheus Assis
05/27/2020, 3:04 PMschema.prisma
? Like:
model User {
name String
email String
}
model LegalPerson {
@@inherit(User)
socialNumber String
}
model Company {
@@inherit(User)
address Address
}
And then have nexus output something like t.crud.Users()
?Patryk Zdunowski
05/27/2020, 3:23 PM