prisma-graphql

How to fix 'Variable “$_v0_data” got invalid value' caused from data types relation - Mutation Resolver

守給你的承諾、 提交于 2021-01-29 11:28:48
问题 I am trying to setup relations between types and wrote a resolver to run a mutation that create the list values but getting the below error here is my mutation file async createList(parent, args, ctx, info) { const list = await ctx.db.mutation.createList( { data: { project: { connect: { id: args.projectId } }, ...args } }, info ); return list; } and here is my datamodel type Board { id: ID! @id title: String! createdAt: DateTime! @createdAt updatedAt: DateTime! @updatedAt lists: [List]! }

Prisma 2 query to return records only that are associated with ALL of the provided tag IDs

和自甴很熟 提交于 2021-01-04 03:25:17
问题 I have tables Principles and Tags. And there is a many-to-many relation between them (joined implicitly). Without using prisma.raw , how can I run the following query? SELECT p.id, p.title, p.description, p.createdAt, p.modifiedAt FROM principle p WHERE EXISTS (SELECT NULL FROM _PrincipleToTag pt WHERE pt.B IN (${tagIds.join(',')}) AND pt.A = p.id GROUP BY pt.A HAVING COUNT(DISTINCT pt.B) = ${tagIds.length}) How can I update this Prisma 2 query such that the principles returned are only

Prisma 2 query to return records only that are associated with ALL of the provided tag IDs

佐手、 提交于 2021-01-04 03:22:52
问题 I have tables Principles and Tags. And there is a many-to-many relation between them (joined implicitly). Without using prisma.raw , how can I run the following query? SELECT p.id, p.title, p.description, p.createdAt, p.modifiedAt FROM principle p WHERE EXISTS (SELECT NULL FROM _PrincipleToTag pt WHERE pt.B IN (${tagIds.join(',')}) AND pt.A = p.id GROUP BY pt.A HAVING COUNT(DISTINCT pt.B) = ${tagIds.length}) How can I update this Prisma 2 query such that the principles returned are only

Prisma 2 query to return records only that are associated with ALL of the provided tag IDs

我的梦境 提交于 2021-01-04 03:22:10
问题 I have tables Principles and Tags. And there is a many-to-many relation between them (joined implicitly). Without using prisma.raw , how can I run the following query? SELECT p.id, p.title, p.description, p.createdAt, p.modifiedAt FROM principle p WHERE EXISTS (SELECT NULL FROM _PrincipleToTag pt WHERE pt.B IN (${tagIds.join(',')}) AND pt.A = p.id GROUP BY pt.A HAVING COUNT(DISTINCT pt.B) = ${tagIds.length}) How can I update this Prisma 2 query such that the principles returned are only

Row level security using prisma and postgres

一曲冷凌霜 提交于 2019-12-10 20:12:39
问题 I am using prisma and yoga graphql servers with a postgres DB. I want to implement authorization for my graphql queries. I saw solutions like graphql-shield that solve column level security nicely - meaning I can define a permission and according to it block or allow a specific table or column of data (on in graphql terms, block a whole entity or a specific field). The part I am stuck on is row level security - filtering rows by the data they contain - say I want to allow a logged in user to