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

    Andrew O.

    09/13/2019, 11:06 PM
    I can't find a way to create a DateTime type with Nexus. Does anyone know how to do this?
  • s

    ScottAgirs

    09/13/2019, 11:40 PM
    Hey folks! Have an issue here with environmental variables in
    prisma.yml
    file, when deploying to Zeit’s Now:
    in development (localhost) [of course, haha] everything works as expected. prisma.yml
    Copy code
    datamodel: datamodel.prisma
    endpoint: ${env:PRISMA_ENDPOINT}
    secret: ${env:PRISMA_SECRET}
    
    ..
    however, when deploying with
    now
    the deployment times out with the following error:
    Copy code
    /home/nowuser/src/node_modules/prisma-binding/dist/Prisma.js:41
    T              throw new Error(" *No Prisma endpoint found. Please provide the `endpoint` constructor option.* ");
    T              ^
    T  Error: No Prisma endpoint found. Please provide the `endpoint` constructor option.
    T      at new Prisma (/home/nowuser/src/node_modules/prisma-binding/dist/Prisma.js:41:19)
    T      at Object.<anonymous> (/home/nowuser/src/src/db.js:4:12)
    T      at Module._compile (module.js:652:30)
    T
    T      at Module.load (module.js:565:32)
    T      at tryModuleLoad (module.js:505:12)
    T      at Function.Module._load (module.js:497:3)
    T      at Module.require (module.js:596:17)
    T      at require (internal/module.js:11:18)
    T      at Object.<anonymous> (/home/nowuser/src/src/index.js:3:12)
    T  [nodemon] app crashed - waiting for file changes before starting...
    T  More details: <https://err.sh/now-cli/no-open-port-found>
    T  signal: 9
    T  npm start
    and a now.json:
    Copy code
    {
      "version": 1,
      "build": {
        "env": {
          "DEV_FRONTEND_URL": "777",
          "FRONTEND_URL": "777",
          "PRISMA_ENDPOINT": "777",
          "PRISMA_SECRET": "777",
          "APP_SECRET": "777",
          "STRIPE_SECRET": "777",
    
          ..
    
        }
      }
    }
    Any ideas fellow fellasz?
    b
    • 2
    • 1
  • j

    Joey

    09/14/2019, 12:48 AM
    Maybe a stupid question, but what's the purpose of the [build graphql api](https://www.prisma.io/docs/get-started/03-build-graphql-servers-with-prisma-JAVASCRIPT-e001/) section of the docs? i thought the point of prisma was that it auto-generated the graphql api out of your schema? the localhost:4000 graphql api loses access to all the cool auto generated shit that localhost:4466 has. is there some reason i shouldn't be hitting the auto-generated api?
    l
    • 2
    • 1
  • v

    Virgil Dinu

    09/14/2019, 6:49 AM
    Hi! Is there any Prisma version where creating/updating nested mutations with PostgreSQL backed works?
  • v

    Virgil Dinu

    09/14/2019, 8:23 AM
    It seems that Prisma does not fully suport Postgresql 9.4. Tested on 11 and nested mutations are working fine. Error was on SQL "on conflict do nothing".
  • t

    TomHage

    09/14/2019, 5:29 PM
    Hi! I am a newbie to Prisma, and just following the GraphQL+Node tutorial. If the schema.graphql and the Playground query is correct, is there other reasons you get null data and this message? >> "Cannot query field 'login' on type 'Mutation'. I am set up with docker containers running Prisma and Postgres servers...
  • c

    Carl Bowen

    09/14/2019, 11:37 PM
    Hi guys. Any idea how to migrate from Yoga/Prisma server to Gql/Prisma Nexus please? Much appreciated!!! Was directed to this but it's proving a little hard of a transition: https://www.prisma.io/blog/introducing-graphql-nexus-code-first-graphql-server-development-ll6s1yy5cxl5
  • m

    Marciano

    09/15/2019, 8:04 PM
    Hey, I'm trying to solve
    Error: Cannot return null for non-nullable field Log.id.
    . Googled already to find an answer but I can't seem to find a solution. Does somebody have an idea what it could be? This is my code: Query resolver:
    Copy code
    const Query = {
      async logs(parent, args, ctx, info) {
        const logs = await ctx.db.query.logs();
    
        return logs;
      }
    };
    
    module.exports = Query;
    schema.graphql
    Copy code
    input LogInput {
      name: String!
      date: DateTime!
    }
    
    type Mutation {
      createLog(data: LogInput): Log!
    }
    
    type Query {
      logs: Log
    }
    datamodel:
    Copy code
    type Log {
      id: ID! @id
      name: String!
      date: DateTime!
    
    }
    • 1
    • 1
  • j

    Jack Hollis-London

    09/15/2019, 11:42 PM
    how does anyone actually get prisma working in production
    d
    • 2
    • 2
  • m

    Martí Crespí

    09/16/2019, 6:21 AM
    How prevent that prisma does changes on my DDBB? I have in my
    docker-compose.yml
    file the option
    migrations
    to false, but it's doing all changes according to my datamodel.prisma, I want to do my changes in DDBB directly and when I deploy my server it should check if the datamodel is ok with my DDBB. I'm using
    1.34.5
    version.
  • k

    koufatzis

    09/16/2019, 8:06 AM
    Hey, I am using
    prisma deploy
    but it seems that the new fields I added in the
    datamodel.prisma
    are not being deployed to the service. Because after running
    prisma import
    command following issues are being logged:``` "The model XXX with id ZZZ has an unknown field 'YYY' in field list.", ``` Is there anything I need to be aware of about
    prisma deploy
    ?
  • d

    deactivateduser

    09/16/2019, 12:50 PM
    Hey, I would like to use relations as I am, coming from a mySQL environment, think it's the best approach. I checked out wesbos advanced react course and saw that he is not making use of relations: https://github.com/wesbos/Advanced-React/blob/master/finished-application/backend/datamodel.graphql (see cart). Anyways, are relations the way to go? I have items and users I wanna relate to each other. Moreover, I fail to find resources on how to handle the relations with prisma and graphql, anyone?
  • j

    Josef Henryson

    09/16/2019, 4:48 PM
    Does anyone know if nexus-prisma has any community or support? Or is Prisma channels the way to go for answers?
    t
    • 2
    • 2
  • c

    Corey Snyder

    09/16/2019, 5:12 PM
    Has anyone used a schema design like below to allow tables to extend from a common Type/Table? For instance Motors, Batteries, and Flight Controllers are all Products. And so they’ll have common fields and table links. But they also have attributes that are unique that sub-product. I think this will solve my problem where can only link between tables by a single Type. For instance
    Images
    has a
    product: FlightControler
    attribute. I was trying to figure out how I could link my Images to other product types and really couldn’t figure it out. You can’t do
    product: [FlightControllers, Motors, Battery]
    , you have to give it a single Type to create a relationship to. So with this model, I think I can link all my other tables with
    product:  Product
    and then the product can then link to all of the product types. Thoughts?
    j
    • 2
    • 3
  • c

    Corey Snyder

    09/16/2019, 11:26 PM
    With this DB Schema, is it possible to query for ProductReviews by FlightController ID where User.id === 12345?
    j
    • 2
    • 4
  • m

    Michael Feldstein

    09/17/2019, 4:09 AM
    Is there a way to get TypeScript types for my prisma data models in my client based on the datamodel from the server?
    d
    • 2
    • 1
  • t

    Toni Bennet

    09/17/2019, 2:43 PM
    i have a question on implementing this in the backend I'm unsure where to put that question. I'm trying to connect with Entity Framework in .net Core Thanks.
    t
    • 2
    • 2
  • h

    Hays Clark

    09/17/2019, 7:45 PM
    I have been away for a couple months, is there a good resource to finding the current status of Prisma 2 features?
    • 1
    • 1
  • a

    Andrew O.

    09/17/2019, 8:23 PM
    https://fullstackdatasolutions.com/creating-datetime-scalar-with-nexus-graphql/
    👍 1
  • a

    Adam

    09/18/2019, 12:49 AM
    I'm trying to navigate the graphql/Prisma world and having some trouble figuring out what the latest (production-ready) recommendations are
  • a

    Adam

    09/18/2019, 12:49 AM
    Is there a good starting point that folks can recommend?
  • a

    Adam

    09/18/2019, 12:52 AM
    I'm concerned about the latency increase associated with Prisma 1's proxy server approach
  • t

    Thor Mengkheang

    09/18/2019, 6:42 AM
    why i can't call aggregate function with
    prisma-binding
    like in the document https://www.prisma.io/docs/prisma-client/basic-data-access/reading-data-JAVASCRIPT-rsc2/#aggregations
    await prisma.customersConnection().aggregate().count()
  • j

    Jack

    09/18/2019, 3:28 PM
    Is the
    @rename
    directive still working or no? It prints promising output in the terminal, but nothing actually changes in the DB... It seems to be just when renaming types - renaming a field seems to work fine.
    • 1
    • 1
  • k

    Kimble

    09/18/2019, 11:37 PM
    Hi Prisma team - is anyone able to help resolve this issue with node run time versions being deprecated on graph.cool? I think I've tracked down to the line of code that needs to be changed so would be much appreciated https://github.com/prisma/graphcool-framework/issues/577
  • c

    Cameron Gorrrie

    09/19/2019, 12:49 AM
    Quick question; just getting started with Prisma and PostgreSQL.
    Copy code
    type Cart {
      id: Int! @id
      sessionId: String! @unique
      user: User!
      items: [CartItem!]!
      createdAt: DateTime! @createdAt
      updatedAt: DateTime! @updatedAt
    }
    I want to upsert a cart given a sessionId and userId, but the autogenerated client doesn't have that capability (only
    id
    and
    sessionId
    are available). How could I go about this with the client, or am I going to have to dip into SQL?
  • a

    Adil

    09/19/2019, 10:46 AM
    Hey everyone! Did anyone succeed running 2 prisma instances locally?
  • a

    Adil

    09/19/2019, 10:48 AM
    if yes, could you please share docker-compose?
  • d

    doums

    09/19/2019, 11:57 AM
    Hi all! Just a little question: Does
    nexus-prisma
    with prisma"1" support graphql subscriptions please ? Thanks !
  • d

    doums

    09/19/2019, 12:03 PM
    Same question for Prisma2 and
    nexus-prisma2
    ?
1...312313314...637Latest