https://www.prisma.io/ logo
Join Slack
Powered by
# orm-help
  • g

    Gorodov Maksim

    11/04/2018, 9:18 AM
    I deployed my prisma datamodel to 2 demo servers but they are not displayed in the console. Any ideas?
    d
    • 2
    • 9
  • c

    czysty

    11/04/2018, 11:58 AM
    I get this error while creating the new Prisma server on heroku, anyone knows what is wrong?
    h
    d
    t
    • 4
    • 9
  • s

    Sid

    11/04/2018, 12:08 PM
    I am also getting the same error as @czysty
  • y

    yolen

    11/04/2018, 1:31 PM
    Still running into weird problems with PRISMA_CONFIG and kubernetes. I have the following working setup makefile
    Copy code
    all:  onlaw_configmap database prisma
    
    onlaw_secrets:
    	kubectl create secret generic onlaw --from-env-file=../.env
    
    onlaw_configmap:
    	kubectl delete configmap onlaw --ignore-not-found
    	kubectl create configmap onlaw --from-env-file ../.env
    
    onlaw_db:
    	kubectl apply -f database/pvc.yml
    	kubectl apply -f database/deployment.yml
    	kubectl apply -f database/service.yml
    
    onlaw_prisma: onlaw_configmap	
    	kubectl apply -f prisma/configmap.yml
    	kubectl apply -f prisma/deployment.yml
    	kubectl apply -f prisma/service.yml
    	kubectl get pods
    deployment.yml
    Copy code
    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      name: prisma  
      labels:
        stage: production
        name: prisma
        app: prisma
    spec:
      replicas: 1
      strategy:
        type: Recreate
      template:
        metadata:
          labels:
            stage: production
            name: prisma
            app: prisma
        spec:
          containers:
            - name: prisma
              image: 'prismagraphql/prisma:1.19'
              ports:
                - name: prisma-4466
                  containerPort: 4466
              # command: [ "sh", "-c"]
              # args:
              # - while true; do
              #     echo -en '\n';
              #     printenv DB_USER
              #     printenv PRISMA_CONFIG;
              #     sleep 10;
              #   done;
              env:               
                - name: DB_USER              
                  valueFrom:
                    configMapKeyRef:
                      name: onlaw
                      key: DB_USER            
                - name: DB_PASSWORD
                  valueFrom:
                    configMapKeyRef:
                      name: onlaw
                      key: DB_PASSWORD            
                - name: DB_HOST
                  valueFrom:
                    configMapKeyRef:
                      name: onlaw
                      key: DB_HOST            
                - name: PRISMA_MANAGEMENT_API_SECRET
                  valueFrom:
                    configMapKeyRef:
                      name: onlaw
                      key: PRISMA_MANAGEMENT_API_SECRET            
                - name: PRISMA_HOST_PORT
                  valueFrom:
                    configMapKeyRef:
                      name: onlaw
                      key: PRISMA_HOST_PORT            
                - name: PRISMA_CONFIG
                  valueFrom:
                    configMapKeyRef:
                      name: prisma-configmap
                      key: PRISMA_CONFIG
    configmap.yml
    Copy code
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: prisma-configmap  
      labels:
        stage: production
        name: prisma
        app: prisma
    data:
      PRISMA_CONFIG: |    
        port: penis 
        managementApiSecret: ${PRISMA_MANAGEMENT_API_SECRET}horse
        databases:
          default:
            connector: mysql
            #host: ${DB_HOST}
            host: database
            port: 3306
            #user: ${DB_USER}
            user: root
            #password: ${DB_PASSWORD}
            password: prisma
            migrations: true
    So what troubles me is that it does not matter what the port and or the manament_api_secret is set to in PRISMA_CONFIG. Here it is of course wrong (includes the word "penis") but it works anyway. My guess is that prisma either 1) does string replacement whenever ${} is encountered or that the environment variables set in the pods in deployment.yml equals other environment var that prisma look for besides PRISMA_CONFIG ? What I would like to do is to inject environment variables into the PRISMA_CONFIG yaml scalar block but I cannot figure out how (unless I write a script generating my config files; not a good approach if i later want to store e.g. password in k8s secrets ).
    s
    • 2
    • 2
  • y

    yolen

    11/04/2018, 1:45 PM
    ...here is the output from the running container when executing `env`:
    Copy code
    bash-4.4# env
    PRISMA_PORT_4466_TCP_PROTO=tcp
    DB_HOST=database
    LANG=C.UTF-8
    HOSTNAME=prisma-57776648c-7ljt9
    PRISMA_PORT=<tcp://10.108.177.231:4466>
    JAVA_VERSION_BUILD=12
    PRISMA_HOST_PORT=4467
    DATABASE_PORT_3306_TCP_ADDR=10.111.171.206
    JAVA_HOME=/opt/jdk
    PRISMA_PORT_4466_TCP_ADDR=10.108.177.231
    DB_USER=root
    KUBERNETES_PORT_443_TCP_PROTO=tcp
    KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1
    PRISMA_CONFIG=port: penis
    managementApiSecret: ${PRISMA_MANAGEMENT_API_SECRET}horse
    databases:
      default:
        connector: mysql
        #host: ${DB_HOST}
        host: database
        port: 3306
        #user: ${env:DB_USER}
        user: root
        #password: ${DB_PASSWORD}
        password: prisma
        migrations: true
    
    DATABASE_SERVICE_PORT=3306
    KUBERNETES_PORT=<tcp://10.96.0.1:443>
    JAVA_JCE=standard
    PWD=/
    HOME=/root
    DATABASE_PORT=<tcp://10.111.171.206:3306>
    DB_PASSWORD=prisma
    KUBERNETES_SERVICE_PORT_HTTPS=443
    KUBERNETES_PORT_443_TCP_PORT=443
    JAVA_VERSION_MAJOR=8
    GLIBC_VERSION=2.28-r0
    PRISMA_MANAGEMENT_API_SECRET=XJeqHM6EvBbB
    KUBERNETES_PORT_443_TCP=<tcp://10.96.0.1:443>
    DATABASE_PORT_3306_TCP_PROTO=tcp
    PRISMA_SERVICE_PORT=4466
    COMMIT_SHA=a53d9454ca801c1ce00fed46fa009f5f2cf20b41
    TERM=xterm
    DATABASE_PORT_3306_TCP=<tcp://10.111.171.206:3306>
    GLIBC_REPO=<https://github.com/sgerrand/alpine-pkg-glibc>
    SHLVL=1
    DATABASE_PORT_3306_TCP_PORT=3306
    PRISMA_SERVICE_HOST=10.108.177.231
    DATABASE_SERVICE_HOST=10.111.171.206
    KUBERNETES_SERVICE_PORT=443
    CLUSTER_VERSION=1.19.3
    PRISMA_PORT_4466_TCP_PORT=4466
    JAVA_VERSION_MINOR=192
    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/jdk/bin
    PRISMA_PORT_4466_TCP=<tcp://10.108.177.231:4466>
    KUBERNETES_SERVICE_HOST=10.96.0.1
    JAVA_PACKAGE=server-jre
    _=/usr/bin/env
  • v

    Victor Soares

    11/04/2018, 3:50 PM
    Is it possible to deploy
    Prisma
    and
    GraphQL Yoga
    to
    Zeit Now
    in the same deployment?
    n
    v
    • 3
    • 2
  • a

    anargu

    11/04/2018, 5:37 PM
    Hi, can playground be "closed" ? I mean it's accessed by a link but I want only me or certain people could access to the playground console
  • e

    Extremo

    11/04/2018, 8:26 PM
    Is there already a preview of the ArangoDB Connector?
  • w

    wontwon

    11/05/2018, 4:02 AM
    hello guys. My buddy is setting up a prisma environment on his windows computer. All of the migrations work great, we can get the server up and running but when we make requests to the prisma server from the playground we get this error
    Copy code
    TypeError: Only absolute URLs are supported
        at getNodeRequestOptions (C:\projects\proj\test-graphql\node_modules\node-fetch\lib\index.js:1284:9)
    h
    d
    • 3
    • 5
  • w

    wontwon

    11/05/2018, 4:02 AM
    I’m currently on my mac and everything works as expected
  • p

    pedro

    11/05/2018, 7:48 AM
    Anyone has any idea how can I create this query? https://www.prisma.io/forum/t/how-to-query-a-many-to-many-relation-with-an-inner-table/4924
  • e

    emattias

    11/05/2018, 8:59 AM
    I am now using
    addMockFunctionsToSchema
    from
    graphql-tools
    to mock the whole gql api. Now part of the api is built. How can I mock only the parts that isn't built yet and have the built parts use the real api?
  • p

    prilutskiy

    11/05/2018, 1:38 PM
    Hello guys
  • p

    prilutskiy

    11/05/2018, 1:40 PM
    Is it possible to create a field in
    datamodel.prisma
    , but without mapping it to the database? The general idea is to have, let's say,
    type User
    in my generated
    .graphql
    that has all fields from the datamodel, but also some fields that I'm gonna provide custom resolvers to.
    h
    • 2
    • 2
  • g

    Giancarlo Anemone

    11/05/2018, 4:54 PM
    Just want to say I’m super exited about the
    graphqlgen
    project. This project fills a huge gap in the graphql workflow. Looking forward to using it and hopefully contributing back
    ❤️ 4
    🙌 6
  • m

    Martin Hunt

    11/05/2018, 6:58 PM
    Hello all, I hope this is ok to post here, I'm a self taught developer currently working on taking my skills to the next level by studying more graphql based tech. I feel like I've come a long way over the last few weeks and I'm currently working on a number of personal projects using Prisma, graphql-yoga, apollo & react. I'm looking for someone who's very familiar with this stack and can spare an hour or so every week, or couple of weeks (depending on price) to help me understand some of the bigger, questions I'm getting stuck on when trying to implement certain features / functionality. Of course, I will pay for your time. If anyone here is interested or knows anyone that might be, please feel free to PM me here.
    👍 1
    d
    • 2
    • 2
  • h

    hinsxd

    11/05/2018, 7:33 PM
    I want to try out
    graphqlgen
    too, but where could I get/generate
    ./src/types.ts:
    ? I am using JS prisma client. Should I just mirror the
    datamodal
    to
    types.ts
    ?
    w
    • 2
    • 4
  • c

    CCBCodeMonkey

    11/05/2018, 8:43 PM
    hey, I have a prisma type, lets call it Post, and I have a in prisma for Post called
    public
    , and on my graphql yoga side when someone queries posts() I want to return the public posts along with only the info they requested in the query...
  • c

    CCBCodeMonkey

    11/05/2018, 8:43 PM
    so this means I always need to include requesting
    public
    in my
    db.query.posts
    to prisma even if the user did not specify that field
  • c

    CCBCodeMonkey

    11/05/2018, 8:44 PM
    so that I can check it before returning data to the user requesting
  • c

    CCBCodeMonkey

    11/05/2018, 8:44 PM
    but I don't know how to manipulate the
    info
    object to make sure I get
    public
  • c

    CCBCodeMonkey

    11/05/2018, 8:45 PM
    i could do two queries, one to get public, and another one with the
    info
    the user requested, but that seems imperformant
    l
    • 2
    • 48
  • c

    CCBCodeMonkey

    11/05/2018, 9:02 PM
    followup question, as the last was answered, is there any easy way to extend a prisma type on the yoga side to add a field coming from yoga,
  • c

    CCBCodeMonkey

    11/05/2018, 9:02 PM
    i.e. extend Post to add an "isOwner" field to it which yoga fills out
  • c

    CCBCodeMonkey

    11/05/2018, 9:03 PM
    without copying all the other fields over from Prisma
  • w

    Will King

    11/05/2018, 11:29 PM
    Hey! Just wanted to throw this in here since Prisma has a solid community. I am trying to understand how people use hosts outside of
    localhost
    for local development: https://dev.to/wking/why-do-you-change-the-host-custom-host-in-local-development-4bb7
    j
    • 2
    • 1
  • h

    Hays Clark

    11/05/2018, 11:38 PM
    Looking for a little help with performance testing with Prisma. I am trying to save tracking data that will be assembled into a GeoJSON format, likely on the client side. I want to store and array of Lat, Long, but get and idea of how big of a hit will be to the servers. I was hoping to get some pointers or even a sample Load Test using Prisma. I am also assuming that I would be load testing against my local docker instance.
  • j

    julienkode

    11/06/2018, 7:11 AM
    Hi, I'm brand new to Prisma and I'm wondering how to host myself a Prisma server, I've installed the Typescript advanced boilerplate but when I run it, it is deployed on Prisma server I want to host it myself and have the possibility to scale it
    n
    • 2
    • 3
  • p

    Pieter

    11/06/2018, 10:31 AM
    what’s the best practice for using dates in typescript with graphql schema?
  • p

    Pieter

    11/06/2018, 10:31 AM
    do I just add a scalar for Date? or should I look at something like https://www.npmjs.com/package/graphql-iso-date
    l
    • 2
    • 4
1...149150151...637Latest