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

    callan

    11/01/2018, 12:17 PM
    hey guys, I'm having trouble getting my typescript types to work with prisma-client and graphqlgen
  • c

    callan

    11/01/2018, 12:18 PM
    I have my resolvers split up into two GraphQL types:
    Mutation
    and
    Query
  • c

    callan

    11/01/2018, 12:18 PM
    I'm able to assign the types from graphqlgen to my resolver objects just fine -
    Copy code
    const Mutation: MutationResolvers.Type = {
    //...
    }
  • c

    callan

    11/01/2018, 12:19 PM
    however when i'm forwarding resolver args to my DB queries, the types don't match
  • c

    callan

    11/01/2018, 12:19 PM
    here is an example
  • c

    callan

    11/01/2018, 12:19 PM
    Copy code
    createItem: async (parent, args, { db }, info) => {
        const item = await db.createItem(args)
    
        return item
      },
  • c

    callan

    11/01/2018, 12:20 PM
    looks good, however the type of args (from graphqlgen) is
    MutationResolvers.ArgsCreateItem
  • c

    callan

    11/01/2018, 12:21 PM
    And the args expected by
    db.createItem
    (from prisma-client) is
    ItemCreateInput
  • c

    callan

    11/01/2018, 12:21 PM
    typescript's telling me those types don't match
  • c

    callan

    11/01/2018, 12:21 PM
    mainly because one has optional types defined as
    type | null
    whereas the other is
    type | undefined
  • c

    callan

    11/01/2018, 12:23 PM
    I could just cast to
    ItemCreateInput
    and then it'll be accepted, i think... but yeah am i doing something wrong?
  • c

    callan

    11/01/2018, 12:32 PM
    yeah, can verify that in order to get graphqlgen to work with prisma-client i have to do stuff like this:
    Copy code
    const item = await db.createItem(args as ItemCreateInput)
  • c

    callan

    11/01/2018, 12:32 PM
    not the end of the world but it would be a great QOL improvement if it could infer args properly when there are non-required fields
  • c

    callan

    11/01/2018, 12:34 PM
    would be even better if I could assign my resolver objects to resolver object types made by
    prisma-client
    , since the types generated by graphqlgen are basically the same
  • c

    callan

    11/01/2018, 12:34 PM
    only difference is graphqlgen makes my grouped resolver object types and
    prisma-client
    does not
    k
    c
    • 3
    • 10
  • j

    jdoyle112

    11/01/2018, 1:15 PM
    Anyone else having trouble loading their prisma console?
  • c

    callan

    11/01/2018, 1:54 PM
    Also, on another matter, does anyone know how to use
    forwardTo
    with
    prisma-client
    ?
    l
    • 2
    • 10
  • y

    yolen

    11/01/2018, 2:13 PM
    Dear all. Anyone of you have tried to define an aws cloudformation (fargate) template which includes the yoga server? If so I would like to take a look 🙂 I go the prisma fargate up and running already; no problem (almost...)
  • m

    Martin Hunt

    11/01/2018, 3:07 PM
    Hello all! I'm curious what validation libraries people are using with a graphq-yoga server? I'm using Joi right not but wondered if there's anything more well suited?
    h
    • 2
    • 2
  • r

    rem

    11/01/2018, 4:35 PM
    I'm getting
    Could not connect to database. Prisma Config doesn't have any database connection
    on
    prisma introspect
    b
    • 2
    • 1
  • r

    rem

    11/01/2018, 4:35 PM
    Anyone seen this/have a solution?
  • r

    rem

    11/01/2018, 4:36 PM
    I'm using prisma with an existing db (postgres)
  • r

    rem

    11/01/2018, 5:13 PM
    Does prisma give us allUsers (ala graph.cool) or is there something similar?
  • r

    rem

    11/01/2018, 5:14 PM
    nv, found it (I think):
    users
    👍 1
  • z

    Zefex Developer

    11/01/2018, 7:01 PM
    Is there a way to extract the sql generated by prisma from the docker database?
    👍 1
    e
    h
    • 3
    • 5
  • b

    brandonmikeska

    11/01/2018, 7:18 PM
    Hey I am searching for this error:
    ERROR: operator does not exist: integer = character varying
    . Using an existing PG Database, and the foreign keys are on two varying char columns, but it looks like Prisma is still trying to generate the SQL and do a join by the built in ID field. Is there a way to correct this?
  • u

    UsulPro

    11/01/2018, 7:50 PM
    Hi! Cant deploy to Graphcool service. Got
    Copy code
    There are issues with the new service definition:
    
      Global
        ✖ software.amazon.awssdk.services.lambda.model.TooManyRequestsException: Rate exceeded (Service: null; Status Code: 429; Error Code: TooManyRequestsException; Request ID: 077da308-de0f-11e8-b99c-5f65162f0014)
    
    Here are your GraphQL Endpoints:
    Tried multiple times with the same result ☠️
    h
    • 2
    • 2
  • y

    yolen

    11/01/2018, 7:54 PM
    anybody tried docker for AWS? https://docs.docker.com/docker-for-aws/why/
  • d

    Dmitry

    11/01/2018, 8:41 PM
    Hi everyone!
  • y

    yolen

    11/01/2018, 8:46 PM
    I got is almost up and running using docker for AWS. However, once I connect prisma with the aws rds auroramysql5.7 instance the io cpu load is close to 100%. any idea why? here is a look at my prisma container log
    m
    • 2
    • 7
1...147148149...637Latest