prisma

Apollo GraphQL subscriptions is not working in Vuejs

烈酒焚心 提交于 2019-12-13 13:07:03
问题 I am using GraphQL Subscription with Prisma and vuejs + apollo client In local system, I am running vuejs at http://localhost:8080 and server at http://localhost:4000. I want to display recently added and updated records in dashboard. I have implemented subscription in my local system and it's working proper. I push all server side and client side code to server but subscription is not working there. I am using AWS server. Everything is working proper except subscription. I set up websockets

filter out unneeded object properties for interface in typescript

霸气de小男生 提交于 2019-12-11 06:37:13
问题 As background, I'm using Prisma (graphql), mysql2 (nodejs) and typescript. I'm using an interactive command line script to connect to mysql2. This is the warning I am seeing: Ignoring invalid configuration option passed to Connection: type. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration options to a Connection This is how I instantiate mysql2, in my MysqlConnector class: this.connectionPromise = await this.mysql

TypeScript issue with export

给你一囗甜甜゛ 提交于 2019-12-11 04:27:55
问题 I'm facing the issue with export in the prisma ts file: I'm running it in the node graphql project. following is the issue: 05-12-2018 18:20:16: SyntaxError: /home/user/Publish/PracticeBusiness/src/generated/prisma.ts: Unexpected token, expected { (11:7) 05-12-2018 18:20:16: 9 | import { makePrismaBindingClass, BasePrismaOptions } from 'remote-graphql-binding' 05-12-2018 18:20:16: 10 | 05-12-2018 18:20:16: > 11 | export interface Query { 05-12-2018 18:20:16: | ^ 05-12-2018 18:20:16: 12 |

Unable to use Fragments on GraphQL-yoga with Primsa

最后都变了- 提交于 2019-12-10 23:39:48
问题 I am using graphql-yoga with Prisma and Prisma-Bindings I'm trying to add a fragment to my resolver so that a specific field (id in this situation) is always fetched when the user asks for a custom field, costsToDate. This is so i can make some additional queries needed to build the result for that field, and i need the ID of the object for that. Unfortunatley i can't seem to get it to work, and the documentations seems a little lacking on the specifics with graphql-yoga and Prisma. Here is

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

Prisma Deploy Docker error “Could not connect to server”

夙愿已清 提交于 2019-12-04 09:51:37
问题 This is steps I have done prisma init I set postgresql for database in my local(not exist). It created 3 files, datamodel.graphql, docker-compose.yml, prisma.yml docker-compose up -d I confirmed it running successfully But if I call prisma deploy , it shows me error Could not connect to server at http://localhost:4466. Please check if your server is running. All I have done is standard operation described in manual and there is no customization in https://www.prisma.io/docs/tutorials/deploy

Prisma Deploy Docker error “Could not connect to server”

99封情书 提交于 2019-12-03 03:26:43
This is steps I have done prisma init I set postgresql for database in my local(not exist). It created 3 files, datamodel.graphql, docker-compose.yml, prisma.yml docker-compose up -d I confirmed it running successfully But if I call prisma deploy , it shows me error Could not connect to server at http://localhost:4466. Please check if your server is running. All I have done is standard operation described in manual and there is no customization in https://www.prisma.io/docs/tutorials/deploy-prisma-servers/local-(docker)-meemaesh3k And this is docker-compose.yml version: '3' services: prisma:

Prisma data modeling has many and belongs to

被刻印的时光 ゝ 提交于 2019-12-02 01:57:45
I have a prisma data model that consists of a root Category and a Subcategory. A Category has many Subcategories and a Subcategory belongs to one Category. My model looks like this: type Category { id: ID! @unique createdAt: DateTime! updatedAt: DateTime! name: String! subCategories: [SubCategory!]! @relation(name: "Subcategories") } type SubCategory { id: ID! @unique createdAt: DateTime! updatedAt: DateTime! name: String! category: Category! @relation(name: "ParentCategory") cards: [Card!]! @relation(name: "SubCategoryCards") #Category @relation(name: "CardCategory") } Now when i go to create

程序员会这招,女朋友开心到不行

一笑奈何 提交于 2019-11-28 20:04:43
恋爱小Tip: 如果你会图像风格迁移… 那么,暗恋的女生就再也不能以“我们画风不同不能相爱拒绝你了”! 哈哈,好冷的笑话。好了,现在言归正穿,相信每个人第一次看到摄影APP prisma时,都被其有趣新奇的功能吸引了目光,prisma能够为一张普通的照片赋予各种各样绘画流派的风格,用从古至今每个绘画天才的笔触,描绘出你手机镜头收录的一切。比如下面这张普通得不能再普通的高楼大厦: 如果你非常喜欢浮世绘的风格,那我们试试让《神奈川冲浪里》的作者葛饰北斋为你画出眼前此景吧: 或许我们也可以把梵高,蒙克叫上一起来玩: 那么有的小朋友就会问了,这个app比孙悟空72变更能变换风格,它究竟是如何做到的呢? 这其实是人工智能的一种应用,叫图像风格迁移。 图像风格迁移,是指让算法学习某个画作的风格,然后在另一张图片上体现出这种风格。也就是说,就是借助于卷积神经网络,预先将画作中的风格训练成出模型,只要在目标照片中应用这种模型,那么就可以生成相同风格化图像。用过成表示的话就是:“物体识别——纹理合成——风格提取——图片合成”。 在之前的图中我们看到,两张图片一张是负责提供内容的,另一张负责提供图像风格,这两张用来生成一张全新的图片。得到的图片内容没变,但具有了新的风格。那么问题就在于我们是如何实现的,要回答这个问题,我们需要再深挖一些,去了解卷积神经网络,卷积神经网络学习到的到底是什么

prisma反向代理

安稳与你 提交于 2019-11-28 15:09:40
概要 为什么要做 prisma 的反向代理 反向代理示例(by golang) prisma 服务 gateway 服务 整体流程 认证 反向代理 权限 总结 概要 接触 prisma 有段时间了, 期间也使用过其他几种 graphql 接口自动生成的框架. 总的来说, 还是 prisma 生成的接口比较丰富, 使用上也比较方便, 和数据库之间耦合也低. prisma 文档: https://www.prisma.io/docs (写本文时是 1.34 版) 为什么要做 prisma 的反向代理 prisma 服务虽然自动生成了接口, 但是这些接口其实不建议直接暴露给前端来用, 因为实际项目中, 最基本的要对接口进行认证和权限控制. 甚至还有其他需求, 不可能只用自动生成的接口就能完成所有的功能. 所以, 一般在使用 prisma 服务的时候, 一般都会再封装一层(可以称为 gateway), 在 gateway 上做认证, 权限等等, 只有合法的请求才会最终转发到 prisma 服务上. prisma 服务本身可以导出 client SDK, 用来方便 gateway 的编写, 目前支持 4 种格式 (javascript, typescript, golang, flow), javascript 和 typescript 的是 client SDK 功能比较全, golang