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

    Corey Lanier

    04/15/2019, 8:32 PM
    Having an issue trying to set up another connect on an item in my database, where the mutation leaves the item the same, but if I update the item's name string it'll mutate that. Code listed here: https://stackoverflow.com/questions/55621765/how-to-make-multiple-connects-in-one-gql-mutation
  • d

    dnbkr

    04/15/2019, 10:55 PM
    i'm getting an error when I try to import my schema
    # import * from './generated/prisma.graphql'
    Invalid or unexpected token
  • d

    dnbkr

    04/15/2019, 10:55 PM
    it works in an older project, has this changed?
  • d

    dnbkr

    04/15/2019, 11:22 PM
    nvm i was importing the typeDefs wrong in a different file
  • c

    CCBCodeMonkey

    04/16/2019, 4:00 AM
    has anyone gotten execute raw to work?
  • c

    CCBCodeMonkey

    04/16/2019, 4:01 AM
    I am able to run the function now but it never finds my tables
  • c

    CCBCodeMonkey

    04/16/2019, 4:06 AM
    oh, I got it to work @James I figured out the execute raw
  • c

    CCBCodeMonkey

    04/16/2019, 4:07 AM
    you have to select it like this:
    Copy code
    mutation {
      executeRaw(
        query: "SELECT * FROM default$default.\"User\""
      )
    }
  • j

    James

    04/16/2019, 4:10 AM
    yeah
  • c

    CCBCodeMonkey

    04/16/2019, 4:12 AM
    you said it wasn't working for you last night right
  • j

    James

    04/16/2019, 4:15 AM
    no, it just took me a while to figure it out
  • c

    CCBCodeMonkey

    04/16/2019, 4:19 AM
    ah ok, yea took me a while too
  • c

    CCBCodeMonkey

    04/16/2019, 4:20 AM
    I realized my dev server wasn't even using my heroku instance because prisma cloud is so confusing
  • c

    CCBCodeMonkey

    04/16/2019, 4:20 AM
    which is why executeRaw wasn't working
  • c

    CCBCodeMonkey

    04/16/2019, 4:24 AM
    I made a little function to deal with this garbage weirdness
  • c

    CCBCodeMonkey

    04/16/2019, 4:24 AM
    Copy code
    const createQuery = (query) => {
      const returnQuery = `${query} `.replace(/"/g, '\\"').replace(/\n/g, ' ').replace(/\s+/g, ' ');
      return returnQuery;
    };
    
    const executeQuery = async (query) => {
      const fixedQuery = createQuery(query);
      const response = await prisma.$graphql(`
      mutation {
        executeRaw(query: "${fixedQuery}")
      }
    `);
    
      return response.executeRaw;
    };
        const results = await executeQuery('SELECT count("id") FROM "default$default"."YourTable" group by "yourField"');
  • c

    CCBCodeMonkey

    04/16/2019, 4:31 AM
    long way to go to get a group by
  • j

    James

    04/16/2019, 5:46 AM
    not too bad.
  • c

    CCBCodeMonkey

    04/16/2019, 5:55 AM
    I guess prisma has saved me enough time in building my gql API that 2 days to figure out a group by isn't that bad lol
  • n

    Novalis

    04/16/2019, 8:33 AM
    Hey, my mate and I got a problem with generating the prisma-client in the CD pipeline. I'm wondering, does anyone have more experience in this and give us some tips or tell us more about how to integrate Prisma properly into the CD pipeline? A workaround would be generating the schema locally and then send the generated stuff into the docker container, but I feel like there must be a better way!
  • r

    rem

    04/16/2019, 9:03 AM
    I'm very confused about version numbers in prisma, let alone how to properly upgrade. I see this: https://cloudup.com/cmeyRTsMY0R - which has 1.7, 1.8 and 1.16 all from the 1.30 documentation. Is there a page explaining what versions relate to what?
  • r

    rem

    04/16/2019, 9:04 AM
    and when I upgrade all my node deps, and the docker image - I still can't access
    /_admin
    - the playground tries to access it as a database called "_admin"
  • r

    rem

    04/16/2019, 10:21 AM
    How do I update a heroku instance of the Prisma server? I think I followed the docs online, but now realise my server's not been updated since Jan.
  • b

    bkstorm

    04/16/2019, 10:32 AM
    Does anyone have problems with
    @scalarList
    when using datamodel v1.1. When I using it, it always return empty list. I just create an new issue on github: https://github.com/prisma/datamodel-v1.1-feedback/issues/17
  • b

    boennemann

    04/16/2019, 11:09 AM
    Heyho 👋 Is there a pattern to manage prisma realtime subscriptions, i.e. manage that there is exactly one? Can I tell prisma to disconnect old subscriptions somehow?
  • t

    Taras Protchenko

    04/16/2019, 11:20 AM
    Anyone? https://prisma.slack.com/archives/CA491RJH0/p1555313488100600
  • w

    Wesley Rast

    04/16/2019, 1:49 PM
    Hey, I'm following a GraphQL tutorial on Udemy that calls for the use of Prisma's Docker image along with a Heroku Postgres database. I've verified the database is working correctly from a couple different db IDEs, but the Docker container can't contact the db, and the
    prisma deploy
    fails because it can't find the Docker container running. Anyone else having trouble with the Docker container? I've also run
    docker ps
    and verified that the image is running correctly and on the correct port. The instructions said to use Docker Toolbox in Windows, which is what I'm doing, but I'm seeing in the Docker documentation lots of references to "don't use this" and to use Docker Desktop instead. Is this Prisma's advice as well?
    • 1
    • 1
  • e

    emattias

    04/16/2019, 1:49 PM
    I have
    Copy code
    type ItemHierarchyNode {
      id: ID!
      name: String!
      children: [ItemHierarchyNode!]!
    }
    and the root node always has id of
    root
    . Depending on variables sent in to the graphql query
    children
    will or will not be an empty list on the root node (with the same id=
    root
    ). This messes up apollo cache because it doesnt update the cache once root has been cached. What is the recommended way to handle this, other than not caching at all?
  • z

    Zak

    04/16/2019, 4:24 PM
    Am_getting__Cannot_return_null_for_non-nullable_field_Organization_id.ts
    j
    • 2
    • 38
  • z

    Zak

    04/16/2019, 4:25 PM
    Cannot return null for non-nullable field Organization.id
1...254255256...637Latest