ejoebstl
10/09/2018, 11:51 AMejoebstl
10/09/2018, 11:51 AMejoebstl
10/09/2018, 11:52 AMsiyfion
10/09/2018, 12:09 PMejoebstl
10/09/2018, 12:15 PMAntti Toivanen
10/09/2018, 12:37 PMtype Mutation {
login(email: String!, password: String!): String!
}
in my datamodel, but in the generated file this appears as type Mutation {
login: String!
}`
zonofthor
10/09/2018, 2:11 PMmutation($scaffoldId: ID!, $key: String!, $value: String!, $includeFragment: Boolean!) {
updateScaffold(scaffoldId: $scaffoldId, key: $key, value: $value) {
id
title
... @include(if: $includeFragment) {
department {
id
title
organisation {
title
}
}
}
}
}
Joellao
10/09/2018, 6:43 PMgetUserRateAverage(parent, args, ctx, info) {
let rates = ctx.db.query.rates({}, info);
let sum = 0;
for (let i = 0; i < rates.length; i++) {
sum += rates[i];
}
return rates.length != null ? sum / rates.length : 0;
},
but don't know if this is even legit hahahaha, really new with GraphQL and Prisma. Let me know!Greyson
10/09/2018, 9:34 PMShawn Zhang
10/10/2018, 3:47 AMException in thread "main" org.postgresql.util.PSQLException: ERROR: permission denied for database
. I can even connect to the db inside prisma container using psql with the same username/password. What have I done wrong?Shawn Zhang
10/10/2018, 3:48 AMShawn Zhang
10/10/2018, 3:49 AMErrorname
10/10/2018, 8:08 AMyolen
10/10/2018, 12:38 PMjens@yolenOnlaw:~/Desktop/onlaw_stack$ prisma list
Service Name Stage Server
ββββββββββββββββββββ βββββββ ββββββββββββββββ
onlaw-prisma-servev default onlaw-prisma-dev
onlaw-prisma-service dev onlaw-prisma-dev
yolen
10/10/2018, 12:40 PMonlaw-prisma-servev
so I tried prisma delete onlaw-prisma-servev
. no error emssage received but `prisma list`yielded jens@yolenOnlaw:~/Desktop/onlaw_stack$ prisma list
Service Name Stage Server
βββββββββββββββββββ βββββββ ββββββββββββββββ
onlaw-prisma-servev default onlaw-prisma-dev
yolen
10/10/2018, 12:41 PMjens@yolenOnlaw:~/Desktop/onlaw_stack$ prisma delete onlaw-prisma-servev
? Are you sure that you want to delete onlaw-prisma-service@dev? y/N y
Deleting service onlaw-prisma-service@dev from default 475ms
jens@yolenOnlaw:~/Desktop/onlaw_stack$ prisma list
Service Name Stage Server
βββββββββββββββββββ βββββββ ββββββββββββββββ
onlaw-prisma-servev default onlaw-prisma-dev
yolen
10/10/2018, 12:42 PMdoums
10/10/2018, 1:13 PMnode index.js
-> internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module 'prisma-client-lib'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.require (/home/pierre/Documents/drop_api/src/prisma-client/index.js:3:20)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Module._compile (/home/pierre/Documents/drop_api/node_modules/pirates/lib/index.js:83:24)
at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Object.newLoader [as .js] (/home/pierre/Documents/drop_api/node_modules/pirates/lib/index.js:88:7)
at Module.load (internal/modules/cjs/loader.js:599:32)
I missed something ?doums
10/10/2018, 1:15 PMdoums
10/10/2018, 1:15 PMdoums
10/10/2018, 1:47 PMdoums
10/10/2018, 1:54 PM# import Example from "./generated/prisma.graphql"
things.
But now prisma client generate the schemas in a .js (if I use the js generator), so it's no more possible to do that.
Ok I found, I forgot to add - generator: graphql-schema
output: ../src/generated/prisma.graphql
in my prisma.ymlyolen
10/10/2018, 1:58 PMpatrickdevivo
10/10/2018, 2:14 PM*ObjectExec
which I can call .Exec(ctx)
on or .MyRelation().Exec(ctx)
on, is there a way to get both objects at once?patrickdevivo
10/10/2018, 2:17 PMhinsxd
10/10/2018, 2:57 PMhinsxd
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?doums
10/10/2018, 3:41 PMctx.request.get('Authorization')
to retrieve the Authorization header ?doums
10/10/2018, 4:49 PMasync createDraft(parent, { text }, ctx) {
const userId = getUserId(ctx)
console.log(userId) //userId is OK
return ctx.prisma.createDraft({
text,
author: {
connect: { id: userId }
}
})
}
but this create a new draft with a null author. I fail to understand why π€shashank
10/10/2018, 5:11 PM