Andy Fang
04/29/2019, 3:47 PMBen Scholtz
04/29/2019, 4:19 PMJoe Becher
04/29/2019, 4:26 PMgraphql-request
and trying to figure out how best to mock the API responses using jest. Any recommendations/advice?Simon Stenbæk Madsen
04/29/2019, 4:30 PMalec
04/29/2019, 5:23 PMpcooney10
04/29/2019, 5:26 PMHarshit
04/29/2019, 5:39 PMBryan
04/29/2019, 6:46 PMjoar
04/29/2019, 7:18 PMjoar
04/29/2019, 7:18 PMjoar
04/29/2019, 7:19 PMNeves
04/29/2019, 7:58 PMNeves
04/29/2019, 8:05 PMNeves
04/29/2019, 8:06 PMBryan
04/29/2019, 8:07 PMBryan
04/29/2019, 8:09 PMtomhut
04/29/2019, 8:10 PMmarcus
04/29/2019, 8:11 PMNeves
04/29/2019, 8:12 PMNelson Pecora
04/29/2019, 9:05 PMprisma generate
(details in thread)Kianoosh
04/29/2019, 9:42 PMmusics.map(async (music) => {
let isMusicExists = await context.prisma.$exists.musicDirectory({
AND: [
{
directoryId,
musics_some: {
trackId: music.trackId,
trackService: music.trackService
}
}
]
});
if (isMusicExists){
throw new Error('This music is already added in this place!')
}
});
this piece of code is in middle of my revolver, What i expect after receiving duplicate record is throwing an error and stop the execution furthermore but what i get in console is:
(node:11309) UnhandledPromiseRejectionWarning: Error: This music is already added in this place!
at musics.map (/home/kianoosh/MyApp/resolvers/Mutation.js:384:23)
at processTicksAndRejections (internal/process/task_queues.js:86:5)
(node:11309) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
I tried to use catch but it didn't make any difference after all the error is just printing in console and doesn't stop anything.Jeremiah
04/30/2019, 4:25 AMUser
must be marked as the id field with the @id
directive." but I have version 1.17.1 of prisma installed and before we just had to have "id: ID! @unique" and I'm not sure what changed.Darryl
04/30/2019, 4:33 AM@scalarList
? I updated my Prisma version so I could try Prisma Admin and now, when deploying, I’m getting the `Valid values for the strategy argument of @scalarList
are: RELATION.` errors. Thanks.philip andrew
04/30/2019, 5:44 AMMatthias Harder
04/30/2019, 7:02 AMRoss Coundon
04/30/2019, 10:09 AMDarryl
04/30/2019, 10:16 AMdocker-compose.yml
but I’m getting an error when trying to set up the database.
➜ git:(master) ✗ prisma --version
Prisma CLI version: prisma/1.31.2 (darwin-x64) node-v10.15.3
➜ git:(master) ✗ docker-compose up -d
Pulling prisma (prismagraphql/prisma:1.31.2)...
ERROR: manifest for prismagraphql/prisma:1.31.2 not found
Looking on Docker, I don’t see a tag for that version.Darryl
04/30/2019, 10:16 AMkitze
04/30/2019, 2:04 PMexport type PaddleSubscriptionWhereUniqueInput = AtLeastOne<{
id: ID_Input;
subscriptionId?: String;
}>;
Gaurav
04/30/2019, 2:56 PMgraphql-code-generator
and prisma
type mismatch on returning promise.
That is, for this field resolver:
customer: async (root, args, context) => {
try {
await ifCustomerOwnsThisResource(context, {
cartItems_some: {
id: root.id
}
});
return await context.prisma.customerCartItem({ id: root.id }).customer();
} catch (error) {
console.error(error);
}
},
I am getting this error:
src/resolvers/cartResolvers.ts:25:3 - error TS2322: Type '(root: CustomerCartItem, args: {}, context: IContext) => Promise<Customer>' is not assignable to type 'Resolver<Customer, CustomerCartItem, IContext, {}>'.
Type '(root: CustomerCartItem, args: {}, context: IContext) => Promise<Customer>' is not assignable to type 'ResolverFn<Customer, CustomerCartItem, IContext, {}>'.
Type 'Promise<Customer>' is not assignable to type 'Customer | Promise<Customer>'.
Type 'Promise<import("G:/graphql/prod/graphql-server/src/generated/prisma-client-ts/index").Customer>' is not assignable to type 'Promise<import("G:/graphql/prod/graphql-server/src/generated/resolvers-types").Customer>'.
From what I get, prisma
returns interface CustomerPromise
for chained query, while Promise<Customer>
is expected as return expression by graphql-code-generator
. How to fix that?