hinsxd
10/10/2018, 3:30 PMOrder with a unique field id. I imported Query.order from prisma.graphql, then implemented the resolvers as:
orders: (_, args, { prisma }) => prisma.order(arg),
but it fails, shows
"Variable '$where' expected value of type 'OrderWhereUniqueInput!' but got: {\"where\":{\"id\":\"cjn1adt3m03ao0875rf9fgh7w\"}}. Reason: 'where' Field 'where' is not defined in the input type 'OrderWhereUniqueInput'. (line 1, column 8):\nquery ($where: OrderWhereUniqueInput!)
Then I changed it to
orders: (_, args, { prisma }) => prisma.order(args.where),
It seems that prisma.order() takes a where object.
What aboud prisma.orders()? I digged into prisma.graphql and found out that the orders query takes many arguments. How should I pass down the arguments? Should I pass the whole args to the function? If so, wouldn't it be inconsistent because the two functions take different arguments?nilan
10/10/2018, 3:31 PMnilan
10/10/2018, 3:32 PMnilan
10/10/2018, 3:32 PMprisma.order the wrapper where is removed.
however, prisma.orders takes multiple arguments, so the wrappers are still there.nilan
10/10/2018, 3:33 PMShould I pass the wholeyupto the function?args
nilan
10/10/2018, 3:33 PMIf so, wouldn't it be inconsistent because the two functions take different arguments?that's one way to see it, the other side of the coin is that it's a simplification of the API where possible
nilan
10/10/2018, 3:34 PMhinsxd
10/10/2018, 3:46 PMdivyendu
10/11/2018, 7:40 AM