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

    ejoebstl

    10/09/2018, 11:51 AM
    Here is the exact definition of all params in the task definition: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html
    y
    • 2
    • 3
  • e

    ejoebstl

    10/09/2018, 11:51 AM
    With this in mind you should have zero problem getting it up on EC2 using docker. The main drawback is that you will manage your own infrastructure. If that's fine for you, I don't see why this would be a problem.
  • e

    ejoebstl

    10/09/2018, 11:52 AM
    Oh and btw, it's totally fine to use docker-compose locally for developing and testing and fargate in the cloud.
    y
    • 2
    • 3
  • s

    siyfion

    10/09/2018, 12:09 PM
    @ejoebstl If the GraphQL API doesn’t match the DB schema 1:1 then you just need to add resolvers for the β€œdifferent” bits.
  • e

    ejoebstl

    10/09/2018, 12:15 PM
    Ah, that makes sense. But in this case, I cannot leverage prisma, I will have to write/generate the SQL myself, correct? Thanks so much for the help!
    n
    • 2
    • 3
  • a

    Antti Toivanen

    10/09/2018, 12:37 PM
    Is it just me, or does prisma generate for graphql-schema omit mutation parameters? e.g. I have
    Copy code
    type Mutation {
      login(email: String!, password: String!): String!
    }
    in my datamodel, but in the generated file this appears as
    Copy code
    type Mutation {
      login: String!
    }`
    n
    • 2
    • 6
  • z

    zonofthor

    10/09/2018, 2:11 PM
    I'm trying to use inline fragment, is it not supported in Prisma?
    Copy code
    mutation($scaffoldId: ID!, $key: String!, $value: String!, $includeFragment: Boolean!) {
        updateScaffold(scaffoldId: $scaffoldId, key: $key, value: $value) {
          id
          title
          ... @include(if: $includeFragment) {
            department {
              id
              title
              organisation {
                title
              }
            }
          }
        }
      }
    n
    • 2
    • 24
  • j

    Joellao

    10/09/2018, 6:43 PM
    Do you guys know when other query aggregations will come in prisma? I need to have like an AVG of all the rates a topic has and show it and wanted to do it from the server without using resource on the client to calculate it since i'm working on a mobile app. Was messing around and thought on something like this
    Copy code
    getUserRateAverage(parent, args, ctx, info) { 
        let rates = ctx.db.query.rates({}, info);
        let sum = 0;
        for (let i = 0; i < rates.length; i++) {
          sum += rates[i];
        }
    
        return rates.length != null ? sum / rates.length : 0;
      },
    but don't know if this is even legit hahahaha, really new with GraphQL and Prisma. Let me know!
    n
    • 2
    • 4
  • g

    Greyson

    10/09/2018, 9:34 PM
    Is it possible to communicate with both Prisma and Prisma-Client Application APIs at the same endpoint, or from the client do I need to make calls to different endpoints depending on the data I need?
    n
    • 2
    • 2
  • s

    Shawn Zhang

    10/10/2018, 3:47 AM
    Hey guys, I'm trying to connect to existing postgres running on amazon rds. But I'm getting
    Exception in thread "main" org.postgresql.util.PSQLException: ERROR: permission denied for database
    . I can even connect to the db inside prisma container using psql with the same username/password. What have I done wrong?
    n
    • 2
    • 5
  • s

    Shawn Zhang

    10/10/2018, 3:48 AM
    -.dockerfile
  • s

    Shawn Zhang

    10/10/2018, 3:49 AM
    When I use postgres in the same docker-compose.yml, prisma can connect to it.
  • e

    Errorname

    10/10/2018, 8:08 AM
    Hey there, I see that there isn't any "good first issue" label on Prisma. I would love to help the project in my spare time, but I don't know where to begin. Maybe using this label would allow me and others to help πŸ™‚
    πŸ‘ 1
    n
    • 2
    • 1
  • y

    yolen

    10/10/2018, 12:38 PM
    Perhaps I have found a bug in the prisma cli. I am a prisma newbie so I post it here to avoid "stupid" github issues. I have a prisma server running using teh fargate tutorial. I ahave managed to deploy my prisma service etc. I then tried to enter the endpoint using an environment variable. the endpoint defined in my environment variable had typos so when I deployed I get a second prisma service: prisma list
    Copy code
    jens@yolenOnlaw:~/Desktop/onlaw_stack$ prisma list
    Service Name          Stage    Server
    ────────────────────  ───────  ────────────────
    onlaw-prisma-servev   default  onlaw-prisma-dev
    onlaw-prisma-service  dev      onlaw-prisma-dev
  • y

    yolen

    10/10/2018, 12:40 PM
    I then wanted to delete the wrong service
    onlaw-prisma-servev
    so I tried
    prisma delete onlaw-prisma-servev
    . no error emssage received but `prisma list`yielded
    Copy code
    jens@yolenOnlaw:~/Desktop/onlaw_stack$ prisma list
    Service Name         Stage    Server
    ───────────────────  ───────  ────────────────
    onlaw-prisma-servev  default  onlaw-prisma-dev
  • y

    yolen

    10/10/2018, 12:41 PM
    I then tried to delete the remaning service (the one with the wrongly named endpoint) but no luck
    Copy code
    jens@yolenOnlaw:~/Desktop/onlaw_stack$ prisma delete onlaw-prisma-servev
    ? Are you sure that you want to delete onlaw-prisma-service@dev? y/N y
    Deleting service onlaw-prisma-service@dev from default 475ms
    jens@yolenOnlaw:~/Desktop/onlaw_stack$ prisma list
    Service Name         Stage    Server
    ───────────────────  ───────  ────────────────
    onlaw-prisma-servev  default  onlaw-prisma-dev
  • y

    yolen

    10/10/2018, 12:42 PM
    Is this a bug or am I more newbie'ish than possible?
    n
    • 2
    • 12
  • d

    doums

    10/10/2018, 1:13 PM
    Hi all I have just started to give a try to the new Prisma Client feature. After the basic setup following the doc https://www.prisma.io/docs/get-started/01-setting-up-prisma-new-database-a002/ I get this error when I try to run the yoga server via
    node index.js
    ->
    Copy code
    internal/modules/cjs/loader.js:583
        throw err;
        ^
    
    Error: Cannot find module 'prisma-client-lib'
        at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
        at Function.Module._load (internal/modules/cjs/loader.js:507:25)
        at Module.require (internal/modules/cjs/loader.js:637:17)
        at require (internal/modules/cjs/helpers.js:20:18)
        at Object.require (/home/pierre/Documents/drop_api/src/prisma-client/index.js:3:20)
        at Module._compile (internal/modules/cjs/loader.js:689:30)
        at Module._compile (/home/pierre/Documents/drop_api/node_modules/pirates/lib/index.js:83:24)
        at Module._extensions..js (internal/modules/cjs/loader.js:700:10)
        at Object.newLoader [as .js] (/home/pierre/Documents/drop_api/node_modules/pirates/lib/index.js:88:7)
        at Module.load (internal/modules/cjs/loader.js:599:32)
    I missed something ?
    βœ”οΈ 1
  • d

    doums

    10/10/2018, 1:15 PM
    The client is generated without any problem, I fail to figure out what happening πŸ˜•
  • d

    doums

    10/10/2018, 1:15 PM
    I use prisma 1.18
    n
    • 2
    • 4
  • d

    doums

    10/10/2018, 1:47 PM
    Using Prisma client, how I can import some generated schema type like DateTime and so on, on my schema.graphql for the yoga server ?
  • d

    doums

    10/10/2018, 1:54 PM
    I talk about the
    # import Example from "./generated/prisma.graphql"
    things. But now prisma client generate the schemas in a .js (if I use the js generator), so it's no more possible to do that. Ok I found, I forgot to add
    Copy code
    - generator: graphql-schema
        output: ../src/generated/prisma.graphql
    in my prisma.yml
    πŸ‘ 1
  • y

    yolen

    10/10/2018, 1:58 PM
    I need to handle files in my application. I found this example https://github.com/prisma/prisma-examples/tree/master/archive/archive/file-handling-s3 but it is in the archive folder of the archive folder of the prisma-examples folder πŸ™‚. Does that mean that the example is outdated?
    n
    • 2
    • 5
  • p

    patrickdevivo

    10/10/2018, 2:14 PM
    hi all, I’m using prisma to generate golang code for prisma-client use, and I’m wondering how I can retrieve an object and it’s relation in a creation call. I have an
    *ObjectExec
    which I can call
    .Exec(ctx)
    on or
    .MyRelation().Exec(ctx)
    on, is there a way to get both objects at once?
    d
    s
    • 3
    • 12
  • p

    patrickdevivo

    10/10/2018, 2:17 PM
    or if anyone knows of more extensive docs for the golang prisma-client, please let me know! i cant seem to find much on it
  • h

    hinsxd

    10/10/2018, 2:57 PM
    hi everyone.
    πŸ‘‹ 2
  • h

    hinsxd

    10/10/2018, 3:30 PM
    anyone here successfully import queries from the generated schema and used them in real queries? I have got a data type
    Order
    with a unique field
    id
    . I imported
    Query.order
    from
    prisma.graphql
    , then implemented the resolvers as:
    Copy code
    orders: (_, args, { prisma }) => prisma.order(arg),
    but it fails, shows
    Copy code
    "Variable '$where' expected value of type 'OrderWhereUniqueInput!' but got: {\"where\":{\"id\":\"cjn1adt3m03ao0875rf9fgh7w\"}}. Reason: 'where' Field 'where' is not defined in the input type 'OrderWhereUniqueInput'. (line 1, column 8):\nquery ($where: OrderWhereUniqueInput!)
    Then I changed it to
    Copy code
    orders: (_, args, { prisma }) => prisma.order(args.where),
    It seems that
    prisma.order()
    takes a
    where
    object. What aboud
    prisma.orders()
    ? I digged into
    prisma.graphql
    and found out that the
    orders
    query takes many arguments. How should I pass down the arguments? Should I pass the whole
    args
    to the function? If so, wouldn't it be inconsistent because the two functions take different arguments?
    n
    d
    • 3
    • 8
  • d

    doums

    10/10/2018, 3:41 PM
    Using prisma client, what is the equivalent of
    ctx.request.get('Authorization')
    to retrieve the Authorization header ?
    n
    h
    • 3
    • 5
  • d

    doums

    10/10/2018, 4:49 PM
    I have a resolver to create a new draft. I have a relation between User and Draft. So my resolver looks like this :
    Copy code
    async createDraft(parent, { text }, ctx) {
        const userId = getUserId(ctx)
        console.log(userId) //userId is OK
        return ctx.prisma.createDraft({
          text,
          author: {
            connect: { id: userId }
          }
        })
      }
    but this create a new draft with a null author. I fail to understand why πŸ€”
    n
    • 2
    • 20
  • s

    shashank

    10/10/2018, 5:11 PM
    Where do I specify schema in the template for fargate (https://www.prisma.io/docs/tutorials/deploy-prisma-servers/aws-fargate-joofei3ahd/#2.-deploying-a-prisma-server-to-fargate) ?
1...133134135...637Latest