pllumh
12/15/2018, 3:07 PMIvan
12/15/2018, 5:06 PMprisma login
. When I launch the command, the browser opens correctly but when I click to grant permission, a red box like the one in the image pops up and can’t go ahead. I’ve installed prisma globally an I’ve also tried to install the beta version, but nothing seems to work.
I’m working on Ubuntu 18.
Do you have any idea how to fix this? Thanks!CCBCodeMonkey
12/16/2018, 5:37 AMCCBCodeMonkey
12/16/2018, 5:44 AMCCBCodeMonkey
12/16/2018, 5:48 AMjamiehalvorson
12/16/2018, 12:07 PMSean Urgel
12/16/2018, 4:04 PMgraphql-yoga
right? I know how to do this all locally but I don't know where and how to deploy it?Vadim
12/16/2018, 8:29 PMdot
12/16/2018, 10:00 PMBailey McKay
12/17/2018, 4:46 AMDaniel Dosen
12/17/2018, 7:25 AMArdin
12/17/2018, 2:31 PMTracy
12/17/2018, 3:03 PMserum
12/17/2018, 3:24 PMroderik
12/17/2018, 6:27 PMroderik
12/17/2018, 6:28 PMaman06
12/17/2018, 7:33 PMgeabenitez
12/17/2018, 9:11 PMfaure
12/17/2018, 10:30 PMfaure
12/17/2018, 10:30 PMfaure
12/17/2018, 10:31 PMJosh
12/17/2018, 10:48 PMsecondaryLanguages: [Language!] @relation(name: "SecondaryLanguages")
This doesn't seem to be the right way as I can't insert a user without a secondaryLanguage. Is there a way to change this line in my datamodel that would fit the scenario (none to many secondary languages)?Josh
12/17/2018, 10:51 PMZach Hammer
12/18/2018, 12:09 AMINJECT_HEADERS
resolver
https://github.com/prisma/graphql-playground/pull/916muhajir
12/18/2018, 6:27 AMtype User {
id: ID! @unique
authorId: String! @unique
name: String!
messages: [Message!]!
}
type Message {
id: ID! @unique
content: String
author: User!
}
Suppose I have this message data in this form
// example message data
{
authorId: 'some-id",
content: "some content"
}
I want to record that message in database. And create new user with that authorId, if it doesn't exist yet.
async function recordMessage(message) {
const userExists = await prisma.$exists.user({
authorId: data.authorId
});
if (!userExists) {
await prisma.createAuthor({
authorId: data.authorId
})
}
prisma.createMessage({
content: data.content,
author: {
connect: {
authorId: data.authorId
}
}
});
}
Sometime one message and another message have same authorId
. That's why I check userExist
first.
But, when I run recordMessage(message), alot of times. Sometime it result in race condition, it says user doesn't exist yet. But when we're creating new author, I got Unique constraint
Error. Which means there's already user with that authorId
right?
How do you guys handle this situation?
Is there any plan in the future for something like this:
prisma.findOrCreateAuthor({
authorId: "some-id"
})
Some ORM have this feature, like http://docs.sequelizejs.com/manual/tutorial/models-usage.html#-findorcreate-search-for-a-specific-element-or-create-it-if-not-available .
Or perhaps, upsert without update
prisma.upsertAuthor({
where: {
authorId: "some-id"
},
create: {
authorId: "some-id"
}
})
I know, it's possible to use upsert. But it requires us to update
the field. Which Is not necassary in this case.
ThanksRaj
12/18/2018, 11:01 AMmutation CreatePrismaLink {
post(
description: "Prisma turns your database into a GraphQL API :sunglasses:",
url: "<https://www.prismagraphql.com>"
) {
id
}
}
mutation CreateApolloLink {
post(
description: "The best GraphQL client for React",
url: "<https://www.apollographql.com/docs/react/>"
) {
id
}
}
I get the following error
"Error: Variable '$_v0_data' cannot be non input type 'LinkCreateInput!'. (line 1, column 22):
mutation ($_v0_data: LinkCreateInput!)"
Curious if anyone else noticed the same errorTHpubs
12/18/2018, 1:25 PMTHpubs
12/18/2018, 1:25 PMTHpubs
12/18/2018, 1:25 PMJosh
12/18/2018, 2:00 PM