James Fox
01/11/2020, 4:56 PMprisma-nexus
, is there any way to use the Field Authorize Plugin with t.crud.<model>
? Or would I need to go with a middleware solution like graphql-shield
?James Fox
01/11/2020, 4:57 PMt.crud.item({
authorize: (root, args, ctx) => ctx.auth.hasPermission(args),
})
Alfred Ödling
01/11/2020, 4:57 PMAndres Montoya
01/11/2020, 5:51 PMSherbakov
01/12/2020, 11:31 AMMarton Langa
01/13/2020, 8:36 AMVictor Kolb
01/13/2020, 2:27 PMorg.postgresql.util.PSQLException: ERROR: pgbouncer cannot connect to server
in a few hours I couldn't find a solution on the Internet ((raji hawa
01/13/2020, 8:53 PMajmakhl
01/14/2020, 3:09 AMtype Detail {
id: ID!
title: String
}
type Example1 {
id: ID!
detail: Detail!
}
type Example2 {
id: ID!
detail: Detail!
}
basically im trying to see if I can avoid doing this to the type Detail..
type Detail {
id: ID!
title: String
example1: Example1
example2: Example2
}
Thanks in advance.Jizong
01/14/2020, 4:30 AMJames Fox
01/15/2020, 6:54 AM# Models
model Post {
post_id String @id
category Category?
}
model Category {
category_id String @id
description String
}
// Schema
const Post = objectType({
name: "Post",
definition(t) {
t.model.post_id();
t.model.category();
}
})
const Category = objectType({
name: "Category",
definition(t) {
t.model.category_id();
t.model.description();
}
})
const Query = objectType({
name: "Query",
definition(t) {
<http://t.crud.post|t.crud.post>();
t.crud.posts({ filtering: true, pagination: true });
t.crud.category();
t.crud.categorys({ filtering: true, pagination: true });
// GraphQL query
post(first: 1) {
name
category {
description
}
}
James Fox
01/15/2020, 7:00 AM"Argument \u001b[1mwhere\u001b[22m of type \u001b[1mPostWhereUniqueInput\u001b[22m needs \u001b[92mat least one\u001b[39m argument. Available args are listed in \u001b[2m\u001b[32mgreen\u001b[39m\u001b[22m."
James Fox
01/15/2020, 7:01 AMcategory
manually prevents the error, but category
is returned as null:
t.field("category", {
type: Category,
nullable: true
});
lionbrahh
01/15/2020, 9:14 AMmichieldewilde
01/15/2020, 9:16 AMViktor Szépe
01/15/2020, 9:36 AMtype Starship {
id: ID!
name: String!
length(unit: LengthUnit = METER): Float
}
Is there a way to do syntax check on graphql queries?Viktor Szépe
01/15/2020, 9:37 AMhoria.ancas
01/15/2020, 10:19 AMprisma import --data something.zip
support pause and resume? It says so here, but I don't know how to do it https://www.prisma.io/docs/prisma-cli-and-configuration/data-import-and-export-jsw9/#data-import-with-the-clihoria.ancas
01/15/2020, 10:22 AMprisma import ...
takes longer than 30 seconds and times out on herokuLukas Greb
01/15/2020, 4:07 PMDatamodel:
type Comment {
id: ID! @id #database id
commentId: String! @unique #given id
author: Author! @relation(link: INLINE)
video: Video! @relation(link: INLINE)
parent: Comment @relation(link: INLINE)
text: String!
likeCount: Int!
publishedAt: DateTime!
replies: [Comment]! ?????
}
Insert mutation:
const author = await context.prisma.author({
authorChannelId: args.comment.authorChannelId
})
const video = await context.prisma.video({
videoId: args.comment.videoId
})
return context.prisma.createComment({
commentId: args.comment.commentId,
author: { connect: { id: author.id } },
video: { connect: { id: video.id } },
parent: args.comment.parentId ? { connect: { id: args.comment.parentId } } : {},
text: args.comment.text,
likeCount: args.comment.likeCount,
publishedAt: args.comment.publishedAt,
replies: ???
})
Could someone guide me to some related ressources?
Edit: I'm using GQL1, MongoDB, YogaAlice
01/16/2020, 7:55 AMAlice
01/16/2020, 8:27 AMJulien C.
01/16/2020, 2:53 PMJaafari El Housseine
01/16/2020, 7:09 PMSothy Chan
01/17/2020, 1:15 AMlionbrahh
01/17/2020, 8:15 AMdwirya
01/17/2020, 10:49 AMMounika
01/17/2020, 11:29 AMcaptaindaylight
01/17/2020, 8:50 PMJulius Dockwarder
01/18/2020, 5:55 PM