Biel Simon
11/11/2018, 11:54 PMChristian de Botton
11/12/2018, 3:16 AMid
field to my datamodel.graphql
, I will get an error ▸ Cannot read property 'type' of undefined
. when running prisma generate
with any target. I have other types defined with IDs, I can remove any of them and add them back and run the command as expected, but if I define any new types, no matter the name, generate will fail if an ID is present, has anyone seen this before? Also, sorry if this is not the place to askChristian de Botton
11/12/2018, 3:16 AMChristian de Botton
11/12/2018, 3:28 AMChristian de Botton
11/12/2018, 3:43 AMpedro
11/12/2018, 6:52 AMpedro
11/12/2018, 6:56 AMGorodov Maksim
11/12/2018, 10:52 AMtype User {
id: ID! @unique
name: String!
username: String! @unique
description: String!
avatarUrl: String
interests: [String!]!
isApproved: Boolean @default(value: "false")
createdAt: DateTime!
updatedAt: DateTime!
}
Schema:
type Mutation {
createUser(username: String! interests: [String!]!): User!
}
Here is UserCreateinterestsInput:
input UserCreateinterestsInput {
set: [String!]
}
Example call of this mutation (like on the screenshot):
mutation {
createUser(
username: "silencerweb"
interests: ["frontend", "backend"]
) {
id
}
}
taikn
11/12/2018, 11:28 AMGreyson
11/12/2018, 4:04 PMJustinR
11/12/2018, 4:29 PMBirac
11/12/2018, 4:34 PMRamin B
11/12/2018, 4:47 PMForm
and FormItem
. Form can have many FormItem’s. But I want to create the relationship between the 2 using a “join”, which it self has some metadata on it. Meaning, I can create and reuse FormItem’s across different forms, but I may want to specify some meta data (ie, required, label, etc). How to best represent this in Prisma context?theHopeful
11/12/2018, 5:01 PMprisma app
to zeit
with now and docker
with some successful but unwanted results:
1. I deployed to zeit
with docker
and the container was started successfully
2. unfortunately the queries
and mutation
were generated from the schema
and not from my mutation
and queries
Would anyone know how i can prevent this??
ThanksChris Chambers
11/12/2018, 7:37 PMJoseph Carrington
11/12/2018, 9:11 PMtype PortalCart {
id: ID! @unique
owner: PortalUser! @relation(name: "UserCart")
items: [CartItem!]! @relation(name: "ItemsInCart", onDelete: CASCADE)
createdAt: DateTime!
updatedAt: DateTime!
}
type CartItem {
id: ID! @unique
cart: PortalCart! @relation(name: "ItemsInCart")
quantity: Int! @default(value: 1)
productId: ID!
createdAt: DateTime!
updatedAt: DateTime!
}
type PortalUser {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
cart: PortalCart @relation(name: "UserCart", onDelete: CASCADE)
OTTAuthorizations: [OTTAuthorization!]!
isGuest: Boolean! @default(value: "true")
}
type OTTAuthorization {
id: ID! @unique
createdAt: DateTime!
updatedAt: DateTime!
videoId: String!
authorizationCode: String!
expires: DateTime!
}
I always get this error on prisma generate:
Generating schema... 25ms
Syntax Error: Expected Name, found }
GraphQL request (512:1)
511:
512: }
^
There is of course not a line 512 of anything I have been able to view, so I am assuming something about the datamodel is generating an AST that prisma doesnt like.Nick Parsons
11/13/2018, 3:31 AM'ECONNRESET': request to <http://localhost:4466/management> failed, reason: socket hang up
Nick Parsons
11/13/2018, 3:31 AMNick Parsons
11/13/2018, 3:31 AMJubal Mabaquiao
11/13/2018, 3:51 AMLuke
11/13/2018, 4:30 AMdatamodel.prisma
into schema.graphql
so I don’t need to re write them ?wontwon
11/13/2018, 4:55 AMwontwon
11/13/2018, 6:12 AMwontwon
11/13/2018, 6:13 AMCCBCodeMonkey
11/13/2018, 7:21 AMCCBCodeMonkey
11/13/2018, 7:21 AMinvalidArgs: xyz
CCBCodeMonkey
11/13/2018, 7:27 AMCCBCodeMonkey
11/13/2018, 7:29 AMthrow new ValidationError('blah blah blah', {invalidArgs: 'blah'});
CCBCodeMonkey
11/13/2018, 7:29 AMCCBCodeMonkey
11/13/2018, 7:30 AM{
"data": {
"blah": null
},
"errors": [
{
"message": "ValidationError: \"blah\" with value 'whatever' blah blah blah error",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"blah"
]
}
]
}