https://www.prisma.io/ logo
Join Slack
Powered by
# prisma-whats-new
  • j

    James

    02/26/2018, 5:30 PM
    btw have you built a graphql in front of a preexisting mysql db before? i'm struggling with concept
  • r

    Ramsay Lanier

    02/26/2018, 5:34 PM
    I have @James - but not with graphcool
  • r

    Ramsay Lanier

    02/26/2018, 5:35 PM
    I had to use sequelize and manually setup models, etc.
  • j

    James

    02/26/2018, 5:35 PM
    with apollo? do you happen to use PHP inbetween the client and the db? how did you export the schema into graphql, is there a tool? (i have 1000+ columns)
  • r

    Ramsay Lanier

    02/26/2018, 5:35 PM
    checkout sequelize
  • j

    James

    02/26/2018, 5:35 PM
    ok, let me google about it
  • r

    Ramsay Lanier

    02/26/2018, 5:36 PM
    its a javascript ORM for SQL databases
  • r

    Ramsay Lanier

    02/26/2018, 5:36 PM
    http://docs.sequelizejs.com/
  • r

    Ramsay Lanier

    02/26/2018, 5:37 PM
    @James I think you’re still going to have to manually create model definitions though
  • j

    James

    02/26/2018, 5:38 PM
    hrm, i'm not a fan of running node on public facing stuff
  • n

    noahdavis

    02/26/2018, 5:38 PM
    @Ramsay Lanier - You could always rebuild your schema and get your data prepared to be inserted into the datastore. You would want to use Prisma for that.
  • p

    pnicolaou

    02/26/2018, 6:08 PM
    Hey I have a schema, where I want to replace posts on update
    Copy code
    type User {
      name: String,
      posts: [Post!]!
    }
    I want to replace the posts for the user. But I am not sure how. If I do
    Copy code
    mutation {
       updateUser(
          where: {id: "123"},
          data: {
            posts: {
             create: [{title: 'hi}, {title: 'hey'}]
           } 
         }
       )
    }
    It just appends the posts, instead of replacing them
    c
    • 2
    • 2
  • t

    terion

    02/26/2018, 6:25 PM
    Cluster API. I send an appProject mutation, it runs ok. Then I send a deploy request. It runs ok, with no errors, but nothing migrates.
    Copy code
    { query: 'mutation($project_name: String!, $stage: String!, $types: String!) {\n    deploy(input: {\n        name: $project_name\n        stage: $stage,\n        types: $types\n    }) {\n        errors {\n            type\n            field\n            description\n        }\n    }\n}',
      variables: 
       { project_name: 'test-project',
         stage: 'local',
         types: 'type Place {... } }
    (full types in comment https://github.com/graphcool/prisma/issues/1948#issuecomment-368598581, they are taken from example server) What is wrong?
  • f

    fcosrno

    02/26/2018, 6:50 PM
    Quick question: I added a type in database/datamodel.graphql then added it to src/schema.graphql, ran
    prisma deploy
    and
    npm start
    , but I cannot perform CRUD operations against the new type. The only queries I see in Schema are the ones under Query in src/schema.graphql. Shouldn't I be able to see the generated ones too?
    m
    • 2
    • 5
  • r

    Ramsay Lanier

    02/26/2018, 7:26 PM
    Would anybody venture a guess as to why a mutation ran through the playground (app default) triggers a subscriptions, but one created through the actual application does not?
  • p

    pasa

    02/26/2018, 8:03 PM
    Hello everybody! I've got a question that could be considered as noobish. It's about the syntax of a mutation:
  • p

    pasa

    02/26/2018, 8:04 PM
    -.txt
  • p

    pasa

    02/26/2018, 8:04 PM
    list is in this case a relation to another type called List.
  • p

    pasa

    02/26/2018, 8:05 PM
    I need to associate the ListEntry with a given List, I can identify by its ID.
  • p

    pasa

    02/26/2018, 8:06 PM
    Could anyone tell me the correct syntax or send me a link, where a this case is explained?
  • p

    pasa

    02/26/2018, 8:07 PM
    Any help is much appreciated! 🙂
  • r

    ruben

    02/26/2018, 8:28 PM
    @pasa you don't need to have id in there at all. When you create the mutation, on your resolver you should return the id, task, and list. So your mutation there would look like
  • r

    ruben

    02/26/2018, 8:28 PM
    -.txt
  • h

    harmony

    02/26/2018, 8:28 PM
    just creating a relation should work
  • h

    harmony

    02/26/2018, 8:29 PM
    what does your data model look like?
  • p

    pasa

    02/26/2018, 8:29 PM
    But how can I identify the list, when I don't set any id?
  • p

    pasa

    02/26/2018, 8:29 PM
    -.txt
  • p

    pnicolaou

    02/26/2018, 8:29 PM
    Hey I have a schema, where I want to replace posts on update
    Copy code
    type User {
    name: String,
    posts: [Post!]!
    }
    I want to replace the posts for the user. But I am not sure how. If I do
    Copy code
    mutation {
    updateUser(
    where: {id: "123"},
    data: {
    posts: {
    create: [{title: 'hi}, {title: 'hey'}]
    }
    }
    )
    }
    It just appends the posts, instead of replacing them
  • r

    ruben

    02/26/2018, 8:30 PM
    When you create the list, the id will autogenerate
  • p

    pasa

    02/26/2018, 8:31 PM
    Yeah I get that, but at this moment, the list is already existent and I have its ID stored in my props.
1...588589590...637Latest