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

    Lars-Jørgen Kristiansen

    02/26/2019, 8:13 AM
    Anyone using prisma-nexus in prod? How do you run it? With ts-node? The way the schema is created (referencing .ts files) it wont run with node after compiling with tsc..
    v
    d
    +2
    • 5
    • 30
  • w

    willem

    02/26/2019, 9:32 AM
    Hey all! 👋🏼 Is there someone I could chat to about Prisma Admin?
    👀 1
    m
    • 2
    • 2
  • r

    Ricky

    02/26/2019, 10:25 AM
    Hi there, wondering what is the best way to do data migration between databases? I have 2 separate databases (in the same Google cloudsql instance). They both have the same schema. db A is populated and db B is empty. I would like to make a copy of db A to db B. I ran
    prisma export
    for db A. Then I ran
    prisma import -d <data-from-db-a-export>
    . The nodes and lists imported fine but it constantly gives me error with relations in the format of
    "Failure inserting into relationtable _SurveyQuestionToSurveyResponse with ids StringIdGCValue(cjrcatjb9eeaa0754rfpxi0ay) and StringIdGCValue(cjrcau0oaeryc0754msyvwl3u). Cause: duplicate key value violates unique constraint \"_SurveyQuestionToSurveyResponse_AB_unique\"\n  Detail: Key (\"A\", \"B\")=(cjrcatjb9eeaa0754rfpxi0ay, cjrcau0oaeryc0754msyvwl3u) already exists."
    . Given that db B is initially empty and has the same schema as db A, what could be the possible causes? Thanks
    👍 1
    i
    • 2
    • 1
  • r

    rein

    02/26/2019, 10:28 AM
    hi guys, is there a way to make a microservice connect directly to my prisma endpoint, so not the api layer but still listen for any create/update changes in the data via a sort of hook?
    a
    • 2
    • 2
  • p

    pablo

    02/26/2019, 12:53 PM
    What's the best way to update a prisma server between environments? For instance, I have dev and production environments. I make dozens of migrations and update prisma in dev and want to move to production.
  • l

    Lotafak

    02/26/2019, 2:04 PM
    Hello! I am working on seeders for my project, and it’s basically working. The only problem is that when seeding, the step doesn’t exit - meaning it’s either “stuck” on
    Copy code
    Hooks:
    
    Seeding based on node ./database/seed.js...
    or
    Copy code
    Resetting default@default 340ms
    In addition - the seed finished sucessfully, it’s that CI fails now, because this step is “never finished”. My seed file:
    Copy code
    const { Graphcool } = require('graphcool-binding');
    
    const db = new Graphcool({
      typeDefs: 'src/generated/prisma.graphql',
      endpoint: process.env.PRISMA_ENDPOINT,
      secret: process.env.PRISMA_SECRET,
      debug: false,
    });
    
    const seedUsers = async () => {
      await db.mutation.createUser({
        ...
      });
    };
    seedUsers();
  • s

    swangy

    02/26/2019, 4:02 PM
    Hi, trying to start a sample prisma project while connecting to a local MySQL db
  • s

    swangy

    02/26/2019, 4:03 PM
    Copy code
    ? Set up a new Prisma server or deploy to an existing server? Use existing database
    ? What kind of database do you want to deploy to? MySQL
    ? Does your database contain existing data? No
    ? Enter database host localhost
    ? Enter database port 8889
    ? Enter database user root
    ? Enter database password root
    
    Connecting to database !
     ▸    Connection terminated unexpectedly
    
    Get in touch if you need help: <https://www.prisma.io/forum/>
    To get more detailed output, run $ export DEBUG="*"
    a
    • 2
    • 1
  • s

    swangy

    02/26/2019, 4:03 PM
    anyone have any ideas? i of course tried connecting from another sql client without issues
  • j

    Joellao

    02/26/2019, 6:16 PM
    Hello there, just searching for some ideas on how to implement a friendship system. So i have this datamodel:
    Copy code
    type User {
      id: ID! @unique
      email: String @unique
      username: String @unique
      password: String!
      firstname: String
      lastname: String
      createdAt: DateTime!
      updatedAt: DateTime!
      friends: [Friendship!]!
    }
    
    
    type Friendship{
      id: ID! @unique
      createdAt: DateTime!
      users: [User!]!
    }
    and each user has an array of Friends. So I was thinking to implement it like the users of the people that array, but kinda went and using like the relation with Friendship table since i may want to know when they became friends etc, so the output of that is something like [idUser1, idUser2] and inside the user there is an array with the Ids of this record in Friendship table where the values are saved. Maybe this isn't the best way, in pure SQL i would have done something like the friendship table and saving user1 and user2 without the other fields
    c
    • 2
    • 10
  • r

    rawriclark

    02/26/2019, 7:27 PM
    is anyone else having problems wherre prisma docker instance can't connect to database?
  • r

    rawriclark

    02/26/2019, 7:27 PM
    in an azure vm
  • r

    rawriclark

    02/26/2019, 7:28 PM
    but my local prisma instance can connect with no problem
  • l

    lawjolla

    02/26/2019, 8:02 PM
    Are there any Fargate experts? I'm not clear how to read Prisma's log output from Fargate/ECS. Help?
  • t

    tanekim77

    02/26/2019, 8:59 PM
    I think youtube tutorial on nexus-prism would be very helpful
  • w

    windkomo

    02/26/2019, 9:43 PM
    Writing integration tests injecting data for the test in a
    beforeAll
    using prisma-client:
    Copy code
    let user;
    beforeAll(async () => {
      user = await prisma.createUser({
        name: 'John'
      });
    });
    
    test('stuff', () => {
      const res = doStuffWithUser(user);
      expect(res)...
    });
    good idea or not? Right now I’m creating data manually for each test and reloading database on each test run
    l
    • 2
    • 1
  • e

    eKane

    02/26/2019, 9:44 PM
    Hey Folks! Hope everyone is doing well! I'm converting my GraphQl/Prisma server from JS to TS. I would like to know in the Prisma Typescript example project, is the TypeMap.ts file auto-generated or is the developer responsible for creating this file and defining the Typescript interfaces? See file here: https://github.com/prisma/graphql-prisma-typescript/blob/master/src/resolvers/types/TypeMap.ts
  • c

    ChiwanAhn

    02/27/2019, 12:31 AM
    Hi all, How can I use mutation operation with enum values? I mean I deployed type and enum to prisma server. After that, I tried to seed some data with my seed.graphql file. But server error comes up while I am executing mutation with enum value.
    Copy code
    createUser(
    data: {
      accounts: {
         create: [
             currency: USD *enum value*
             ...
          ]
      }
    }
    )
    • 1
    • 1
  • c

    Cristian

    02/27/2019, 1:10 AM
    I'd like to build a web app using ReactJS on the frontend and graphql-yoga and Prisma on the backend instead of WordPress GraphQL. Has anyone created a datamodel for WordPress taxonomies and terms?
  • j

    James Hunyar

    02/27/2019, 2:41 AM
    Hey all. I am looking for advice on how I can
    connect
    multiple Item types to a List type. My client sends me an array of Item objects in the data, and I am unsure of how to handle it on the server. I do have a mutation to connect individual items to lists using
    connect
    with the passed
    id
    property, to the list by
    id
    as well. I have considered that perhaps I should do an UpdateMany... type of mutation on the passed Items, linking each one to the passed List rather than perform a mutation on the List which was my initial challenge.
    🚀 1
  • s

    sburke

    02/27/2019, 3:25 AM
    I have
    Copy code
    type User {
    foo: String
    }
    and I want to rename the type
    Copy code
    type User {
    foo: Float
    }
    I'm getting
    You already have nodes for this model. This change may result in data loss.
    when I run
    prisma deploy
    j
    l
    • 3
    • 3
  • s

    sburke

    02/27/2019, 3:25 AM
    any help is appreciated 🙂
  • l

    Lotafak

    02/27/2019, 7:29 AM
    I still would appreciate any help on this https://prisma.slack.com/archives/CA491RJH0/p1551189846440400
  • u

    Uxname

    02/27/2019, 8:49 AM
    Is there Dockerfile for Prisma for manual build image? Or instruction, how to build image from sources
    🚀 1
  • o

    ohorovsky

    02/27/2019, 10:18 AM
    Hi guys, I am having issue when I try to query relatedDocUpdates, I can’t get connected user id from it 😞 Error message: Cannot return null for non-nullable field DocUpdate.user. Any help much appreciated!
    Untitled.txt
    p
    j
    • 3
    • 4
  • r

    rem

    02/27/2019, 11:44 AM
    Anyone know what's going on with the current prisma playground? It's chewing through my CPU without anything happening: https://cloudup.com/c0RJx3Ffnbp - I'm suspect it's inside a rAF call, since it calms down when the tab is out of focus (but it may not be that).
    h
    • 2
    • 1
  • r

    rem

    02/27/2019, 11:44 AM
    I'm also seeing constant rendering going on when I'm not interacting with the playground https://cloudup.com/c5mUmG-0TdJ
  • b

    btotharye

    02/27/2019, 12:00 PM
    random question if I'm using the mongo db piece with prisma I'm assuming I have to host my own prisma right since it appears your server service via heroku and such only supports mysql and postgres right? Not a big deal was just curious I have it setup in docker so it wouldn't be that hard to put nginx in front of it for SSL and connect it to the prisma console securely
    j
    k
    • 3
    • 33
  • b

    btotharye

    02/27/2019, 12:52 PM
    Another dilemma I have maybe others can offer an opinion on. I have prisma with mongodb as the backend and I have for example a select input with 5000+ options that I already have in another mongodb collection. I'm debating making these options in the graphql schema so they can be "added" and such there but then that means a lot of querying I feel like to populate the fields, etc even with caching etc. Curious if anyone has any opinion on something like this. Main thing is wondering if it should really be a part of graphql if I think later on these morphs for example would be used as objects later in the system
  • p

    Plínio Naves

    02/27/2019, 12:52 PM
    Hello friend's! My new services deployed to Prisma Console isn't appearing, anyone having this issue too?
    p
    • 2
    • 1
1...225226227...637Latest