signor_busi
10/07/2018, 12:23 PMsignor_busi
10/07/2018, 12:24 PMJoellao
10/07/2018, 1:48 PMquery{
feed{
description,
imageURLs{
url
}
},
me{
posts{
imageURLs{
url
}
}
}
}
The imageURLs produces two different outputs, in the feed
tree it comes out as null
in the me
tree under posts
comes out like []
. Now feed
is declared as [Post!]!
and me
is declared as User
which has [Post!]
. Now I would need to get the empty array if there is no data and not null. Like changed a bunch of things but always the same resultshashank
10/07/2018, 3:32 PMshashank
10/07/2018, 3:33 PMGreyson
10/07/2018, 3:59 PMtype User {
id: ID! @unique
...
assets: [UserAsset!]! @relation(name: "UserToAsset", onDelete: CASCADE)
}
type Asset {
assetId: String! @unique
assetType: AssetType
users: [UserAsset!]! @relation(name: "AssetToUser", onDelete: CASCADE)
}
type UserAsset {
user: User! @relation(name: "UserToAsset")
asset: Asset! @relation(name: "AssetToUser")
name: String!
...
}
Is this the proper way to go about something like this?bwoodlt
10/07/2018, 4:37 PMgraphql-yoga
question: Are there any commands to fully shutdown the server in graphql-yoga
, for example if I'm trying to reload onSave() and needs the server to reloads also?Greyson
10/07/2018, 7:08 PMGreyson
10/07/2018, 8:13 PMrick
10/08/2018, 9:47 AMrick
10/08/2018, 9:47 AMSach97
10/08/2018, 1:19 PMGreyson
10/08/2018, 2:12 PMGreyson
10/08/2018, 2:28 PMJoellao
10/08/2018, 3:21 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!stearm
10/08/2018, 3:21 PMjava.lang.RuntimeException: ProjectHelper: Could not resolve project with id: project-name@default
? I just restarted my docker project and it doesnt start anymore 😞Joseph Carrington
10/08/2018, 6:50 PMQuery: {
async cart(obj, args, context, info) {
const { user_id } = await getUserFromAuthorizationHeader(
context.authorization
);
const cart = await prisma.portalCart({owner: user_id});
return cart;
}
}
}
Cart: {
async items(obj, args, context, info) {
const items = await prisma.portalCart({ owner: obj.owner }).items();
return items;
}
}
is that await prisma.portalCart({ owner: obj.owner }).items()
using a cached version of portalCart, or is it having to fetch it again? If so, Is there a way to get both the cart AND it’s items? What I am trying to avoid is having to do two different queries for prisma.cart() if I can avoid it.Joseph Carrington
10/08/2018, 10:07 PMApplying changes (3/2)
for about ten minutes, until I get an error that my token expired. Does that mean the CLI is mistakenly attempting to apply change three of two, and if so, is it safe to to assume that my rename succeeded?Joseph Carrington
10/08/2018, 10:09 PMaroman
10/09/2018, 1:19 AMUser
type into my schema.graphql. When ever I try to for example query as such: const user = await ctx.db.user({ email });
. I log out user.password
and it returns undefined
. The User object returns only:
{ middleName: 'vic',
email: 'test@test',
lastName: 'Roman',
firstName: 'Alejandro',
id: 'cjmzgzmgc000708611vn6klyw' }
but it is missing role and password. I am trying to plug use bcrypt's compare function, but it wont work since the arguments user.password
returns as undefined. Would anyone happen to be able to point me in the right directionyolen
10/09/2018, 9:00 AMejoebstl
10/09/2018, 9:17 AMsiyfion
10/09/2018, 10:48 AMsiyfion
10/09/2018, 10:49 AMinfo
argument through from the query to the Prisma binding, it’ll sort it all out into one SQL queryejoebstl
10/09/2018, 10:59 AMyolen
10/09/2018, 11:35 AMejoebstl
10/09/2018, 11:46 AMyolen
10/09/2018, 11:47 AMejoebstl
10/09/2018, 11:50 AMejoebstl
10/09/2018, 11:50 AM