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

    Steven Vachon

    06/04/2019, 11:38 PM
    why is
    Copy code
    mutation ($data: ResumeCreateInput!) {
      createResume(data: $data) {
        id
      }
    }
    with
    Copy code
    { "data": {
      "firstName: "me",
      "location": { "city": "mine" }
    } }
    erroring with
    Variable '$data' expected value of type 'ResumeCreateInput!' but got: {"firstName":"me","location":{"city":"mine"}}. Reason: 'location.city' Field 'city' is not defined in the input type 'LocationCreateOneInput'.
    b
    m
    • 3
    • 6
  • s

    Sanat Mool

    06/05/2019, 4:26 AM
    Whoops. Looks like an internal server error. Search your server logs for request ID: local:cjwir1wfd02dd0776z7bg58d2
  • s

    Sanat Mool

    06/05/2019, 4:26 AM
    anyone have an idea how to solve this issue?
  • s

    Sanat Mool

    06/05/2019, 4:26 AM
    in graphQL
  • s

    Sanat Mool

    06/05/2019, 4:26 AM
    primsa
  • e

    ericsonluciano

    06/05/2019, 6:55 AM
    anyone have idea how to implement forgotPassword with send grid
    Copy code
    t.field("forgotPassword", {
          type: "TriggerPasswordResetPayload",
          args: {
            email: stringArg()
          },
          resolve: (parent, { email }, context) => {
            const user = context.prisma.user({ email });
            if (!user) throw new Error("No user with this email.");
            const emailContent = {...}
            sgMail.send(emailContent);
            return null;
      }
    });
  • e

    ericsonluciano

    06/05/2019, 6:56 AM
    i got error with
    "Cannot query field \"id\" on type \"TriggerPasswordResetPayload\".",
  • a

    Andre Coetzee

    06/05/2019, 7:36 AM
    I recently upgraded to prisma 1.34. I noticed that migrations: false has no effect anymore? I assume that this was removed?
    n
    m
    • 3
    • 7
  • a

    Andre Coetzee

    06/05/2019, 8:48 AM
    I am a bit confused with how to handle manual migrations with the new data model. Do you not use prisma deploy? I can’t really find any good docs on this. Has anyone dealt with this yet?
  • j

    jasonmj

    06/05/2019, 2:12 PM
    For some reason my nexus-prisma generated code does not include connection queries. Is there something I'm missing? I thought they were supposed to be gerenated by default when the schema includes relations between types?
  • a

    Andre Coetzee

    06/05/2019, 2:13 PM
    were you using introspect?
  • j

    jasonmj

    06/05/2019, 2:15 PM
    no, this is a new project with ts & psql. i created a datamodel and ran prisma deploy
  • j

    jasonmj

    06/05/2019, 2:15 PM
    the nexus generate command is on the post deploy hook
  • j

    jasonmj

    06/05/2019, 2:16 PM
    Copy code
    type User {
      id: ID! @id
      email: String! @unique
      name: String
      posts: [Post!]!
    }
    
    type Post {
      id: ID! @id
      createdAt: DateTime! @createdAt
      updatedAt: DateTime! @updatedAt
      published: Boolean! @default(value: false)
      title: String!
      content: String
      author: User!
    }
  • j

    jasonmj

    06/05/2019, 2:16 PM
    i have these in my datamodel (among other things)
  • j

    jasonmj

    06/05/2019, 2:16 PM
    so i assumed a postsConnection query would be generated
  • j

    jasonmj

    06/05/2019, 2:31 PM
    ok, i think i found them.
    /src/generated/prisma-client/index.ts
    does contain:
    Copy code
    postsConnection: (
        args?: {
          where?: PostWhereInput;
          orderBy?: PostOrderByInput;
          skip?: Int;
          after?: String;
          before?: String;
          first?: Int;
          last?: Int;
        }
      ) => PostConnectionPromise;
  • j

    jasonmj

    06/05/2019, 2:32 PM
    however, i'm not seeing that in the schema exposed by my graphql-yoga server 🤔
    j
    • 2
    • 2
  • k

    kasi M

    06/05/2019, 2:56 PM
    Hi all, I'm kasi, i have a one problem in graphcool. How to send the data one collection to another collection in graphcool console? Note:it's done only in graphcool console not via frond end.
  • g

    Gaurav

    06/05/2019, 4:36 PM
    Could someone help me with an issue in self-relation usage in prisma datamodel. I have reported the issue in the forum here with a reproduction and a snapshot: https://www.prisma.io/forum/t/prisma-category-self-relation-hierarchy-doesnt-set-child-categories-ever-and-takes-parent-only-for-one-category/7181
  • s

    Steven Vachon

    06/05/2019, 5:36 PM
    why is it that
    Copy code
    query ($id: ResumeWhereUniqueInput!) {
      resume(where: $id) {
        coverLetter
        positions {
          id
        }
      }
    }
    with
    Copy code
    {
      "id": {
        "id": "cjwj8wq7k01980766ixv2jcy2"
      }
    }
    produces
    Copy code
    {
      "data": {
        "resume": {
          "coverLetter": "something",
          "positions": []
        }
      }
    }
    ? the returned
    positions
    array is empty for some reason... this is my schema:
    Copy code
    type Position {
      description: String
      id: ID! @id
    }
    
    type Resume {
      coverLetter: String
      id: ID! @id
      positions: [Position!]!
    }
    e
    c
    • 3
    • 8
  • s

    Steven Vachon

    06/05/2019, 6:07 PM
    @Michał Chmura ^^ 🙂 you always have the answer
  • s

    Steven Vachon

    06/05/2019, 6:07 PM
    (and i'm pretty much desperate at the moment)
  • h

    Hasen

    06/05/2019, 6:21 PM
    Hey all, does anyone know if there exists something to map an object to an update query automatically? I dont want to write this myself if i have to
  • s

    Steven Vachon

    06/05/2019, 6:22 PM
    @Hasen i think the https://npmjs.com/prisma-client-lib does this.. i think that's the ORM part
  • h

    Hasen

    06/05/2019, 6:22 PM
    how? where?
  • h

    Hasen

    06/05/2019, 6:22 PM
    i mean an object not an object of the query
  • s

    Steven Vachon

    06/05/2019, 6:26 PM
    @Hasen hmm, looking at the prisma docs, it would seem that it is mostly an object of the query
  • h

    Hasen

    06/05/2019, 6:29 PM
    yea
  • h

    Hasen

    06/05/2019, 6:30 PM
    well if i get this functionality done i'll put it on github
    👍 1
1...276277278...637Latest