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

    Isidoro Ferreiro

    12/22/2020, 6:57 PM
    When setting the context type to .ts I get a complaint every time there's a query, since when the project is built the types files is a .js file. But if I use the path of a .js file when starting the prisma client it complains for the opposite reason, any ideas?
    Copy code
    contextType: {
    		module: join(__dirname, "types.ts"),
    		export: "Context",
    		alias: "ctx"
    	}
    r
    • 2
    • 5
  • z

    zeus

    12/24/2020, 1:54 PM

    https://media1.giphy.com/media/damYg6Mana2CHXfuz5/giphy-downsized.gif?cid=6104955eb67[…]51fd87958eb995e0ee2bfdcae526471cd0e8&rid=giphy-downsized.gif▾

    🎉 3
    🌲 6
    prisma green 3
  • j

    Jaafari El Housseine

    12/25/2020, 9:12 AM
    Is there a way to edit the data type without losing data in production. using Prisma 1.34 I would love to keep things clean using Prisma & not go over writing some migration & seed raw sql files
  • m

    Manthan Mallikarjun

    12/28/2020, 1:47 AM
    Random question, why slack over Discord for the community?
    t
    a
    j
    • 4
    • 10
  • e

    ericsonluciano

    12/28/2020, 6:02 AM
    Hello I'm not sure if this is the right to ask here about graphql-request. But any idea how i can do 2 to 4 different query with different return on getStaticProps btw i'm using nextjs.
  • d

    Diogo Luis

    12/28/2020, 11:04 AM
    Argument user: Got invalid value 1 on prisma.createOneCompany. Provided Int, expected UserCreateOneWithoutCompanyInput: type UserCreateOneWithoutCompanyInput { create?: UserCreateWithoutCompanyInput connect?: UserWhereUniqueInput connectOrCreate?: UserCreateOrConnectWithoutcompanyInput }
  • d

    Diogo Luis

    12/28/2020, 11:05 AM
    ive created a table with a relation to user object
  • d

    Diogo Luis

    12/28/2020, 11:05 AM
    but when i insert the user id it gives me that error back
  • s

    Spencer Curry

    12/28/2020, 3:46 PM
    hey yall, im creating a graphql apollo server(2.18.2) using prisma(client 2.9.0) as my database go-between. i have written my schema, which is heavily reliant on relational data and relational types are defined in the schema. as I began to write the resolvers, i was looking up the best approach to make use of Prisma's relational nature, but it seems I'll have to write individual resolvers for every individual type. this feels like it minimizes/defeats the purpose/benefits of the relational data provided by prisma by querying relations in the same call. is there something i am missing? is it best practice to resolve the relational data types via the relational data from prisma on the originating type, rather than making a call to the relational data directly? EX: (roughly coded, syntax may not be exactly accurate) query
    user { profileInfo { fName, lName}}
    resolver
    prisma.users.findOne({include: {profileInfo: true}})
    OR resolver
    prisma.profileInfo.findOne({where: {userId: args.userId}})
  • f

    fcholakoski

    12/28/2020, 8:51 PM
    Hi everyone. I am glad I joined this beautiful community. I am quite interested in this technology. I want to learn in from the ground up and use it in my daily work. Where should I start? Are there some materials to watch or its just the documentation?
    b
    j
    • 3
    • 3
  • b

    bntzio

    12/28/2020, 9:56 PM
    Hi everyone, does someone knows why I’m unable to perform a
    connectOrCreate
    query in a many-to-many (explicit) relation.
    Copy code
    tags: {
      connectOrCreate: {
        where: { name: 'General' },
        create: { tags: { create: { name: 'General' } } }
      }
    }
    Many thanks!
    • 1
    • 6
  • p

    Philipp Rajah Moura Srivastava

    12/29/2020, 12:48 AM
    I’m running into an issue building my graphql API with prisma1 when dealing with lists types. I’ve discovered you can query lists with this pattern:
    await prisma.events(invitedQuery).$fragment(fragment);
    which I discovered a while back. However I would like to get a list of users that are followers of a given user as well as all the other saclar types that make up a user. I could see myself doing it with the pattern above but it doesn’t seem like it’s the best way to do it. I would like to know if there’s a way to have the user returned from the prisma client with a field that is a list of users. I am using prisma-client-lib v1.34.10. This seems like a very basic operation but I haven’t found anything in the docs. I did find something to do with the info parameter and prisma-bindings but I don’t think that’s relevant here. Any help would be appreciated, much thanks.
  • e

    Eliya Cohen

    12/29/2020, 10:07 AM
    Can't find a legitimate way of deploying a nexus app. I tried to build with
    tsc
    and then run the compiled
    app.ts
    but it looks like I get a runtime error due to missing root typing:
    Copy code
    Error: Root typing path /home/eliya/projects/X/packages/server/build/context.ts for the type context does not exist
  • k

    Keanu Gargar

    12/29/2020, 11:45 AM
    I’ve been building backend and frontend stuffs already but wanted to try this ORM and GraphQL thing, i then found out about Prisma and Apollo and that they can work together. I already tried out very basic of GraphQL and so i’m looking for a platform to build this thing, what should i learn first, Prisma or Apollo? Thanks!
    • 1
    • 1
  • b

    bntzio

    12/29/2020, 11:55 AM
    https://prisma.slack.com/archives/CA491RJH0/p1609192610237700 Ok I managed to get it working this way. Is this the right approach?
  • c

    christian

    12/30/2020, 12:33 AM
    hey devs… how do I query for a date in the future? I tried:
    Copy code
    where: {
      date_: {
        gte: Date.now()
      }
    }
    I also tried
    new Date().getTime()
    but it keeps failing. Any ideas?
  • c

    christian

    12/30/2020, 12:41 AM
    I had to use new Date() 🤦🏻‍♂️
    👍 2
    💯 2
  • p

    Philipp Rajah Moura Srivastava

    12/30/2020, 8:37 PM
    Any update on when Prisma2 will have mongoDB support?
    n
    • 2
    • 1
  • m

    Michael Reh

    12/31/2020, 8:54 AM
    Hi, I am relatively new to prisma. So far it is a good experience. Couple of questions: 1.) Is there any best practise how to check for a K8S readiness check if the client can access the DB ? 2.) can the client create the DB if the DB etc doesn't exists instead of doing a manual prisma migrate or is the best the mount the SQL to postgres ( as I am using postgres ) ? Thx in advance
    n
    k
    • 3
    • 2
  • p

    Pieter

    12/31/2020, 10:29 AM
    Any way to host prisma studio in serverless environment? https://github.com/prisma/studio/issues/601
    j
    a
    • 3
    • 16
  • p

    Pieter

    12/31/2020, 10:35 AM
    React Server components I just discovered this https://github.com/prisma/prisma/tree/master/src/packages/react-prisma Thanks for taking this on early @tim2 @Joël. I am super excited for react server components and the potential it will bring. Glad to see prisma is staying on top of it. Question: Will there be a way to do mutations with react-prisma? or will it simply be queries done on server components?
    t
    k
    • 3
    • 22
  • t

    Taylor

    01/01/2021, 3:15 PM
    Hello there!
  • t

    Taylor

    01/01/2021, 3:15 PM
    How would one fire off a GraphQL Mutation when the DateTime ends?
    a
    • 2
    • 1
  • p

    Philipp Rajah Moura Srivastava

    01/01/2021, 11:20 PM
    This may or may not be a stupid question but are graphql resolvers atomic? Meaning if part of the resolver fails will prisma or graphql-yoga somehow insure that the db is in the same state before the resolver was called?
    j
    • 2
    • 41
  • j

    Joe

    01/03/2021, 7:09 PM
    I am following the context example here: https://www.howtographql.com/graphql-js/5-connecting-server-and-database/ implemented with auth as follows: Server:
    const server = new ApolloServer({
    gateway,
    subscriptions: false,
    context: ({ req }) => {
    const user = req.user || null;
    console.log("Prisma: " + prisma);
    return { prisma, user };
    }
    })
    Resolver:
    <session request returning user>
    console.log("Resolver: " + context.prisma);
    context.prisma.account.create({
    data: {
    email: email,
    password: password
    },
    });
    Output:
    Prisma: [object NewPrismaClient]
    Resolver: undefined
    If I stringify the context, I get:
    Resolver: {"user":null,"_extensionStack":{"extensions":[]},"_shield":{"cache":{}}}
    the prisma context object is always undefined in the resolver, what I am not understanding here?
    r
    • 2
    • 3
  • s

    stephan

    01/04/2021, 12:57 PM
    how can i set an entity's field as readonly in a graphql file ?
    r
    • 2
    • 1
  • m

    Martïn

    01/04/2021, 1:04 PM
    Prisma #executeRaw for PostgreSQL System level operations: I am trying to set various options for Postgres using Prisma: ALTER SYSTEM SET wal_level='logical'; ALTER SYSTEM SET max_wal_senders='10'; ALTER SYSTEM SET max_replication_slots='10'; Can I set these with the prisma.$executeRaw function?
    r
    • 2
    • 8
  • s

    Spiros - Product at Prisma

    01/05/2021, 1:37 PM
    Hello everyone! We need your input about a new Cloud offering for Prisma we are currently designing and we have prepared a small survey (5 questions max) which we would ask you to complete: https://prisma103696.typeform.com/to/q2txzFif Thank you! _Keywords_: edit data/schema online, test run client queries
    prisma green 5
    ☁️ 3
    💯 4
    fast parrot 3
    prisma rainbow 3
  • d

    Dan

    01/06/2021, 1:17 AM
    I find it strange there is absolutely no documentation/guides/examples of any CI/CD or testing with Prisma….. I also find it strange that Prisma can be prod ready, but migrate is only beta? Who is actually using prisma without migrate?
  • d

    Dan

    01/06/2021, 1:18 AM
    The examples of deployment are useless, its cool if you only deploy your app once and never again, but I doubt that is the case for anyone with “real” apps
    r
    • 2
    • 5
1...410411412...637Latest