veksen
06/28/2018, 4:09 PMlet connection = await ctx.db.query.postsConnection(
{ },
`{ aggregate { count } } }`,
)
let count = connection.aggregate.count
jaybauer
06/28/2018, 5:01 PMconst user = await ctx.db.query.user({ where: { id } })
is working as expected, but itβs not returning any nested data (in this case a nested type containing Stripe customer information is what I want to get back). These two nodes have a relation set up in my datamodel, and Iβm correctly able to return the data using the same query in my playground. Am I missing something here? Why am I not able to get the nested data back in my resolver? And how else would I approach this, if itβs not doable?quadsurf
06/28/2018, 5:36 PMquadsurf
06/28/2018, 5:40 PMWhoops. Looks like an internal server error.
peter
06/28/2018, 6:18 PMprisma
servers keeping track of operating costs?Jenkins
06/28/2018, 6:30 PMJenkins
06/28/2018, 6:31 PMsunrising
06/28/2018, 6:39 PMBILLING
tab inside settings i always have We're currently synchronizing your project data.
message.
Is it quite a long process? πnate
06/28/2018, 6:50 PMnate
06/28/2018, 6:50 PMnate
06/28/2018, 6:51 PMnate
06/28/2018, 6:51 PMnate
06/28/2018, 6:52 PMBlaz
06/28/2018, 7:47 PMBlaz
06/28/2018, 7:47 PMBlaz
06/28/2018, 7:48 PMBlaz
06/28/2018, 8:07 PMNick
06/28/2018, 9:46 PMjhony0311
06/28/2018, 10:52 PMUsers
, I have this resolver:
users: (_, args, context, info) => {
console.log(info);
return context.prisma.query.users({}, info);
}
And when I hit the query I get this error:
Cannot return null for non-nullable field User.name.
The query looks like this:
{
users {
name
}
}
Any idea on what Iβm doing wrong?Chris H
06/29/2018, 2:48 AMwhere
object below?
homesInPriceRange: async (parent, args, ctx: Context, info) => {
const where = {
AND: [
{ pricing: { perNight_gte: args.min } },
{ pricing: { perNight_lte: args.max } },
],
}
return ctx.db.query.places({ where }, info)
},
and the gql aggregate
thingie below:
numRatings: {
fragment: `fragment NumRatings on Place { id }`,
resolve: async ({ id }, args, ctx: Context, info) => {
const reviews = await ctx.db.query.reviewsConnection(
{ where: { place: { id } } },
gql`{ aggregate { count } }`,
)
return reviews.aggregate.count
},
},
I have been looking for some kind of reference on when you can use filter
or that you can use min
and max
on an Int? Is google no longer serving me or is the documentation on this stuff sparse?Luke
06/29/2018, 3:53 AMprisma seed
is giving me
β lyra-api prisma seed
ERROR: Workspace * does not exist
{
"data": {
"generateClusterToken": null
},
"errors": [
{
"message": "Workspace * does not exist",
"locations": [
{
"line": 3,
"column": 9
}
],
"path": [
"generateClusterToken"
],
"code": 222
}
],
"status": 200
}
Get in touch if you need help: <https://www.prisma.io/forum/>
To get more detailed output, run $ export DEBUG="*"
jaydenseric
06/29/2018, 3:54 AMLuke
06/29/2018, 3:54 AMJordan Beja
06/29/2018, 5:57 AMGorodov Maksim
06/29/2018, 6:01 AMtype Action {
id: ID! @unique
title: String!
date: String!
description: String
karma: String!
executors: String!
members: [ActionMember!]
author: User!
}
And I get this error: The relation field members
has the wrong format: [ActionMember]
Possible Formats: ActionMember
, ActionMember!
, [ActionMember!]!
Why can't I have [ActionMember!]
? I want to make this field optionalGorodov Maksim
06/29/2018, 6:21 AMGorodov Maksim
06/29/2018, 6:39 AMGorodov Maksim
06/29/2018, 7:04 AMJim
06/29/2018, 8:26 AMreturn ctx.db.mutation.updateUser(
{
where: { id },
data: {
name,
email,
body,
},
},
info,
);
Is there a smart way to make the name, email and body optional, and only update them if a value has been passed?
I could do it with some if statements but it makes my soul feel dirty:
if (name) {
ctx.db.mutation.updateUser(
{
where: { id },
data: {
name,
},
},
info,
);
}
if (email) {
ctx.db.mutation.updateUser(
{
where: { id },
data: {
email,
},
},
info,
);
}
if (body) {
ctx.db.mutation.updateUser(
{
where: { id },
data: {
email,
},
},
info,
);
}
taikn
06/29/2018, 8:41 AM