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

    Bradley

    08/16/2019, 2:41 PM
    Hi guys, how do I go about updating Prisma hosted servers to the latest version? The links below are the only information I can find and they're not really applicable as far as I can tell https://www.prisma.io/docs/faq/keep-prisma-server-and-cli-in-sync-fq07/ https://github.com/prisma/prisma-cloud-feedback/issues/202
  • j

    Jose Garcia

    08/16/2019, 2:49 PM
    So I'm trying to start a prisma server with a database that has existing data in it. I run
    prisma introspect
    first to get a schema of the existing data. But when I run
    prisma deploy
    I get this error
    column "category_id" of relation "subcategory" already exists
    . I've tried
    prisma deploy --force
    ,
    prisma detelete
    and the
    prisma deploy
    , but nothing seems to get rid of this error. Any idea on how to get rid of it?
  • a

    Alexander

    08/16/2019, 3:58 PM
    Can anybody tell me the best practice how to access computed fields / custom resolvers in the prisma client / apollo server? Is there any documentation on how to do that?
  • t

    Tim Chambers

    08/16/2019, 4:19 PM
    I have a Prisma 1.34.5 instance deployed on Fargate, and beginning last night, it's been responding with internal server errors after a short period of time. If I manually restart the instance, it works again for a while before failing again. Looking at the logs, I'm seeing a lot of these recently, where it looks like a metrics endpoint that Prisma posts to is returning a 502 error, and when that happens a few times in a row, the instance stops working:
    Copy code
    Push to Prometheus Gateway failed with:
    com.prisma.akkautil.http.FailedResponseCodeError: Server responded with 502
    akka.stream.scaladsl.TcpIdleTimeoutException: TCP idle-timeout encountered on connection to [<http://metrics-eu1.prisma.io:443|metrics-eu1.prisma.io:443>], no bytes passed in the last 30 seconds
    Can I disable these Prometheus pings until the endpoint is working again? Are there any other workarounds?
  • a

    Andrew O.

    08/16/2019, 11:08 PM
    So I'm just trying to connect Prisma to an existing MySQL DB, I did an introspection, and have everything set up. However when I type "prisma deploy" it creates a new schema in my DB instead of using the exesting one. existing is named "transactions", I tried having an endpiont {url}/transactions, but that creates a transactions@default schema, I can find know why to leave the stage value off when connecting to the schema.
  • a

    Andrew O.

    08/16/2019, 11:08 PM
    How is this solved?
  • k

    Kennah

    08/17/2019, 2:34 PM
    Hae guys. How do you write custom express routes in graphql yoga. For example when you want to use a cookie middleware you could write something like this Server.express.use(cookieParser()). How do you achieve the same functionality with routes. server.get() or even server.express.get() don’t seem to do anything. Am trying to implement clean urls with next js
    e
    • 2
    • 5
  • c

    Corey Snyder

    08/18/2019, 2:59 AM
    @Harshit How do I do environment variables in my prisma.yml exactly? I’m trying to follow the documentation here: https://www.prisma.io/docs/1.2/reference/service-configuration/prisma.yml/using-variables-nu5oith4da I have something like this:
    Copy code
    endpoint: ${env:DB_API_URL, <https://us1.prisma.sh/my-id/my-app/dev>}
    It’s not super clear how defaults should work EXACTLY. Your documentation shows:
    otherYamlKey: ${src:myVariable, defaultValue}
    without the string in quotes or anything but it doesn’t work like that. Also, I’d really like to use the
    .env
    file referenced here:
    if the --dotenv argument was omitted, a file called .env in the same directory
    but it’s not working. It’s unclear for the documentation: 1. “In the same directory”. Is that as the root where you’re running the command from, or as the prisma.yml file 2. Can you give an example of what this file should look like? Is it JSON, YML, other? I created a file with 1 line in it and it didn’t work.
    Copy code
    DB_API_URL=<https://us1.prisma.sh/my-id/my-app/dev>
  • m

    mikias abebe

    08/18/2019, 9:16 AM
    hey, everyone, I am glad to be here.
  • m

    mikias abebe

    08/18/2019, 9:17 AM
    I was just wondering what is the best way to structure your codebase for a graphql project with Prisma and also a high-level view of deploying a Prisma app to aws with ci/cd pipeline? thanks in advance
    t
    • 2
    • 3
  • c

    Chris

    08/18/2019, 4:35 PM
    👋 Is there a bug in the built-in Prisma server graphql editor when creating records that have lists? If I try to add a new record, then for the field that contains the list I select "Set", and make my selection I get an error updating. Looking at the JSON, it seems to inserting an extra
    set
    field that causes the issue. My schema is really simple (see thread).
    • 1
    • 2
  • d

    Deepak Pathak

    08/19/2019, 3:41 AM
    Good morning fellow devs, I am building a learning app, where I am generating a JWT using
    jsonwebtoken
    npm package. It works fine for generation, but when in another mutation, I pass the token as an
    HTTP Header - Authorization key
    as Bearer <<token>>, it fails in a call to jwt.verify(). Error I get is -
    JsonWebTokenError: invalid token at Object.module.exports [as verify]
    Any ideas ?
    • 1
    • 2
  • r

    Ruslan Baigunussov

    08/19/2019, 7:10 AM
    Hi guys. I'm trying to use folowing prisma schema
    Copy code
    enum Gender {
      MALE
      FEMALE
    }
    
    type User {
      id: Int! @id
      createdAt: DateTime! @createdAt
      updatedAt: DateTime! @updatedAt
      firstName: String!
      lastName: String!
      gender: Gender!
      birthday: DateTime!
      email: String! @unique
      password: String!
      phone: String @unique
      avatar: Picture
      usersToClubs: [UserToClub!]
    }
    
    type Club {
      id: Int! @id
      createdAt: DateTime! @createdAt
      updatedAt: DateTime! @updatedAt
      name: String! @unique
      description: String
      location: Location
      avatar: Picture
      usersToClubs: [UserToClub!]
    }
    
    enum ClubRole {
      MEMBER
      MANAGER
    }
    
    type UserToClub @relationTable {
      user: User!
      club: Club!
      role: ClubRole!
    }
    but get an error
    java.util.NoSuchElementException: None.get at scala.None$.get(Option.scala:349)
    when
    prisma deploy
    If change
    type UserToClub
    to
    Copy code
    type UserToClub {
      id: Int! @id
      user: User!
      club: Club!
      role: ClubRole!
    }
    everything is works, but I don't need
    id
    field in this table
    d
    • 2
    • 5
  • j

    James

    08/19/2019, 11:13 AM
    I'm having trouble understanding the progress of the mongodb connector. Is it ready for primetime. Can I use it in production?
  • n

    Nick

    08/19/2019, 1:14 PM
    @Prisma Community A while a ago I was excited for Yoga2 project. It seemed like a really nice idea
    conversion over configuration
    . Something that’s missing in node.js community. While that been said it has been months since any commits on the project
    👍 2
    o
    d
    j
    • 4
    • 5
  • n

    Nelson Pecora

    08/19/2019, 8:37 PM
    hi folks. what’s the equivalent to
    Copy code
    input RelatedItemInput {
      create: ContentCreateInput
      connect: ContentWhereUniqueInput # auto-generated input type
      delete: Boolean
    }
    
    input ContentCreateInput {
      relatedItem: RelatedItemInput
    }
    in nexus-prisma? It doesn’t seem to want me to create input types that are in any way cyclical
    • 1
    • 1
  • o

    Oliver Evans

    08/20/2019, 2:22 PM
    Hi there! I'm having an issue where the wrong schema changes are being applied by prisma deploy. I just added the field
    Notes: [String]
    to my schema, and when I `prisma deploy`ed, I saw the message
    Copy code
    + Created field `Notes` of type `[String!]!`
    This is the second time I noticed this specific issue, where a
    [String]
    is incorrectly marked as a
    [String!]!
    . The error is reflected in the schema in graphql-playground.
    Copy code
    % yarn -s prisma --version
    Prisma CLI version: prisma/1.33.0-beta (linux-x64) node-v11.15.0
    Prisma server version: 1.33.0-beta
  • g

    Ghassen Ghabarou

    08/20/2019, 7:49 PM
    Hello I'm following the course in howtographql.com on graphql and node and in the following code fragment, I get OR is not defined:
    Copy code
    async function feed(parent, args, context, info) {
      const where = args.filter ? {
        OR: [
          { description_contains: args.filter },
          { url_contains: args.filter },
        ],
      } : {}
    
      const links = await context.prisma.links({
        where
      })
      return links
    }
    So I checked the generated prisma.schema.js and indeed it wasn't defined in LinkWhereInput I don't know if this has happened to other people or if there's actually a problem with my setup.
    s
    • 2
    • 2
  • j

    jasonmj

    08/20/2019, 9:38 PM
    hi there, i'm having trouble writing a query resolver. i want to include data from a relationship, but can't figure out how. can someone point me in the right direction?
    l
    c
    • 3
    • 13
  • a

    Andrew Malek

    08/20/2019, 10:47 PM
    Hey guys, I just deployed the Prisma docker image on ECS fargate in my private VPC, and was wondering what is the best way to call
    prisma deploy
    on a private instance
    k
    • 2
    • 3
  • h

    Hmm

    08/20/2019, 11:30 PM
    I'm not sure if this is a Prisma specific thing or not, But I am trying to get this Query to sort the
    ideas
    of `users`:
    Copy code
    query users {
      users {
        id
        ideas(orderBy: createdAt_DESC) {
          id
        }
      }
    }
    It works without the
    orderBy
    argument. However with the
    orderBy
    arg, I get this error:
    "Unknown argument \"orderBy\" on field \"ideas\" of type \"User\"."
    My
    ideas
    schema is here: https://github.com/hmmChase/next-graphql-starter/blob/master/backend/src/schema/schema.graphql#L29 My
    ideas
    resolver is here: https://github.com/hmmChase/next-graphql-starter/blob/master/backend/src/resolvers/ideaResolver.js#L16 Btw, if I Query
    ideas
    with the
    orderBy
    directly:
    Copy code
    query ideas {
      ideas(orderBy: createdAt_DESC) {
        id
      }
    }
    It works. I am just confused how to make the nested field sorting work.
  • w

    William Kwao

    08/21/2019, 2:41 AM
    Has anyone tried using Prisma to persist user defined order? An example will be the order of items in a todo list. I’ve come across the the Jira Lexorank algorithm and articles like this https://begriffs.com/posts/2018-03-20-user-defined-order.html. What do you recommend?
  • a

    Andrew Malek

    08/21/2019, 5:45 AM
    Does Lift/Prisma 2 Support JSONB?
  • a

    Andrew Malek

    08/21/2019, 5:46 AM
    I was messing around with Prisma 1.34 Migrate and I could not convert my existing JsonB fields in my postgres db to Prisma
    j
    • 2
    • 3
  • m

    Martí Crespí

    08/21/2019, 1:09 PM
    Hi, someone knows how pass a json input variable in the playground? I have tried to escape double quotes but doesn't work,
    Reason: 'system' Not valid
    Sin título
    m
    • 2
    • 8
  • a

    Andrew O.

    08/21/2019, 8:38 PM
    Does anyone have experience connecting to an existing MySQL DB with Prisma? I can get it to build the datamodel.prisma file, but can't get prisma to connect to the correct Schema.
  • c

    Corey Snyder

    08/22/2019, 1:15 AM
    I have a datamodel which resembles that of below. I am unable to delete `User`s when they have an
    EmailVerificaton
    tied to them. I think this has to do with the relationship type that is set. Do you know how I can revise the model so that deletes on
    User
    automatically delete associated `EmailVerification`s
    Copy code
    type User {
        id: ID! @id
        name: String!
        email: String! @unique
        emailVerification: [EmailVerification] @relation(name: "UserEmailVerifications")
    }
    
    type EmailVerification{
        id: ID! @id
        verificationCode: String! @unique
        user: User! @relation(name: "UserEmailVerifications")
    }
    • 1
    • 1
  • m

    Mark Stephenson

    08/22/2019, 7:55 AM
    What is the 'source of truth' for the prisma (1) service? If I have a prisma service up and running, and do a prisma deploy.. it creates the relevant database tables etc. then the prisma service is replaces (aws instance upgraded) I then do a prisma deploy again.. Does the prisma service check the existing DB schema to make diffs or does it use local metadata?
  • m

    Muhaki

    08/22/2019, 11:34 AM
    Hi guys, anyone familiar with Apollo Client?
    d
    a
    • 3
    • 12
  • i

    Isaac Weber

    08/22/2019, 3:24 PM
    Should I be running
    prisma generate
    everytime I
    prisma deploy
    ?
    m
    • 2
    • 2
1...302303304...637Latest