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

    Samson Amaugo

    12/02/2020, 7:54 PM
    Do I still need to set the prisma client to a different directory outside node modules when using node prune for the new version?
    r
    • 2
    • 27
  • t

    tylim

    12/02/2020, 8:55 PM
    [nexus] how can i write resolver for enum type field? I have error when trying to do so
    r
    • 2
    • 8
  • h

    Harun

    12/03/2020, 7:45 AM
    Hi guys, how can i get entries that is one month old in Prisma? I am struggling with the Datetime, What i have done so far:
    Copy code
    const date = new Date();
    const numberOfDays = 30; 
    const month = date.setDate(date.getDate() - numberOfDays); 
    
    const items = await prisma.items.findMany({ where: { createdAt: { gt: month } } });
    But i get an error that says:
    Argument createdAt: Got invalid value on prisma.aggregateProduct. Provided Json, expected DateTimeFilter or DateTime.
    How can i query by datetime?
  • h

    Harun

    12/03/2020, 7:47 AM
    Okay i figured it out. The fix is that i should not use “month” but “date” instead 🙂
    💯 1
  • t

    tadejstanic

    12/03/2020, 11:56 AM
    Hi good people, does prisma provides option to alias columns in the query builder? Or should I construct a raw query? Here is an example. I’d like to alias
    email_event
    to
    events
    ?
    r
    n
    • 3
    • 3
  • j

    Jonathan

    12/03/2020, 11:44 PM
    Hi folks, general question for you all about pagination. Has anyone here implemented nested pagination in GraphQL land? Something like
    Copy code
    usersPagination(filter: { search, count, sort }) {
        users {
            username
            email
            etc
        }
        pageInfo {
            count
            pageIndex
        }
        postsPagination(filterForParent: {search, startDate }) <- another filter {
            posts {
                pages
            }
            pageInfo {
                count
                pageIndex
            }
        }
    }
    In theory, we are trying to see if it is possible to define some filter on a child, and use that filter in the parent? So that we can define for instance "Give me 10 users, who contain
    search
    , or if their posts contain
    search
    . Just give me 10 in total" Any clean API's that do something like this?
    r
    • 2
    • 5
  • h

    Harsh Makwana

    12/04/2020, 7:21 AM
    Hello, getting this error while running prisma deploy. creating enum in prisma 1.
    ERROR: Syntax error while parsing GraphQL query. Invalid input "enum ReminderOn {\n  3", expected OperationDefinition, FragmentDefinition or TypeSystemDefinition (line 519, column 1):
    enum ReminderOn {
    datamodel.schema
    enum ReminderOn {
    30MIN
    1HR
    2HR
    }
    r
    • 2
    • 1
  • u

    UddhavNavneeth

    12/04/2020, 12:08 PM
    Hey I wanted to help in fixing one of the issues in prisma-labs/get-graphql-schema. Can someone tell me the procedure for running the project after downloading it, and for submitting PRs. This is going to be my first open source contribution attempt so help is greatly appreciated.
    m
    • 2
    • 3
  • n

    Nikolay

    12/04/2020, 2:31 PM
    Hey guys, just wanted to announce a public release of Fuji X — a platform built on top of Prisma, Nexus and other future-proof technologies. ✨ https://fujix.io With a current release you are able to: 📚 model a database (schema.prisma) with a web app UI 🔐 configure authentication and role-based access control 🏄‍♂️ get a GraphQL endpoint with CRUD operations and subscriptions 🚀 manage automatic deployments to AWS (no experience required) 👾 use a CLI to generate a client for your GraphQL endpoint and work with data from your frontend or backend app (here are some examples https://github.com/fujix-io/fujix-examples) This is an alpha version and we rely on community feedback, suggestions and feature requests 😎 🤟
    fast parrot 9
    👨‍🚒 6
    💪 5
    😎 5
    💯 9
    🔥 7
    👩‍🚒 5
    prisma rainbow 8
    👨‍🚀 4
    prisma green 10
    👍 7
    🚒 6
    💊 4
    🚀 5
  • c

    Christian Villamin

    12/04/2020, 5:15 PM
    How do I configure the prisma folder from
    npx prisma init
    to use a different folder location? Also so that
    npx prima generate
    uses that custom prisma location? Thanks a bunch!
  • c

    Christian Villamin

    12/04/2020, 5:18 PM
    nvm, got 'em. Awesome docs.
    💯 1
    🙌 2
  • d

    Drew Fleming

    12/04/2020, 8:18 PM
    Greetings all - Where should we direct support questions for the SQL server connector?
    r
    • 2
    • 1
  • k

    KJReactor

    12/05/2020, 12:07 PM
    Is there a way to execute import & backup scripts ? I need to do seeding and backing up data. Never mind, I figured it out :)
    💯 1
  • j

    Jin

    12/05/2020, 1:19 PM
    Hey guys . I am a Mobile developer in Berlin.  I hope you guys are doing well in this time. I am looking for a partner for side project. • Someone who has passion and responsibility   • Server graphql developer based on prisma. • Prefer someone who can work together in person from time to time
    > Feel free to send me direct message
    💯 1
    r
    • 2
    • 1
  • p

    Paulo Neves

    12/05/2020, 9:43 PM
    Hi. I'm using Postgres and I wan't to have a column
    cursor
    that has always the same value as the column
    id
    . I think that somewhere in the past I saw here in prisma slack someone doing that, but I can't see how I can do it with postgres. Anyone knows? It's like a view column.
    r
    • 2
    • 8
  • j

    Jonathan

    12/06/2020, 12:09 PM
    Hey folks, quick question. When you run your nodejs-stack, be it with prisma and/or nexus, do you also manually disconnect your connections using for instance
    prisma.$disconnect
    ? I am running to a problem where with
    nodemon
    , my "reloading" seems to be stuck. I have to explicitly state
    process.exit
    , but even then there are some sub-processes still running (not quite clear if prisma is the only one) Anyone experiences this as well?
    r
    m
    • 3
    • 3
  • t

    tylim

    12/07/2020, 12:53 AM
    heh guys, a quick question.
  • t

    tylim

    12/07/2020, 12:54 AM
    let say i have autoincrement id, [1,2,3,4,5]
  • t

    tylim

    12/07/2020, 12:54 AM
    if i delete record 3, the next time prisma create new record, will the new id be 3 or 6?
    r
    • 2
    • 2
  • c

    Christian Villamin

    12/07/2020, 1:20 AM
    6
    ✅ 1
  • f

    florin

    12/07/2020, 8:40 AM
    Hello everyone, I have an issue I am stuck at. I have a node.js project that uses prisma. In the root of the project I have an file
    Copy code
    schema.graphql
    where I added e new query
    Copy code
    type Query {
      detailsParameters(windTurbine: String!, windTurbineType: String!, param: String!, action: String!): String!
    }
    How can I deploy this new change to the production prisma derver, as I did not manage to do it. Thanks in advance:)
  • d

    Drew Fleming

    12/07/2020, 2:30 PM
    Hi all - I am using the SQL server connector to integrate with my existing db and I am getting the error below when running prisma.{table}.create. It seem this is an issue with SQL server and the use of OUTPUT along with a trigger. Is there a workaround for this, or plans to support triggers in future release? By the way, when I remove the trigger the create statement works.
    Copy code
    (node:37320) UnhandledPromiseRejectionWarning: Error: 
    Invalid `prisma.formSets.create()` invocation:
    
    
      Error occurred during query execution:
    ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(TokenError { code: 334, state: 1, class: 16, message: "The target table \'dbo.FormSetSequence\' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause.", server: "dev-dfleming", procedure: "", line: 1 }) })
        at PrismaClientFetcher.request (C:\dev\graph-ql-prisma-ta\node_modules\@prisma\client\runtime\index.js:78786:15)
        at processTicksAndRejections (internal/process/task_queues.js:93:5)
    (Use `node --trace-warnings ...` to show where the warning was created)
    (node:37320) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see <https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode>). (rejection id: 3)
    (node:37320) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    j
    • 2
    • 1
  • d

    Daniell

    12/07/2020, 3:57 PM
    Since the prisma migrate API is experimental I assume it's not recommended to use in a prod environment, what would you use for database migrations instead?
    r
    d
    • 3
    • 18
  • a

    Awey

    12/07/2020, 9:49 PM
    Has anyone here managed to setup a
    linkPreview
    query in Nexus? Given a websites
    url
    I would like to be able to get the meta data from that site, description, images, etc. Like when you post a link here. I'm using Nexus Schema and I'm not really sure how to approach this. Any guidance would be appreciated 🙏
    r
    • 2
    • 3
  • t

    tylim

    12/08/2020, 5:01 PM
    heh guys, how can i type custom scalar type in nexus?
  • t

    tylim

    12/08/2020, 5:01 PM
    Copy code
    import { GraphQLUpload } from 'graphql-upload'
    
    export const Upload = asNexusMethod(GraphQLUpload, 'upload')
  • t

    tylim

    12/08/2020, 5:02 PM
    the Upload type is
    any
    when i try to use it as argument in mutation, how can i type it?
  • m

    MichaelHindley

    12/08/2020, 5:11 PM
    Hm if I have ModelA that has “Many” ModelB, and I create a ModelA entry with a few ModelB rows in the database, when I delete ModelA using a manual query, it cascade deletes all ModelB as well, as expected, due to prisma automatically adding the cascade behaviour to the table definition. (on update cascade on delete cascade) The behaviour also works as expected using queryRaw and deleting the parent row by ID. However when I try to use the generated prisma client to delete ModelA by ID, I get an error like this: invalid prisma.ModelA.delete()` invocation:
    Copy code
    The change you are trying to make would violate the required relation 'ModelAtoModelB' between the `ModelA` and `ModelB` models.
    In the generated client, I can see that relationship has: “relationOnDelete”:“NONE”, but the table has on delete cascade as generated by the schema.prisma definitions. So how does one define this relationship so that when an owning side of an relationship is deleted, the children are deleted as well?
    r
    a
    • 3
    • 21
  • m

    Marvin

    12/08/2020, 5:35 PM
    My eyes might be dusty right now but where can I find the Windows download of Prisma Studio?
    n
    • 2
    • 3
  • b

    bntzio

    12/09/2020, 4:23 AM
    I’m having an issue where my prisma schema gets updated every time I introspect, here’s the workflow: 1. I make changes to my db with plain sql 2. I introspect my db 3. Prisma schema gets generated 4. I update some values for easier understanding to the prisma client 5. I introspect again 6. Prisma schema gets updated again (overwriting my custom field changes) Here’s an example: Generated by prisma after introspect:
    Copy code
    model Tag {
      id      Int       @id @default(autoincrement())
      name    String    @unique
      post    Post[]    @relation("post_to_tag")
    
      @@map("tag")
    }
    Modified my by afterwards:
    Copy code
    model Tag {
      id      Int       @id @default(autoincrement())
      name    String    @unique
      posts   Post[]    @relation("post_to_tag")  <-------- posts instead of post
    
      @@map("tag")
    }
    Introspects again and overwrites my changes with the 1st code block again. Any idea why this could be happening? 🙂
    r
    d
    d
    • 4
    • 10
1...408409410...637Latest