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

    Cigoler

    12/10/2019, 10:24 AM
    The playground and everything is accessible
  • c

    Cigoler

    12/10/2019, 11:04 AM
    curl -i localhost:4466 from within the nodejs container doesn't work I get refused to connect. Can someone point me in the right direction at least.
    d
    • 2
    • 9
  • a

    Andrew

    12/10/2019, 7:35 PM
    I have experienced issues with prisma2, so trying to use prisma 1… I created a server a while back and the admin page is all blank. https://eu1.prisma.sh/andrew-p/demo/dev/_admin
    t
    • 2
    • 5
  • n

    nobyf

    12/11/2019, 7:52 AM
    Hi, I am trying to use rawAcess in prisma1 with postgres database, in order to implement case insensitive searches which the current prisma does not offer out of box with normal graphql queries.
  • n

    nobyf

    12/11/2019, 7:55 AM
    But, as I have to pass user inputs (searched strings) to my SQL query to form a query string in rawAccess query, I cannot see how I can escape user inputs. Could anyone tell me how I can do that? Is there a special way to escape in rawAccess or prepare it beforehand (e.g. using something like sqlstring or pg-escape?)?
  • h

    Hans Chen

    12/11/2019, 8:57 AM
    Hello Guys
  • h

    Hans Chen

    12/11/2019, 8:58 AM
    Who is going to be a friend of me today?
  • i

    inno

    12/11/2019, 9:19 AM
    The Me
  • h

    Hans Chen

    12/11/2019, 9:29 AM
    Hello @inno
  • h

    Hans Chen

    12/11/2019, 9:29 AM
    Great
  • s

    Sorin Cristea

    12/11/2019, 4:54 PM
    @here: hey guys, I'm new on prisma, I try to deploy a prisma with mysql using a docker-compose file, I setup on prisma.yml a secret, used to access services deployed on prisma and on docker-compose I setup a api key for prisma management api.
  • s

    Sorin Cristea

    12/11/2019, 4:55 PM
    after I run a prisma deploy, when I try to access the admin (.../_admin) dashboard I got
    d
    • 2
    • 2
  • s

    Sorin Cristea

    12/11/2019, 4:55 PM
    Copy code
    [
      "Your token is invalid. It might have expired or you might be using a token from a different project."
    ]
  • s

    Sorin Cristea

    12/11/2019, 4:55 PM
    do you have a clue why since I set all 'secrets'? thx
  • v

    vnadygin

    12/11/2019, 6:07 PM
    Hey everyone👋 We are trying to deploy a multiple Prisma instances between the balance loader. All of them use the same PG database. When the first instance run
    prisma deploy
    it also updates the DB scheme. After that, the second instance try to update Prisma scheme with
    prisma deploy
    , but no changes found. Any way we can update the prisma Graphql model from already updated database?🙏🙏🙏
  • n

    Nesh

    12/11/2019, 6:51 PM
    I’m using v1 and
    prisma reset
    The command runs and ends successfully but all the tables still have data.
  • n

    Nesh

    12/11/2019, 6:52 PM
    Similar situation with
    prisma deploy
    The command ends successfully but there are still errors in deployment You can see the errors when you have
    export DEBUG="*"
    But the command ends in success which makes it unreliable to use in CI/CD
  • m

    Mohammed Nasir

    12/11/2019, 6:58 PM
    Yeah, I am facing the same issue ☝️
  • j

    Jakub Sys

    12/12/2019, 9:16 AM
    Hi everyone, Im new to graphql and prisma, so Im looking for help in solving my problems. Ive built Prisma + mongodb, created user with his geolocation data(lat and lon), from now on I have to filter those users ordered by the closest one to user logged in the app, any advice?
  • m

    Matthew Blode

    12/12/2019, 10:26 PM
    What is the timeline for Prisma 2 for Go? Should I commit to using a Prisma and Go together if it is just going to stop being supported?
    👍 1
    👀 2
    r
    l
    • 3
    • 3
  • m

    Mohammed Nasir

    12/14/2019, 12:44 AM
    Using multiple Prisma Containers and connecting to single Aurora MySQL database. Containers keep stopping. Is there a setting I missed?
  • m

    Mohammed Nasir

    12/14/2019, 12:48 AM
    this is the error message -
    Copy code
    [INFO] Fatal error during deployment worker initialization: akka.pattern.AskTimeoutException: Ask timed out on [Actor[<akka://single-server/user/$e#-921169135]>] after [300000 ms]. Sender[null] sent message of type "com.prisma.deploy.migration.migrator.DeploymentProtocol$Initialize$".
    
    
    
    
    
    23:39:28
    
    akka.pattern.AskTimeoutException: Ask timed out on [Actor[<akka://single-server/user/$e#-921169135]>] after [300000 ms]. Sender[null] sent message of type "com.prisma.deploy.migration.migrator.DeploymentProtocol$Initia
  • l

    Lars Ivar Igesund

    12/14/2019, 10:43 AM
    I have the following data model, in Prisma 1.34 and with MongoDB.
    type User {
    id: ID! @id
    name: String!
    leaderOfTeams: [Team!]! @relation(name: "TeamLeader")
    }
    type Team {
    id: ID! @id
    name: String!
    teamLeader: User @relation(name: "TeamLeader", link: INLINE)
    }
    I have used nexus-prisma to generate graphql, use apollo to connect. I have created a couple of users, and now I want to create a team and connect the teamLeader field to one of the users. Everything seems to work fine until one of the final steps. Then, I get GraphQLError: Variable "$data" got invalid value "5df286a724aa9a0007c2ae91" at "data.teamLeader"; Expected type UserCreateOneWithoutL eaderOfTeamsInput to be an object. So I suppose this is because teamLeader has the type User in the GraphQL-schema, whereas the actual database is supposed to store the id (a string). Of course, using the teamLeader field should typically resolve to a User object, so I suppose that is correct, but then there need to be something in the resolvers (probably both query and mutation) to handle this. Anyone know what I am missing here?
    b
    m
    • 3
    • 103
  • m

    michieldewilde

    12/14/2019, 4:13 PM
    Are there any People that have experience with transitioning away from Prisma to something like type-orm or sequelize.js? We want more control over our database. Any input would be helpful.
    • 1
    • 1
  • r

    Rob

    12/15/2019, 6:32 PM
    I have been working through a transition from Prisma 1 to Prisma 2, and I've been stuck on the issue of
    Invalid photon.() invocation
    for a while. After googling around for the error, it typically seemed like most people resolved the issue with upgrading prisma2 to preview-17 or higher. I am on the latest preview of Prisma, but just can't seem to resolve the error. My app is running in Docker Compose using Windows WSL2 Ubuntu. I have the following versions installed:
    Copy code
    "@prisma/photon": "^2.0.0-preview018.2",
    "prisma2": "^2.0.0-preview018.2",
    "nexus": "^0.12.0-rc.5",
    "nexus-prisma": "^0.6.1",
    One thing I have started noticing is that my
    prismaPath
    is undefined in the Photon instance added to the ApolloServer's context, and I assume that I need to do something to populate that value but googling for
    prisma2 photon prismaPath
    hasn't been any help:
    Copy code
    // output of a console.log(ctx.photon) in my nexus resolver
    ctx.photon <ref *1> Photon {
    engine: NodeEngine {
    exiting: false,
    managementApiEnabled: false,
    ready: false,
    stderrLogs: '',
    stdoutLogs: '',
    fail: [AsyncFunction (anonymous)],
    cwd: '/api/prisma',
    debug: false,
    datamodelPath: '/api/node_modules/@prisma/photon/schema.prisma',
    prismaPath: undefined, <---- !!!!!!!!!!!
    generator: {
    name: 'photon',
    provider: 'photonjs',
    output: '/api/node_modules/@prisma/photon',
    binaryTargets: [],
    config: {}
    },
    ...
    I'm following this example: https://github.com/prisma/prisma-examples/blob/prisma2/typescript/graphql-apollo-server/src/schema.ts https://github.com/prisma/prisma-examples/blob/prisma2/typescript/graphql-apollo-server/src/context.ts I have re-initialized prisma2, deployed a fresh DB, and regenerated my data and clients plenty of times. I can seed the DB just fine, I can navigate the data fine using the Prisma Explorer, but my GraphQL queries always get the
    Invalid photon.() invocation
    . Happy to share more code if it helps 👍
    • 1
    • 2
  • t

    Thiago Camargo

    12/15/2019, 9:19 PM
    A question regarding prima2 with nexus/graphql: I'm trying to return a partial list of attributes from a table, as in one of the fields I want to make hidden from querying (let's say for my case, password) Is the right approach to return everything and use a middleware 'permissions' that always shields that particular field? Or should I ommit in the graphql schema object definition even though it exists in the db table?
    g
    • 2
    • 2
  • c

    Cigoler

    12/16/2019, 9:54 AM
    Why do my createModel mutations require the arguments to be wrapped in: data { } ?
    • 1
    • 3
  • l

    Lukas Greb

    12/16/2019, 6:53 PM
    Hey everyone :) I just started learning GraphQL and almost completed the GraphQL Fundamentals Tutorial (https://www.howtographql.com/graphql-js/8-filtering-pagination-and-sorting/). But when I reached the part to test the filter API with the provided sample query, unfortuately it didn't work. I got the error: "Variable '$where' expected value of type 'LinkWhereInput' but got: [the content of the where filter definition, see below]" After googling and trying a few things without success, I cloned the corresponding git rep (https://github.com/howtographql/graphql-js), generated a new docker container and installed prisma (this time not the newest version, but the same as is used in the rep), but I still get the same error... When I replace the OR here with an AND, everything works as it should, so I would guess something is wrong with the OR?
    Copy code
    const where = args.filter ? {
          OR: [
            { description_contains: args.filter },
            { url_contains: args.filter },
          ], } : {};
    I used a local Database instead of the demo server (but I also just tried the demo server to make sure that's not causing the problem) and when running "prisma deploy" it complains that:
    Copy code
    The field postedBy must provide a relation link mode. Either specify it on this field or the opposite field. Valid values are: @relation(link: INLINE)
    plus a few other fields with the same problem. And even though those are easily solved by adding @relation(link: INLINE) to the appropiate spots, why do I need to do that anyway? It feels like when the project was created it worked without that, but why not anymore? When setting this up, the packages are installed with the intented version, so I'm completely lost whats wrong here... It's making me furious when basic stuff like this doesn't work -_- I hope someone can help me with this...
  • g

    Garrett Kelley

    12/16/2019, 8:17 PM
    Hi all, I'm new to Prisma and I have a few questions regarding its purpose. Is Prisma2 able to auto-generate a graphql api given the schema.prisma? Suppose I've modeled my data in a mysql database. I think it would be really cool to have two things: 1. Auto-generated ORM (Photon does this) and 2. Auto-generated API (rest or graphql). Does Prisma2 do the latter or is there another tool that can do that?
    n
    • 2
    • 1
  • m

    Muhaki

    12/17/2019, 9:12 AM
    Hi guys, do you think that it will be dumb if i use Prisma 2 for production on small application with 1-man-army? 😛
    ❓ 2
1...338339340...637Latest