Sohail Haider
07/08/2020, 8:22 AMjavascript-client client generated in via docker prismagraphql/prisma:1.34, I'm trying perform or operation like prisma.posts({where: {OR:[...filters]} }) but unable to find any OR field. I have AND field generated and exported though. Any Community help highly appreciated.Ryan
07/08/2020, 8:24 AMSohail Haider
07/08/2020, 8:24 AMSohail Haider
07/08/2020, 8:24 AMtype Post {
id: ID! @id
feedlyId: String @unique
title: String
author: String
language: String
crawled: DateTime
canonicalUrl: String
engagement: Float
published: DateTime
updated: DateTime
picture: String
content: String
summary: String
categories: [Category!] @relation(link: INLINE)
updatedAt: DateTime! @updatedAt
}
type Category {
id: ID! @id
catId: String! @unique
label: String
posts: [Post!]
}
type User {
id: ID! @id
name: String
email: String
login: String
user_id: Int @unique
}Florian
07/08/2020, 8:30 AMwhere clause in your request 😄
prisma.posts({ where: { OR: [...filters] } })Sohail Haider
07/08/2020, 8:33 AMSohail Haider
07/08/2020, 8:35 AMPostWhereInput I have an `AND`field but not any OR field in index.d.tsFlorian
07/08/2020, 8:37 AMSohail Haider
07/08/2020, 8:39 AMFlorian
07/08/2020, 8:39 AMtypescript-client as generator and it's working well :vFlorian
07/08/2020, 8:40 AMSohail Haider
07/08/2020, 8:41 AMRyan
07/08/2020, 8:43 AMnpx prisma1 generate and try again. I tried your schema and it's working on version 1.34.10Sohail Haider
07/08/2020, 8:44 AMSohail Haider
07/08/2020, 8:49 AMSohail Haider
07/08/2020, 8:55 AMtypescript-client and it generates an OR property but not javascript-clientSohail Haider
07/08/2020, 8:58 AMSohail Haider
07/08/2020, 8:59 AMSohail Haider
07/08/2020, 9:22 AMSohail Haider
07/08/2020, 9:32 AMPostWhereInput . any other suggestion?Sohail Haider
07/08/2020, 9:35 AMSohail Haider
07/08/2020, 9:45 AMfindMany only for this query, because its not exporting the OR in PostWhereInput ?Ryan
07/08/2020, 9:46 AMversion: '3'
services:
prisma:
image: prismagraphql/prisma:1.34.10
restart: always
ports:
- '4466:4466'
env_file:
- .env
environment:
JAVA_OPTS: '-Xmx1350m'
PRISMA_CONFIG: |
port: 4466
# uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=secret123 to activate cluster security
# managementApiSecret: ${PRISMA_MANAGEMENT_API_SECRET}
databases:
default:
connector: postgres
host: host.docker.internal
database: prisma1
schema: prisma1
user: postgres
password: password
ssl: false
rawAccess: true
port: '5432'
migrations: true
This is my prisma.yml:
endpoint: <http://localhost:4466>
datamodel: datamodel.graphql
generate:
- generator: javascript-client
output: ./generated/prisma-client/
Run the following commands:
docker-compose up -d
npx prisma1 generate
You will get the OR type as well now for PostWhereInputRyan
07/08/2020, 9:47 AMdatamodel.graphql
type Post {
id: ID! @id
feedlyId: String @unique
title: String
author: String
language: String
crawled: DateTime
canonicalUrl: String
engagement: Float
published: DateTime
updated: DateTime
picture: String
content: String
summary: String
categories: [Category!] @relation(link: TABLE)
updatedAt: DateTime! @updatedAt
}
type Category {
id: ID! @id
catId: String! @unique
label: String
posts: [Post!]
}
type User {
id: ID! @id
name: String
email: String
login: String
user_id: Int @unique
}Sohail Haider
07/08/2020, 10:07 AMdatabaseType: document in prisma.yml. removing it added 'OR' field. Thanks for putting this much effort.Sohail Haider
07/08/2020, 10:22 AM*PostWhereInput* but errors remains the same I've regenerated even. maybe because I'm using mongo?Ryan
07/08/2020, 10:26 AM