Corey Snyder
09/27/2019, 9:59 PMdatabasemodel.prisma
? The schema.graphql
? All of the resolver function definitions?
I ask b/c I have a bug when starting my service and I think it’s in the generated client, so I’m trying to comment things out until I get it working again.
/node_modules/graphql/language/parser.js:1433
throw (0, _error.syntaxError)(lexer.source, token.start, "Expected ".concat(kind, ", found ").concat((0, _lexer.getTokenDesc)(token)));
^
GraphQLError: Syntax Error: Expected Name, found }
at syntaxError (/Users/coreysnyder/Development/Web/GraphQL/drone-part-picker/server/node_modules/graphql/error/syntaxError.js:24:10)
KJReactor
09/27/2019, 10:06 PMconst res = async ( root, args, ctx ) => await ctx.prisma.updateUser({
where: {id: promoter.id},
data: {
promotions: {
create: [{ ...event }]
}
}
})
return res;
Corey Snyder
09/28/2019, 3:50 AM/* Given This Schema */
type Shape{
id: ID! @id
square: Square @relation(name: "SquareShapeRelation", link: TABLE, onDelete: CASCADE)
price: Float
}
type Square{
id: ID! @id
article: Article @relation(name: "SquareShapeRelation")
area: Float
}
/* I'd like to query
- the first 5 Shapes
- starting with the 6th
- Ordered by price desc
where {
the Square has an area >= 5
}
*/
// I was thinking it'd be:
await context.prisma.shapes({
orderBy: price_DESC,
where: {
square: {
area_gte: 5
}
},
skip: 5,
first: 5,
})
// It's important that the first & skip happen AFTER the filtering on the child relation has been applied.
joshdyck
09/28/2019, 4:50 PMUnable to load Prisma config: java.lang.RuntimeException: No valid Prisma config could be loaded.
any ideas?KJReactor
09/28/2019, 4:59 PMconst res = async ( root, args, ctx ) => await ctx.prisma.updateUser({
where: {id: promoter.id},
data: {
promotions: {
create: [{ ...event }]
}
}
})
return res;
JamesJ
09/28/2019, 10:05 PMRayhan
09/29/2019, 11:40 AMKyle (TechSquidTV)
09/29/2019, 11:06 PMnups
09/30/2019, 2:42 AMAddress
table instead of creating address id as foreign key in User
table
model User {
id String @default(cuid()) @id
email String @unique
password String
name String
gender Gender @default(value: null)
address Address?
}
model Address {
id String @default(cuid()) @id
addressLine1 String
addressLine2 String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
not sure what is wrong here. Can someone please help?
TIAAndrew O.
09/30/2019, 6:02 PMAndrew O.
09/30/2019, 6:02 PMtmoney
09/30/2019, 7:50 PMset
with no items? So it works if you have two things and then take one away. But you can’t just pass it an empty array (or null, I tried), it just ignores it, and doesn’t disconnect anything. If you can’t make set
disconnect everything, it kinda feels broken to even use it most of the time…
query updateUser {
updateUser (
where: {
id: "asdfasdlfkjasdlfkj"
}
data: {
posts: {
set: [] // < ---- What can you pass here to disconnect all relations?
}
}
) {
id
}
}
Levar Berry
09/30/2019, 9:04 PMKJReactor
09/30/2019, 10:00 PMAdam Jacob
09/30/2019, 10:03 PMKJReactor
09/30/2019, 10:12 PMmanoj
10/01/2019, 1:22 AMquery {
ads(filter: {
url_has: "google"
}) {
response
}
}
i basically want to filter out ads whose url has google in it @Adam Jacob?
URL is a string hereArnav Verma
10/01/2019, 4:25 AMArnav Verma
10/01/2019, 4:27 AMArnav Verma
10/01/2019, 4:28 AMArnav Verma
10/01/2019, 4:28 AMArnav Verma
10/01/2019, 4:29 AMArnav Verma
10/01/2019, 4:31 AMArnav Verma
10/01/2019, 5:03 AMMorten Bo Rønsholdt
10/01/2019, 6:39 AMKJReactor
10/01/2019, 12:52 PMArtur Mrozowski
10/01/2019, 1:51 PMTim Hardy
10/01/2019, 2:03 PMKJReactor
10/01/2019, 2:29 PMconst variable = async ( root, args, ctx ) => await [resolver]({...args}).then( res => res )
and const variable = await [resolver]({...args})
neither worksJunsu Kim
10/01/2019, 2:48 PM