tafelito
05/24/2019, 5:03 PMAviv Stern
05/24/2019, 6:05 PMUmeed
05/24/2019, 7:34 PMtafelito
05/24/2019, 8:25 PMtype Group {
id: ID!
name: String!
rule: [Rule!]
}
type Rule {
id: ID!
name: String!
group: Group
logs: [Log]
}
type Log {
id: ID!
text: String
rule: Rule!
}
The rules resolver just uses the prisma client
rules: (parent, args, ctx) => {
return ctx.prisma.rules(args);
}
And then I have the group and the logs resolver for the Rule
group: async (parent, args, { prisma }) => {
const [group] = await prisma.rulesGroups({
where: { rules_some: { id: parent.id } },
});
return group;
},
logs: async (parent, args, { prisma, logLoader }) => {
const logs = await prisma.logs({
where: { rule: { id: parent.id } },
});
return logs;
}
The problem I see here is that in the group resolver, I don’t have the groupId from the parent rule, so I need to query all groups that has that rule id that is always going to be 1. Same apply for the logs
Another problem without having this is if I want to implement a dataloader because I’m seeing a lot of request to the DB. (I’m not sure if I need it for the prisma client as I read at the docs that prisma includes a Dataloader I wasn’t sure if that’s internally or if I still need to do it myself on the server) But in case I needed to, I would still need the idstafelito
05/24/2019, 9:31 PMJorgeAM
05/25/2019, 5:55 AMnobyf
05/25/2019, 6:38 AMtype User {
id: ID! @unique
username: String! @unique
likes: [Item!]!
follows: [User!]!
followers: [User!]!
categories: [Category!]! @relation(name: "CategoryToUser", onDelete: CASCADE)
items: [Item!]! @relation(name: "ItemToUser", onDelete: CASCADE)
comments: [Comment!]! @relation(name: "CommentToUser", onDelete: CASCADE)
...
}
What is the best way to set up relations for likes, follows, followers as the items do not usually belong to the user him/herself?
or better to do like below? (just keep user or item ids).
likes: [ID!]!
follows: [ID!]!
followers: [ID!]!
and add some logic in the node server?Francis John
05/26/2019, 6:03 AMmanagementApiSecret
is set..andrux
05/26/2019, 6:57 PMdennisko
05/26/2019, 7:24 PMmanagementApiSecret
from docker-compose.yml
?dennisko
05/26/2019, 7:25 PMpedro
05/27/2019, 1:47 AMjava.lang.RuntimeException: Encountered unknown SQL type timestamptz with column created_at. IntrospectedColumn(created_at,timestamptz,null,false)
problem?kitze
05/27/2019, 8:39 AMMichał Chmura
05/27/2019, 12:38 PMserver
mutations from the seeding script? I want to access the mutations and resolvers we created as opposed to using the database
ones. Example of accessing the db
ones: const db: Prisma = new Prisma({
endpoint: '<http://localhost:4466>',
})
await db.mutation.createUser(...)
could someone provide me with relevant code for accessing the server
? Do I need apollo-client
??pedro
05/28/2019, 12:35 AMcreatedAt
and updatedAt
as the query result as well?Mike Whitlaw
05/28/2019, 1:31 AMOlaf
05/28/2019, 6:31 AMtype User {
id: ID!
first_name: String!
last_name: String!
email_address: String!
}
and would like to group first_name
and last_name
into a name
object that, when the user is queried, nests the two names like name: { first, last }
so I can do a name.first
etc. Can this be done without creating a 'name' table in the database? I.e. Simply at the Prisma interpretation level, not database. Thanks for any advice for converting my current (flat) structure.Syed Ali Zaidi
05/28/2019, 6:47 AMSyed Ali Zaidi
05/28/2019, 6:48 AMSyed Ali Zaidi
05/28/2019, 6:52 AMdennisko
05/28/2019, 8:26 AMdennisko
05/28/2019, 8:27 AMdennisko
05/28/2019, 8:29 AMZiad Saab
05/28/2019, 8:41 AMgraphqlgen
?Michael Schonfeld
05/28/2019, 9:22 PMgraphql-schema
generated schema.graphql… say I have User -> [MessageThread] -> [Message] model, and I want both MessageThread, and Message to respond with the connection types, can/should I not use the generated schema file?Morten Bo Rønsholdt
05/29/2019, 8:01 AMMichał Chmura
05/29/2019, 9:28 AMjest
Integration Testing of APIs built with Prisma?gem
05/29/2019, 10:41 AMChristian Svenkerud
05/29/2019, 11:29 AMm.jarzebski
05/29/2019, 11:53 AMpreviousValues {
id
}
this is the response:
"previousValues": { "id": "StringIdGCValue(ID)"}
is it wanted behavior? why not return id
only?