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

    cedric

    10/17/2018, 1:31 AM
    the client example doesn't appear to work either
  • c

    cedric

    10/17/2018, 1:31 AM
    Copy code
    $ node
    > const { prisma } = require('./generated/prisma-client')
    undefined
    > prisma.$raw("SELECT 1")
    TypeError: prisma.$raw is not a function
  • c

    cedric

    10/17/2018, 1:31 AM
    running prisma server and client 1.18.1
  • s

    senorcodecat

    10/17/2018, 10:04 AM
    Hey guys, I'm struggling to understand the relationship between parent and child resolvers with Prisma bindings when running a query and returning a custom type that returns non-scalar fields. Anyone familiar with this that I could pick their brain? It works, but I'm not sure the purpose of having the parent resolver when all 2nd-step resolvers are needed to return the data. I know I must be missing something.
  • s

    senorcodecat

    10/17/2018, 10:05 AM
    I read the blog article on the info object, but it's still not clicking
  • j

    joar

    10/17/2018, 10:54 AM
    I'm getting some craaaaaazy cache issues in graphcool, any way to blow out the cache? Have tried updating comments and whatnot. Right now every query returns a response from a random deploy 0-5 times ago
    d
    n
    • 3
    • 3
  • a

    artindaniel

    10/17/2018, 11:07 AM
    Hey, has anybody used
    graphql-shield
    together with
    apollo-errors
    ? Throwing custom apollo errors in the permission rules is not working for me
    n
    • 2
    • 5
  • j

    jdoyle112

    10/17/2018, 1:47 PM
    Hello all. I have a question about security for a node api. A little off topic but would anyone be able to help?
  • p

    panzupa

    10/17/2018, 6:27 PM
    I'm using graphcool and it's getting kinda slow. To execute query that returns
    3KB
    it needs over 2 seconds. What can I do?
  • b

    Bruce

    10/17/2018, 6:50 PM
    Hey y'all, I could use some help if anyone has some time. I'm trying to get the vscode extension for graphql to work, but seems to run off this .graphqlconfig.yaml file, which I don't have and am having a hardtime making one apparently. My schema is broken up into a bunch of graphql files through out the server and rolled up into one string when the server is started. This config file seems to want a single
    schema: path/to/file
    config though, and I don't want to have to generate an extra duplicate file just for this if I don't have to. Is there any way to get this setup without doing that?
    n
    • 2
    • 2
  • l

    Lucca

    10/17/2018, 7:06 PM
    Can anyone tell me if a prisma server, hosted on prisma cloud, comes with a built in database? If you use the demo server it seems like its a combined solution. But in the docs it says its β€œjust” an abstraction layer. πŸ€”
    πŸ‘ 1
    p
    f
    +2
    • 5
    • 14
  • t

    theom

    10/17/2018, 9:54 PM
    OS: Windows 10 Pro Prisma: 1.18.1 So, I'm getting the following error message (See attached image) when trying to do an initial deploy using
    prisma deploy --env-file variables.env
    My variables.env file reads as follows:
    Copy code
    FRONTEND_URL="<http://localhost:7777>"
    PRISMA_ENDPOINT="<https://eu1.prisma.sh/6e240757-4cce7e/sick-fits/dev>"
    PRISMA_SECRET=""
    APP_SECRET=""
    STRIPE_SECRET=""
    PORT=4444
    My prisma.yml file reads as follows:
    Copy code
    endpoint: ${env:PRISMA_ENDPOINT}
    datamodel: datamodel.prisma
    # secret: ${env:PRISMA_SECRET}
    hooks:
      post-deploy:
        - graphql get-schema -p prisma
    My datamodel.prisma file reads as follows:
    Copy code
    type User {
      id: ID! @unique
      name: String!
    }
    What is the issue here?
    n
    • 2
    • 3
  • h

    Harshit

    10/18/2018, 12:40 PM
    https://github.com/prisma/prisma/issues/2036
    n
    w
    v
    • 4
    • 32
  • h

    Harshit

    10/18/2018, 12:42 PM
    @nilan
  • n

    nilan

    10/18/2018, 12:43 PM
    Please use threads πŸ™‚
    πŸ˜… 1
  • j

    JP

    10/18/2018, 5:27 PM
    Hi Everyone: question about using a local DB with Docker. In the docs (https://www.prisma.io/docs/run-prisma-server/local-prisma-setup-je3i/#example-docker-compose-setup) it says:
    Copy code
    prisma is using the postgres-db container as its database. Instead of referencing the database host via an IP address or URL, it simply references the postgres-db image as the database host:
    I can connect to my DB using
    docker exec -it postgres psql -U prisma
    , but how do I connect via a GUI like Postico? Postico expects a host like this: This gives the error "Hostname not found". Can anyone advise if this is possible?
    βœ… 1
    j
    c
    • 3
    • 26
  • t

    timqian

    10/19/2018, 4:09 AM
    Hey guys, I made a graphql query generator used for testing graphql apis, hopes you will find it useful: https://github.com/timqian/gql-generator
    ❀️ 3
    πŸ’― 1
    n
    • 2
    • 1
  • h

    hinsxd

    10/19/2018, 6:14 AM
    Hi all. Suppose I have
    Copy code
    type Post { 
      id: ID!
      comments: [Comment!]!
    }
    type Comment {
      id: ID!
      user: User!
      comment: String!
    }
    What is the best way to append a new comment to the post? If I add a field
    post: Post!
    into
    Comment
    , it feels too verbose. Is it a common way to always implement 2-way relations?
    n
    • 2
    • 3
  • h

    hinsxd

    10/19/2018, 6:17 AM
    after reading docs I am now trying upserting and see how it goes. seems interesting!
  • l

    Lucas Munhoz

    10/19/2018, 7:09 AM
    Is it possible to use
    fragmentReplacements
    with mutations?
    n
    • 2
    • 1
  • k

    kitze

    10/19/2018, 9:49 AM
    What's the latest way to import the
    WhateverWhereInput
    types in the main
    schema.graphql
    file? Previously it was
    # import WhateverWhereInput from "prismageneratedschemafile.graphql"
    n
    • 2
    • 5
  • e

    ervindraganovic

    10/19/2018, 10:01 AM
    Hi all, let me just quickly caveat this question by saying that I'm somewhat a newbie with Prisma and Graphql. I'm trying to architecture a web application (SAAS-solution) where a company can write messages to their employees. I'm working with two interfaces 1. the Admin from where the message is created and sent, and 2. the interface where the employee can see and interact with the message. My question, as both interfaces will have overlapping data and individual data how do I go about my data model in the back-end. Do I write a data model (with all of the queries and mutations) in one place or do I split it up? Hope this makes sense πŸ™‚
    n
    • 2
    • 2
  • s

    Sach97

    10/19/2018, 10:04 AM
    Hi guys, quick question : is it normal that the prisma server doesn't expose any ws://localhost:4466 endpoint ?
    d
    • 2
    • 6
  • n

    nuno

    10/19/2018, 10:17 AM
    What are the differences between the docker images prismagraphql/prisma and prismagraphql/prisma-prod? The later doesn't even have a description. Neither does prismagraphql/benchmarks. Are they documented somewhere?
    n
    • 2
    • 4
  • m

    Mathias Kandelborg

    10/19/2018, 1:34 PM
    Hi everybody! Nice to be here πŸ™‚ I'm loving working with Prisma and have two questions: I've unfortunately been building my Prisma service in v.16 & .17 and now the new awesome prisma cool client is here. I'm heavily relying on the TS codegen and am a bit afraid to make the jump. - This link from the website is broken https://www.prisma.io/docs/maintain/upgrade-prisma/upgrade-to-1.8-jgp3 Does not give any helpful information in this regard. So my first question is: How do upgrade my Prisma service to use the client? I have a hard time finding any information about differences or anything really. πŸ™‚ My second question is probably a lot easier to answer.. I'm making a query on my GraphQL Yoga server with bindings. But only some of the fields come back, when using the bindings.. The playground retrieves all the fields (which exists) just fine. But as soon as i make the query with the bindings
    const order = await ctx.db.query.order({ where: { id } });
    and log the result; all of the fields aren't retrieved. I'm baffled by this, there's no apparent explanation and of course no errors. So how do i retrieve all the fields from my type? And as an extra, why aren't they already retrieved? I'm sorry if this message is too long, furthermore I'd like to acknowledge my lack of technical information. I'd be happy to elaborate on anything. Anyways, have a nice day! β˜€οΈ
    l
    • 2
    • 2
  • l

    lawjolla

    10/19/2018, 1:42 PM
    I smell a Prisma announcement in the air...
    πŸ‘€ 4
    πŸ‘ƒ 1
    fast parrot 3
    πŸ€” 1
    πŸ˜‚ 1
    prisma cool 1
  • f

    Futurekam

    10/19/2018, 6:32 PM
    Is anyone using prisma-client typescript generator + apollo-server-express, I cant figure out how to import the generated typescript schema into the ApolloServer typeDefs. Any help would be great thank you
  • t

    Tanner

    10/19/2018, 7:05 PM
    @Futurekam does this help?
    Copy code
    # import * from './generated/prisma.graphql';
    
    type Mutation {
        createUser(data: UserCreateInput): User
    ...
    f
    • 2
    • 6
  • j

    Jubal Mabaquiao

    10/20/2018, 3:49 AM
    Hi guys, learning Prisma and was wondering how to achieve a unique object/relationship? Such that on this example, would only allow to create entry on a contest, once for every email. Hope i explained myself well enough
    Copy code
    type Contestant {
      id: ID! @unique
      createdAt: DateTime!
      email: String! @unique
      entries: [Entry!]!
    }
    
    type Entry {
      id: ID! @unique
      createdAt: DateTime!
      contestant: Contestant!
      contest: Contest!
    }
    
    type Contest {
      id: ID! @unique
      title: String!
      slug: String! @unique
      answer: String!
      entries: [Entry!]! //unique entry contestant?
    }
    m
    • 2
    • 1
  • d

    doums

    10/20/2018, 7:14 AM
    Hi all, I currently fighting to have my 2 prisma different projects running at the same time on the same machine because I work on both at the same time. There are 2 different\distinct projects (no sharing data or stuff like that). In my docker-compose.yml files, I changed the default name of both services(prisma, postgres) and volume to be different on each project. But when I run
    docker-compose up -d
    on the second project to start it, I get some error and conflict.
    Copy code
    docker-compose up -d
    Creating volume "prisma_postgres" with default driver
    WARNING: Found orphan containers (drop_db, drop-prisma) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
    Creating prisma_postgres_1 ... 
    Creating prisma_prisma_1   ... error
    
    ERROR: for prisma_prisma_1  Cannot start service prisma: driver failed programming externCreating prisma_postgres_1 ... done
    3e61c908b2d6280040b1): Bind for 0.0.0.0:4466 failed: port is already allocated
    
    ERROR: for prisma  Cannot start service prisma: driver failed programming external connectivity on endpoint prisma_prisma_1 (e343e095d8dcb4c7e508e54c4da677293e0f30d1960e3e61c908b2d6280040b1): Bind for 0.0.0.0:4466 failed: port is already allocated
    ERROR: Encountered errors while bringing up the project.
    So yes I think I have to change the port for one project. But even if I do that what about this
    WARNING: Found orphan containers (drop_db, drop-prisma) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
    ?
    m
    • 2
    • 1
1...137138139...637Latest