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

    Yiğit Rüzgar

    04/30/2020, 10:18 AM
    He connected my pc, and step by step, show me problems.
  • l

    Lars-Jørgen Kristiansen

    04/30/2020, 11:49 AM
    We Are hitting the 1000 que limit with prisma 1.. can we adjust this or scale this without making too many adjustments to our code?
    d
    • 2
    • 2
  • l

    Lars-Jørgen Kristiansen

    04/30/2020, 1:12 PM
    Is there a way i can check what prisma 1 server is using for connectionLimit?
  • d

    David Turton

    04/30/2020, 3:26 PM
    hello all, I am getting this error when deploying to AWS Lambda. Locally I can invoke the function deployed in AWS it will fail.
    r
    l
    • 3
    • 25
  • d

    David Turton

    04/30/2020, 3:26 PM
    Copy code
    @prisma/client did not initialize yet. Please run \"prisma generate\" and try to import it again.\nIn case this error is unexpected for you, please report it in <https://github.com/prisma/prisma-client-js/issues/390>
  • d

    David Turton

    04/30/2020, 3:26 PM
    any ideas?
  • d

    David Turton

    04/30/2020, 3:27 PM
    I am using the Serverless framework.
  • s

    Stefan Trivuncic

    04/30/2020, 4:52 PM
    Hello all! Out of curiosity - what is most people’s set up in terms of creating a local, test, staging, and production environment? I haven’t found a solid recipe as I know you can deploy to AWS, but manage your DB’s via Heroku, but at that point why don’t you just manage all workflows/environments on Heroku? Any comments are appreciated and for reference i’m planning to go with Prisma 2.
    r
    • 2
    • 2
  • m

    MATTHEW CASERES

    04/30/2020, 9:34 PM
    Type '{ name: string; email: string; posts: { create: { title: string; }; }; profile: { create: { bio: string; }; }; }' is not assignable to type 'UserCreateInput'. Object literal may only specify known properties, but 'posts' does not exist in type 'UserCreateInput'. Did you mean to write 'Post'?ts(2322)
  • m

    MATTHEW CASERES

    04/30/2020, 9:34 PM
    but the User model definitely has a field called posts and I just ran npx prisma generate
  • m

    MATTHEW CASERES

    04/30/2020, 9:35 PM
    I ran npx ts-node index.ts for the tutorial and everything worked fine I don't know why I am gettng this type error.
  • m

    MATTHEW CASERES

    04/30/2020, 9:49 PM
    also in node_modules I see schema.prisma in .prisma\client and it has all the right stuff. Confusing though because the documentation implies this information comes from @prisma not .prisma?
    t
    r
    • 3
    • 6
  • y

    Yasir Hussain

    05/01/2020, 1:11 AM
    Hello fellas, I am working on graphql-yoga server, I ran into strange issues. Issue#1: Passing "info" to prisma mutation, mutation return undefined and no record is created on the database, Removing the info argument solves this issue. Issue#2: Arguments passed to graphql mutations and queries are suffixed with "[Object: null prototype]" and attributes in info parameter are also suffixed with "[Object: null prototype]"
  • y

    Yasir Hussain

    05/01/2020, 1:13 AM
    Kindly tell me what is the use of info parameter and how to solve this issue, Thanks you
  • y

    Yasir Hussain

    05/01/2020, 1:15 AM
    This is my mutation
    r
    • 2
    • 5
  • b

    Ben

    05/01/2020, 3:20 AM
    Got a job doing C# (blah) so I've been out of the react game a while. Trying to brush up and now I'm running into an issue. My prisma query is running twice when my page loads and I can't figure out why. Query:
    Copy code
    <Query query={ALL_SEARCHES_QUERY}>
              {({ error, loading, data }) => {
                if (error) return <p>Error!</p>;
                if (loading) return <p>Loading...</p>;
                this.handleData(data);
                return <div>query stuff</div>;
              }}
    </Query>
    this.handleData():
    Copy code
    handleData = (data) => {
        data.allSearches.map((datum) => {
          console.log(
            `This is the title: ${datum.title} - and this is the URL: ${datum.url}`
          );
        });
      };
    Expected console output:
    Copy code
    This is the title: titleone - and this is the URL: urlone
    This is the title: titletwo - and this is the URL: urltwo
    Console output when page loads:
    Copy code
    This is the title: titleone - and this is the URL: urlone
    This is the title: titletwo - and this is the URL: urltwo
    This is the title: titleone - and this is the URL: urlone
    This is the title: titletwo - and this is the URL: urltwo
    I used "titleone", "titletwo", etc to save space. I am getting the correct variables there, but as you can see it is happening twice. Does anyone have any idea why??? Any help is much appreciated!
  • r

    Rushi Arumalla

    05/01/2020, 3:23 AM
    Hi guys, I'm working with prisma 2/nexus and can't get a subscription working, getting "Cannot read property 'headers' of undefined" in playground, anyone dealt with this before?
  • r

    Rushi Arumalla

    05/01/2020, 3:23 AM
    Copy code
    export const CommentSubscription = subscriptionField('newComment', {
        type: 'Comment',
        description: 'New Comment Subscription',
        args: { recipeId: intArg({ required: true }) },
        subscribe: withFilter(
            (parent, args, { pubsub }, info) => pubsub.asyncIterator('newComment'),
            async (payload, variables) => {
                return payload.newComment.recipeId === variables.recipeId
            }),
        resolve: payload => payload.newComment
    })
    a
    r
    • 3
    • 9
  • c

    Corey Snyder

    05/02/2020, 2:28 AM
    Is it known that the links in the documentation are broken? Go here: https://v1.prisma.io/docs/1.34 Click “Start from scratch” It takes you here: https://v1.prisma.io/1.34/get-started/01-setting-up-prisma-new-database-JAVASCRIPT-a002/ It should go here: https://v1.prisma.io/docs/1.34/get-started/01-setting-up-prisma-new-database-JAVASCRIPT-a002/ Please fix. There are some people still using prisma 1 that need the docs.
    r
    • 2
    • 1
  • c

    Corey Snyder

    05/02/2020, 3:23 AM
    Anyone have a clue why prisma isn’t found in the NPM registry? https://registry.npmjs.org/primsa
    r
    • 2
    • 1
  • c

    Corey Snyder

    05/02/2020, 3:23 AM
    But it has a page still on the prisma site: https://www.npmjs.com/package/prisma
  • m

    Marcel Overdijk

    05/02/2020, 5:41 AM
    Hi, I wonder if it is possible to apply where filters dynamically to a
    findMany
    query. Eg transforming a
    GET
    request like
    /items?price[lt]=10&available[eq]=true
    to a query. The rest endpoint can retrieve many filter criteria and the filter operation might differ. (Off course we will validate first which filter criteria were passed in)
    r
    • 2
    • 1
  • a

    Ashiqur Rahman

    05/02/2020, 7:55 AM
    Currently, database giving us every id starts with 
    ck....
    . I need to change that. Is there any way to change this ?
    r
    • 2
    • 3
  • n

    Nischal

    05/02/2020, 11:21 AM
    Hi all i need some help. below is my schema file.
    Copy code
    model User {
      id       Int     @default(autoincrement()) @id
      email    String? @unique
      fullName String?
      password String?
      userRole String?
      advertise Advertiser
    }
    
    model Advertiser {
      id                   Int      @default(autoincrement()) @id
      companyContactNumber String?
      companyName          String?
      location             String?
      registeredNumber     Int?
      verified             Boolean?
      userId               Int
      createdBy            User @relation(fields: [userId], references: [id])
      campaigns   Campaign[]
    }
    not sure why this create query doesn't work
    Copy code
    const advertiser = await prisma.advertiser.create({
          data: {
            companyName,
            registeredNumber,
            location,
            companyContactNumber,
            createdBy: {
              connect: {
                userId: 1,
              },
            },
          },
        });
    The error i get is
    Copy code
    [  Error: Invalid `prisma.advertiser.create()` invocation:
      {
        data: {
          companyName: 'nischal Company2',
          registeredNumber: 12232,
          location: 'kathmandu, Nepal 1231',
          companyContactNumber: '980113405222',
          createdBy: {
            connect: {
              userId: 1
              ~~~~~~
            }
          }
        }
      }
      Unknown arg `userId` in data.createdBy.connect.userId for type UserWhereUniqueInput. Did you mean `id`? Available args  :
  • n

    Nischal

    05/02/2020, 11:24 AM
    This is for prisma 2 beta 3 , any help would be appreciated. Thanks 🙂
  • e

    Erik Rutledge

    05/02/2020, 11:26 AM
    @Nischal can you replace "userId" with "id"?
  • n

    Nischal

    05/02/2020, 11:28 AM
    I get this
    Copy code
    [  Error: Invalid `prisma.advertiser.create()` invocation:
      The change you are trying to make would violate the required relation 'AdvertiserToUser' between the `Advertiser` and `User` models.
    r
    • 2
    • 4
  • r

    Roy

    05/02/2020, 4:00 PM
    Hi guys, I googled a lot, but can’t find the Prisma Admin for Prisma.. I used it a lot in Prisma1, can someone point me in the right direction how to set it up with the new Prisma?
    ✅ 1
    m
    • 2
    • 3
  • r

    Roy Sivan

    05/02/2020, 8:41 PM
    HI everyone! Just getting started. Wanted to see if there were any resources for connecting data objects to a remote API vs. a DB
  • t

    TEMILOLUWA OJO PHILIP

    05/02/2020, 11:28 PM
    Hi everyone, can anyone help me through figuring out how to map a user to follower relationship in prisma? currently using prisma 2 and i need to implement this feature in a project i'm working on. I want to do it in a way that it's easy to determine if user A and user B are both following each other and running queries like user.followers and user.following. My approach was to have a follow model that has two field of followerId and followingId that both references the userId in User but i'm getting an error that i should rename my relations. it get's a little bit complicated from there. Any help i can get now would be really great.
1...369370371...637Latest