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

    Omar

    04/09/2020, 4:14 AM
    Can anyone help me please ? Thanks you
  • o

    Omar

    04/09/2020, 4:14 AM
    btw : Prisma CLI version: prisma/1.34.10 (linux-x64) node-v12.13.0
  • s

    Sacha Weatherstone

    04/09/2020, 5:44 AM
    A question about Nexus, how can I remove fields from a auto generated mutation from a prisma model, i.e.
    Copy code
    schema.mutationType({
      definition(t) {
        t.crud.createOneUser()
      },
    })
    But I don't want the option of specifying the users id in the mutation.
    👍 1
    n
    • 2
    • 2
  • w

    wuichen

    04/09/2020, 6:12 AM
    Hi all, I was wondering if anyone thought about using hasura with prisma. So basically, you create a hasura graphql engine and then use prisma to introspect the database hasura created. By doing this, you get the default graphql endpoints and auth system. When you need custom business logic, you can create a remote schema which uses prisma orm to access the database. If anyone is interested in this idea, we can start a repo with this infrastructure.
    n
    f
    • 3
    • 3
  • n

    Nicola Nardella

    04/09/2020, 7:36 AM
    Hello, anyone know how to fix prisma-example, https://github.com/prisma/prisma-examples/blob/master/typescript/graphql-nextjs/pages/api/index.ts
    g
    • 2
    • 4
  • s

    Sacha Weatherstone

    04/09/2020, 8:24 AM
    is there any way at the moment to access/use the Field Authorize plugin in nexus-prisma, i.e. return an error on accessing a
    schema.objectType
    or even a specific model?
  • s

    Sachin Jani

    04/09/2020, 12:53 PM
    is prisma forums down right now? I'm kinda blocked with this right now so if anyone has a solutions for this nexus issue please drop in the thread. https://www.prisma.io/forum/t/nexus-not-expose-all-functions-not-able-to-call-aggregation-from-nexus-interface/7543
    j
    • 2
    • 1
  • p

    peter

    04/09/2020, 8:06 PM
    are you editing the npx scripts now?
  • r

    Raluca Fleseriu

    04/09/2020, 8:24 PM
    ERROR: Token is issued in the future (iat).
    {
    "data": {
    "addProject": null
    },
    "errors": [
    {
    "locations": [
    {
    "line": 2,
    "column": 9
    }
    ],
    "path": [
    "addProject"
    ],
    "code": 3015,
    "message": "Token is issued in the future (iat).",
    "requestId": "local:ck8t82idw1fl90725fogs8xdy"
    }
    ],
    "status": 200
    }
    Get in touch if you need help: <https://slack.prisma.io>
    I still have this issue, have no clue where to start looking. Do you have at least some resurces to point me to? https://prisma.slack.com/archives/CA491RJH0/p1586339152379000
    r
    • 2
    • 7
  • i

    iandjx

    04/10/2020, 8:36 AM
    Copy code
    enum Tech {
      JAVASCRIPT
      PYTHON
      PHP
      TYPESCRIPT
      GO
      JAVA
      RUBY
      ANDROID
      SWIFT
    }
    
    model Repository {
      id                 Int    @default(autoincrement()) @id
      githubRepositoryId Int    @unique
      name               String
      description        String
      owner              User   @relation("CreatedReposByUser", fields: [id], references: [id])
      collaborators      User[] @relation("ReposByUser", references: [id])
      techStack          Tech[]
    }
    how do i make a mutation query in prisma nexus to create a repository? stuck with techstack enum
  • f

    friebetill

    04/10/2020, 9:27 AM
    Hey, quick question, is something like
    latestStory
    in Prisma 1 possible? I’ve only seen this with strings, but with complex data types, Prisma tells me that there must be a relation. But I want to implement the resolver to access the stories and get the latest story without changing the underlying database. I have to do this for backward compatibility.
    Copy code
    type User {
      id: ID! @unique
      stories: [Story]! @relation(name: "stories")
      latestStory: Story
    }
    
    type Story {
      id: ID! @unique
      text: String!
      author: User! @relation(name: "stories", link: INLINE)
      createdAt: DateTime! @createdAt
    }
    If it is not possible, is it possible with prisma 2?
    i
    • 2
    • 2
  • s

    sash

    04/10/2020, 10:52 AM
    Hey, I have a question about setting up new projects and defining schemas in v2, looking https://github.com/prisma/prisma-examples/tree/master/javascript/graphql-apollo-server it seems like the models are defined in 3 places?
    schema.prisma
    , `schema.graphql`and
    schema.js
    , in v1 it was possible to use a
    graphql-schema
    and reference the types from there, is that still the case in v2?
    r
    • 2
    • 2
  • j

    Joshua Waurich

    04/10/2020, 11:18 AM
    So in Prisma 2 you have to create the db and tables manually?
    j
    s
    • 3
    • 5
  • j

    jt

    04/10/2020, 4:49 PM
    @Samrith Shankar I was able to figure it out actually...thanks for offering to help! Now, I'm banging my head against a wall trying to figure out how to get a production environment set up on a linux box so I can push my code to it. The "sys admin" for the project I'm working on is useless, so I'm having to do it myself. Can you or anyone else help me get started on setting this up so I can push code and have it build and deploy in a production environment. I'm a little overwhelmed with the docs and this process. Thanks!
  • s

    Seppe Snoeck

    04/10/2020, 4:50 PM
    Does someone have a working
    .prisma
    vscode extention?
    s
    • 2
    • 1
  • s

    Samrith Shankar

    04/10/2020, 4:50 PM
    Sure, @jt PM me. :)
    👍 1
  • p

    peter

    04/10/2020, 4:51 PM
    I used prisma migrate and it worked like a charm
    🙂 1
  • p

    peter

    04/10/2020, 4:54 PM
    is prisma related to nextjs?
    m
    • 2
    • 7
  • g

    Giorgio Delgado

    04/10/2020, 5:53 PM
    Is nexusjs an alternative to apollo server? What are the biggest differences between these two projects? Seems like apollo has a lot more "batteries" included
    m
    b
    • 3
    • 3
  • t

    technicallynick

    04/10/2020, 5:55 PM
    Hi all! When trying to play around with subscriptions in the Playground (Prisma1), I only ever get an error saying "The provided query doesn't include any known model name. Please check for the latest subscriptions API." I can't seem to find any bugs or other posts about this error that aren't related to server side subscription deployments. I feel like I'm missing a vital step in my setup on the server side as the subscription syntax is quite simple. Are there any "gotchas" to the server side setup when doing subscriptions? All the docs I've read seem to indicate it should work out-of-the-box.
  • a

    Alan

    04/10/2020, 9:37 PM
    I am migrating Prisma from Javascript To Typescript. How can the file
    schema.ts
    is generated? Do I have to write it or it is generated automatically? (example with: https://github.com/prisma/prisma-examples/blob/master/typescript/graphql-apollo-server/src/schema.ts)
    s
    • 2
    • 3
  • a

    Adriano Resende

    04/10/2020, 9:41 PM
    Folks, in Prisma v2 how I use query if a type has entries? I’m not getting with this query:
    Copy code
    prisma.category.findMany({
      where: {
        basket: {
          where: {
            food: {
              where: {
                id: true
              }
            }
          }
        }
      }
    })
    m
    j
    • 3
    • 11
  • a

    Adriano Resende

    04/10/2020, 9:42 PM
    Category, basket and food are
    types
    .
  • a

    Adriano Resende

    04/10/2020, 10:35 PM
    With new version 2, not exist server more but It is possible to add Prisma v2 Client on GraphQL Playground to check all Schema and Doc as version 1*?*
    s
    • 2
    • 2
  • a

    Alan

    04/11/2020, 1:09 AM
    I am migrating to typescript. after compiling my project in typescript, I have this error: 
    Error: ENOENT: no such file or directory, open '/dist/schema.graphql'
      How can I include my file
    schema.graphql
     in the 
    dist
      folder (compiled)?
  • k

    Khoa Le

    04/11/2020, 4:36 AM
    has anyone using prisma to convert their eixsting stacks to microservices?
  • s

    Sacha Weatherstone

    04/11/2020, 6:18 AM
    Is there any way to access prisma client using
    nexus-plugin-prisma
    outside of the normal context? i.e. in
    <http://server.express.post|server.express.post>()
    I have tried to include it seperately in my dependencies, but keeps throwing and initialization error on building.
    m
    • 2
    • 3
  • u

    Ugogo

    04/11/2020, 11:10 AM
    Hello there, noob question here so sorry in advance 🙏 I'm using
    graphql-yoga
    as a server to interact with
    prisma
    So locally I have the following endpoints available, and my client is using the first one •
    localhost:4000
    :
    graphql-yoga
    •
    localhost:4466
    :
    prisma
    Nothing crazy so far, I was even able to deploy all of this on Heroku (yay) The Heroku endpoint is "connected" to
    prisma
    , but my client needs the
    graphql-yoga
    endpoint, how can I find it? Dunno if it's clear enough 😓 Thanks 🙏
  • s

    Sebastien La Duca

    04/11/2020, 3:33 PM
    can the
    include
    parameter perform nested reads, as in get fields of a related document?
  • c

    Charpell

    04/11/2020, 4:28 PM
    Hello people, has anyone resolve how to handle case sensitivity in a Prisma query?
    m
    • 2
    • 2
1...362363364...637Latest