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

    James Hunyar

    01/30/2019, 3:51 AM
    I've attempted to check for errors inside of the
    user
    inside of this same resolver, but realized quickly that the GraphQL Error is happening before this resolver. If I'm missing key concepts and there is documentation, I'm just looking to be pointed in that direction, but I feel I've exhausted most of the documentation on the subject without a workable solution.
  • m

    mikedklein

    01/30/2019, 3:54 AM
    @James Hunyar have you tried to wrapping the
    const user
    in a try catch I assume your schema has a unique constraint on the user email that is being violated on the prisma server not the yoga server.
  • j

    James Hunyar

    01/30/2019, 3:56 AM
    @mikedklein Thanks, I don't think I've added the const user into a try catch, I was adding the return operation to one without success. I'll try that. I also found that I could query for a user with that email and throw an error myself prior to code execution.
  • j

    James Hunyar

    01/30/2019, 3:57 AM
    -.js
  • m

    mikedklein

    01/30/2019, 3:57 AM
    yup thats a nice way too
  • j

    James Hunyar

    01/30/2019, 3:57 AM
    This at least allows me to throw a custom error, I will probably use a custom error constructor for this in the long run. Thanks again!
  • m

    mikedklein

    01/30/2019, 3:57 AM
    I don’t like leaving try catches in either but it would be a good way to isolate the error and make sure that is what is happeneing
    ✔️ 1
  • m

    mikedklein

    01/30/2019, 3:59 AM
    I actually usually just handle them on the front end pass the error along with an error component that strips the gibberish out
  • m

    mikedklein

    01/30/2019, 4:01 AM
    {error.message.replace('GraphQL error: ', '')}
  • m

    mikedklein

    01/30/2019, 4:01 AM
    got that from @wesbos course and thought it was nice and clean
  • m

    mikedklein

    01/30/2019, 4:01 AM
    and I have extended it to handle more common situations
  • j

    James Hunyar

    01/30/2019, 4:02 AM
    That was my first thought, I was struggling with stripping the gibberish, but I'll keep that in mind. I'm building both the server and client in this case so I don't mind handling it client-side, but when possible I'm hoping to provide an at least somewhat sanitized error to the client in the event that I pass on client development later. Thanks for that code snippet, I'll try that out on the client side and see which approach is more workable for now.
    👍 1
  • n

    NoahVlncrt

    01/30/2019, 5:36 AM
    Has anyone had experience with this tool?
  • n

    NoahVlncrt

    01/30/2019, 5:36 AM
    https://github.com/graphql-boilerplates/node-graphql-server/tree/master/advanced
  • n

    NoahVlncrt

    01/30/2019, 5:36 AM
    I'm getting some issues with data type being null
  • n

    NoahVlncrt

    01/30/2019, 5:36 AM
    but it's not acccepting a data field in graphql play ground 😕
  • j

    John Smeeth

    01/30/2019, 5:53 AM
    hi all
  • j

    John Smeeth

    01/30/2019, 5:53 AM
    i am generate to golang code with
  • j

    John Smeeth

    01/30/2019, 5:53 AM
    Copy code
    generate:
      - generator: go-client
        output: ./generated/prisma-client/
      - generator: graphql-schema
        output: ./generated/
  • j

    John Smeeth

    01/30/2019, 5:54 AM
    How can i import types from
    ./generated/prisma.graphql
    to
    server/schema.graphql
    file
  • j

    John Smeeth

    01/30/2019, 5:54 AM
    I tried import like
    # import User from "../prisma/generated/prisma.graphql"
    then using it as follow
    Copy code
    type Query {
      users: [User!]!
    }
    
    type Mutation {
      createUser(email: String!): User
    }
    d
    • 2
    • 10
  • j

    John Smeeth

    01/30/2019, 5:55 AM
    But when i run
    go scripts/gqlgen.go
    i got
  • j

    John Smeeth

    01/30/2019, 5:55 AM
    Copy code
    server/schema.graphql:13: Undefined type User.
    exit status 2
  • j

    John Smeeth

    01/30/2019, 6:27 AM
    anyone pls help. Thanks
  • b

    bepasquet

    01/30/2019, 7:08 AM
    any updates on using geoqueries on prisma? or a alternative way?
  • h

    huv1k

    01/30/2019, 8:38 AM
    There is new
    graphql-playground
    release, it should fix most of issues with polling. If there is still problem please create issue Thx and enjoy 🚀
    💚 5
  • j

    Jidé

    01/30/2019, 10:52 AM
    If I wanted to do paging and know how many total items there are, I would have to 2 queries ? One query with first and skip, and another using aggregation ?
    h
    • 2
    • 1
  • k

    Kris Temmerman

    01/30/2019, 10:53 AM
    Anyone with a list of migration directives ?
  • k

    Kris Temmerman

    01/30/2019, 10:57 AM
    I added some fields to my types, but i can't find the temporary directive
  • o

    Omprakash

    01/30/2019, 12:59 PM
    Prisma creates tables in MYSQL for each relation rather than having the foreign key reference in the actual node table. Is there anyway to have the foreign keys in the corresponding tables and resolve all the underscore relation tables ?
    👍 1
    d
    • 2
    • 1
1...200201202...637Latest