terion
05/23/2018, 10:03 AMmatus.congrady
05/23/2018, 10:08 AMmarco
05/23/2018, 10:40 AMstephen
05/23/2018, 11:20 AMMoritz
05/23/2018, 11:25 AMMoritz
05/23/2018, 11:26 AMstephen
05/23/2018, 11:27 AMdpetrick
05/23/2018, 11:33 AMGridley123
05/23/2018, 11:50 AMGridley123
05/23/2018, 11:50 AMGridley123
05/23/2018, 11:51 AMdpetrick
05/23/2018, 12:10 PMterion
05/23/2018, 1:00 PMmekwall
05/23/2018, 1:11 PMSam Jackson
05/23/2018, 1:37 PMAdding Authentication
tutorial (https://www.howtographql.com/graphql-js/6-authentication/) but I am getting this error:
Error: Directive `unique`: Couldn't find type `unique` in any of the schemas.
Has anyone seen this before?Sam Jackson
05/23/2018, 2:26 PMparent
. My resolver for creating a new post has become:
async function addPost (parent, args, context, info) {
const userId = getUserId(context)
const parentId = args.parentId ? args.parentId : null
return context.db.mutation.createPost({
data: {
body: args.body,
parent: {
connect: {
id: parentId
}
},
author: {
connect: {
id: userId
}
}
}
}, info)
}
However, I am getting an error when firing this mutation that reads: You provided an invalid argument for the where selector on Post.
I think this is because I am attempting to write a post without a parent. How can I handle cases where that value is not provided; should it just be an empty string?hez
05/23/2018, 2:31 PMMoritz
05/23/2018, 2:52 PMType '{ users: (parent: any, args: any, context: any, info: GraphQLResolveInfo) => any; profiles: (pare...' is not assignable to type 'GraphQLScalarType'.
Property 'name' is missing in type '{ users: (parent: any, args: any, context: any, info: GraphQLResolveInfo) => any; profiles: (pare...'. (2345)
in the initialisation of my Prisma server. It is complaining about a file as such: export const Query = {
users: forwardTo("db"),
profile(parent, { id }, ctx: Context, info) {
return ctx.db.query.profile({ where: { id } }, info);
},
}
What is the reason for this? Has the query format changed? Thanks!patrick_madx
05/23/2018, 2:58 PMmax
05/23/2018, 3:30 PMSam Jackson
05/23/2018, 3:35 PMparent
for a parent Post, and children
for Posts with that Post as its parent. Right now when I define a Post with a parent, the parent gets the newly-created Post as its parent as well. Any thoughts on what might be going on?
type Post {
id: ID! @unique
body: String!
author: User! @relation(name: "UserPosts")
parent: Post @relation(name: "PostParent")
children: [Post!]! @relation(name: "PostChildren")
}
Soma Deaki
05/23/2018, 4:24 PMSoma Deaki
05/23/2018, 4:24 PMERROR: Service with name 'marketmuse-gql' and stage 'production' already exists
{
"data": {
"addProject": null
},
"errors": [
{
"locations": [
{
"line": 2,
"column": 9
}
],
"path": [
"addProject"
],
"code": 4005,
"message": "Service with name 'marketmuse-gql' and stage 'production' already exists",
"requestId": "mmx_marketmuse:management:____________________"
}
],
"status": 200
}
halfnibble
05/23/2018, 5:07 PMSam Hulick
05/23/2018, 5:10 PMSam Jackson
05/23/2018, 5:18 PMprisma deploy
hang on "Applying changes" ?Sam Hulick
05/23/2018, 6:28 PMSam Jackson
05/23/2018, 6:38 PMcreatedAt
and updatedAt
are built into each Prisma type. Is there a way for me to access that in a query? Or do I have to duplicate that information?nilan
05/23/2018, 6:45 PMAdam
05/23/2018, 6:47 PM