LQ
08/15/2019, 8:39 PMUser
isn’t an embedded type, you need to specify the relationship between User
and Company
Neal
08/15/2019, 8:41 PMid
of the user?LQ
08/15/2019, 8:42 PMtype User {
id: ID! @id
}
type Company {
id: ID! @id
createdBy: User
members: [User!]! @relation(link: INLINE)
}
LQ
08/15/2019, 8:43 PMUsers
to your Company
Neal
08/15/2019, 8:43 PMNeal
08/15/2019, 8:44 PMLQ
08/15/2019, 8:45 PM@embedded
type is something that exists only inside a certain collection/tableLQ
08/15/2019, 8:47 PMtype User {
id: ID! @id
profile: UserProfile
}
type UserProfile @embedded {
name: String
}
type Company {
id: ID! @id
createdBy: User
members: [User!]! @relation(link: INLINE)
}
LQ
08/15/2019, 8:47 PMUserProfile
doesn’t have its own collection/table like User
and Company
doesLQ
08/15/2019, 8:48 PMUser
LQ
08/15/2019, 8:48 PMNeal
08/15/2019, 8:48 PMNeal
08/15/2019, 8:49 PM@relation
for createdBy
but we need to for members
, what is the difference then? Because the User
type is not an embedded typeLQ
08/15/2019, 8:50 PMLQ
08/15/2019, 8:51 PM@relation
as wellLQ
08/15/2019, 8:51 PMLQ
08/15/2019, 8:51 PMmembers
LQ
08/15/2019, 8:51 PMNeal
08/15/2019, 8:51 PM[User!]!
mean that it can be empty as well?LQ
08/15/2019, 8:53 PMNeal
08/15/2019, 8:54 PMLQ
08/15/2019, 8:54 PMNeal
08/15/2019, 8:55 PM@relation
to the id
of the User
type?Neal
08/15/2019, 8:56 PMINLINE
× The relation field `createdBy` must specify a `@relation` directive: `@relation(name: "MyRelation")`
× The relation field `members` must specify a `@relation` directive: `@relation(name: "MyRelation")`
soren
08/15/2019, 10:37 PMYour token is invalid.
Here is my package.json scripts:
"scripts": {
"start": "nodemon src/index.js --ext js,graphql --exec babel-node",
"get-schema": "graphql get-schema -p prisma"
},
Here is my .graphqlconfig
{
"projects": {
"prisma": {
"schemaPath": "src/generated/prisma.graphql",
"extensions": {
"prisma": "prisma/prisma.yml",
"endpoints": {
"default": {
"url": "<http://192.168.99.100:4466>",
"headers": {
"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7InNlcnZpY2UiOiJkZWZhdWx0QGRlZmF1bHQiLCJyb2xlcyI6WyJhZG1pbiJdfSwiaWF0IjoxNTY1OTA4MTQ1LCJleHAiOjE1NjY1MTI5NDV9.UWO9S9avS-VzY_g9X3Uqo66qVvQtQsVUZkeT5dngaoA"
}
}
}
}
}
}
}
And here is my project architecture:
https://i.gyazo.com/75f023922fef9a91d8e8f368c69c441f.png▾
Andrés Villalobos
08/16/2019, 1:32 AMrein
08/16/2019, 8:46 AMAndrei Bacescu
08/16/2019, 10:00 AMAlexander
08/16/2019, 1:08 PMfragment UserWithPosts on User {
id
email
hmac
}
);
What am I doing wrong? How to receive custom resolver values using fragments / the prisma client or binding?Corey Snyder
08/16/2019, 1:29 PM