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

    darrindickey

    02/09/2019, 5:24 AM
    I’m trying to figure out seeding and related tables. For instance, what if I want User table to have a field named “state” and I want to allow multiple values for the field. These values would match up to a States table.
    Copy code
    state: {
        connect: {
            key: “south-carolina”,
            key: “texas”,
            key: “west-virginia”
        }
    }
    Also, I see relations are required fields. State: [state!]! What if I don’t want that field to be required? I want the user to be able to leave the field blank. Howe do I do that?
    h
    • 2
    • 3
  • r

    rctandfk

    02/09/2019, 9:59 AM
    I would like to know whats the difference between typegraphql and nexus. Anyone? 😅
  • e

    ezeikel

    02/09/2019, 10:27 AM
    Another noobish question. How do I deploy my Prisma server (followed the step by step in the docs) to say Now or Heroku etc? Do I need to create a
    Dockerfile
    ?
    h
    • 2
    • 7
  • l

    Luca

    02/09/2019, 12:39 PM
    Hey guys, I have successfully set up a local Prisma server with PostgreSQL and I can query it with the playground. However, I can't seem to inspect the actual postgres tables when connecting directly to the postgres DB:
    \d
    results in
    No relations found
    .
  • l

    Luca

    02/09/2019, 12:55 PM
    Shouldn't there all be my tables listed?
  • d

    Darryl

    02/09/2019, 1:30 PM
    Do you no longer need to pass
    @model
    in
    datamodel.graphql
    ? I’m looking at some code I wrote last summer and comparing to up-to-date documentation and I see no mention of
    @model
    now. 😕
    h
    • 2
    • 9
  • d

    Darryl

    02/09/2019, 1:31 PM
    For example, I used the following last year:
    Copy code
    type User @model {
      id: ID! @unique
      name: String
      email: String! @unique
    }
  • m

    mharrvic

    02/09/2019, 2:01 PM
    hey guys can i ask on how to query data from current day? like this query { appointments: { startDate: "2019-01-19"} }}
    h
    • 2
    • 1
  • s

    sapkra

    02/09/2019, 5:15 PM
    It's really bad that you are committing on GitHub issues and then you are not solving them. You added them to milestones, which are also never finished. Additionally the amount of PRs is also growing. 80 open PRs are crazy. Please improve the project management on GitHub. @nikolasburk
  • a

    Andres Espinosa

    02/09/2019, 6:59 PM
    What do I need to change on docker-compose.yml to store the data in another place?
  • a

    Andres Espinosa

    02/09/2019, 7:00 PM
    I'm creating a new project and the docker image still contains the data from a previous project
  • a

    Andres Espinosa

    02/09/2019, 7:04 PM
    And how can I see the data in my database through the command line? I tried connecting like
    docker exec -it <container-id> psql -U prisma
    ->
    \c postgres
    ->
    \dt
    and no relations were found
  • l

    Luca

    02/09/2019, 9:40 PM
    anyone?
    h
    t
    • 3
    • 18
  • b

    Benoit Ranque

    02/10/2019, 2:17 AM
    @Luca are you specifying the right schema?
  • b

    Benoit Ranque

    02/10/2019, 2:20 AM
    Hey all so I have a question regarding graphql-nexus, specifically is this an upgrade or is it just a different way to do things? I'm asking for best practice/recommended approach, not whether the library will work in the future. Basically should I try and push towards that library or should I stick with the older sdl approach? Edit: I posted about this on the forum, if you want to check that out: https://www.prisma.io/forum/t/toughts-on-prisma-nexus/5972
    👍 1
    r
    • 2
    • 1
  • c

    Christoph Dietrich

    02/10/2019, 7:58 PM
    I think i found a bug in prisma client call in the orderBy func when using a where search in a relation .... hmmmmm
    d
    • 2
    • 1
  • d

    Darryl

    02/10/2019, 8:02 PM
    Hi, everyone. In
    schema.graphql
    , do I have to rewrite all my types (models) again just as they are in
    datamodel.prisma
    ?
  • d

    Darryl

    02/10/2019, 8:02 PM
    I’m looking over some old Prisma code I wrote last summer and in
    schema.graphql
    I had
    # import * from './generated/prisma.graphql'
    at the top. This doesn’t seem to work now and isn’t mentioned anywhere in the documentation.
  • d

    Darryl

    02/10/2019, 8:12 PM
    In the example – https://www.prisma.io/docs/get-started/03-build-graphql-servers-with-prisma-TYPESCRIPT-t201/#define-graphql-api – it actually mentions how two types (Post and User) are “straightforward re-definitions of the models specified in datamodel.prisma” but is this the only way? Once things get more complex there’s a lot more to keep copying across (including all required enums, etc.).
    b
    t
    • 3
    • 5
  • l

    Luca

    02/10/2019, 8:36 PM
    I am using the Go GraphQL client and experienced panics when sending a lot of requests (10/sec) and I'm not sure where to report the error. For now, I reported it at the examples: https://github.com/prisma/prisma-examples/issues/445
    d
    • 2
    • 6
  • l

    Luca

    02/10/2019, 8:36 PM
    Is this a gqlgen issue?
  • j

    John

    02/10/2019, 9:26 PM
    Hello!
  • t

    Thomas Tran

    02/10/2019, 10:57 PM
    Hi , anyone can here know how to setup/configure the access control permission for the user/roles. For example, I only permission certain user to perform query on the data or access data base on some user id and prevent the user to modify the server data. Thanks.
    h
    • 2
    • 1
  • b

    Benoit Ranque

    02/11/2019, 3:38 AM
    I have a question regarding nexus again: is it supposed to be javascript compatible?
    h
    • 2
    • 1
  • t

    tonymj

    02/11/2019, 9:14 AM
    I need help.... late 2week i use prisma v1.25 with a project and it works find then yesterday i updated to v1.26 due to constant change of
    var DefaultEndpoint = ""<http://localhost:4466>""
    to
    var DefaultEndpoint = "<http://localhost:4466>"
    in v1.25.. Right now am facing a huge error that i don't know how to solve each time i run
    go run script/gqlgen.go
    . The funny thing is this code runs fine until the upgrade this is the error:
    Copy code
    /home/tonymj/gocode/pkg/mod/github.com/prisma/prisma-client-lib-go@v0.0.0-20181017161110-68a1f9908416/exec.go:7:2: could not import <http://github.com/mitchellh/mapstructure|github.com/mitchellh/mapstructure> (cannot find package "<http://github.com/mitchellh/mapstructure|github.com/mitchellh/mapstructure>" in any of:
            /snap/go/3129/src/github.com/mitchellh/mapstructure (from $GOROOT)
            /home/tonymj/gocode/src/github.com/mitchellh/mapstructure (from $GOPATH))
    /home/tonymj/gocode/pkg/mod/github.com/prisma/prisma-client-lib-go@v0.0.0-20181017161110-68a1f9908416/lib.go:8:6: could not import <http://github.com/dgrijalva/jwt-go|github.com/dgrijalva/jwt-go> (cannot find package "<http://github.com/dgrijalva/jwt-go|github.com/dgrijalva/jwt-go>" in any of:
            /snap/go/3129/src/github.com/dgrijalva/jwt-go (from $GOROOT)
            /home/tonymj/gocode/src/github.com/dgrijalva/jwt-go (from $GOPATH))
    /home/tonymj/gocode/pkg/mod/github.com/prisma/prisma-client-lib-go@v0.0.0-20181017161110-68a1f9908416/lib.go:9:2: could not import <http://github.com/machinebox/graphql|github.com/machinebox/graphql> (cannot find package "<http://github.com/machinebox/graphql|github.com/machinebox/graphql>" in any of:
            /snap/go/3129/src/github.com/machinebox/graphql (from $GOROOT)
            /home/tonymj/gocode/src/github.com/machinebox/graphql (from $GOPATH))
    /home/tonymj/gocode/src/github.com/tonymj76/Job/generated/prisma-client/prisma.go:54:40: cannot use opts (variable of type []<http://github.com/machinebox/graphql.ClientOption)|github.com/machinebox/graphql.ClientOption)> as []invalid type value in argument to prisma.New
    validation failed: couldn't load packages due to errors: <http://github.com/tonymj76/Job/generated/prisma-client|github.com/tonymj76/Job/generated/prisma-client>, <http://github.com/prisma/prisma-client-lib-go|github.com/prisma/prisma-client-lib-go>
    exit status 2
    d
    h
    • 3
    • 5
  • d

    Darryl

    02/11/2019, 9:36 AM
    Is the future of Prisma code-first? The reason I ask is because I just read an article (link below) and I’m about to start a new project so don’t want to build something and then potentially miss the benefits of another solution that’s so close.
    h
    r
    • 3
    • 7
  • d

    Darryl

    02/11/2019, 9:36 AM
    https://www.prisma.io/blog/the-problems-of-schema-first-graphql-development-x1mn4cb0tyl3/
  • d

    Darryl

    02/11/2019, 2:06 PM
    Is anyone else having trouble running
    prisma playground
    ? I see the following:
    Copy code
    Cannot read property 'getProjects' of null
    h
    • 2
    • 12
  • d

    Darryl

    02/11/2019, 2:06 PM
    It’s the same as mentioned hehttps://github.com/prisma/prisma/issues/3215
  • d

    Darryl

    02/11/2019, 2:07 PM
    I added a comment at the bottom, showing my
    prisma.yml
    and folder structure.
1...207208209...637Latest