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

    mehdyouras

    05/20/2018, 8:50 AM
    Hello ! I've juste updated windows and WSL and now my graph-yoga crashed after 5 minues of running with this error message
  • w

    weakky

    05/20/2018, 3:23 PM
    Does anyone know a way to
    getUserId(ctx)
    from a subscription ? It looks like
    ctx.request
    is null from a subscription šŸ˜ž
    n
    • 2
    • 10
  • p

    philch

    05/20/2018, 3:58 PM
    anyone using prisma 1.8.3 with prisma-binding 2.0 and noticing that
    ctx.db.exists.Type
    always returns true no matter what args? Am I misunderstanding how it is supposed to work?
    Copy code
    await <http://ctx.db.exists.Post|ctx.db.exists.Post>({
            title: 'blah',
          })
    should return false but instead it looks like it is just querying the server for all posts and returning true.
    m
    • 2
    • 39
  • d

    dreadjr

    05/20/2018, 4:00 PM
    What is the best way to achieve the following datamodel.graphql
    Copy code
    graphql
    type File {
      id: ID! @unique
      path: String!
    }
    schema.graphql
    Copy code
    graphql
    # import File from "./generated/prisma.graphql"
    
    // I want to extend the application schema to load the file and convert to base64, but don't want to keep in database.
    Is this possible?
    extend type File {
      base64: String
    }
    
    or inherit
    type ExtendedFile inherits File {
      base64: String
    }
    Do I redefine all the File fields in the schema graphql?
    v
    d
    n
    • 4
    • 8
  • z

    zonofthor

    05/20/2018, 6:04 PM
    I'm importing data into fresh Prisma service... all goes well until importin relations: "Failure inserting into relationtable... a foreign key constraint fails" - I've double checked everything, there are no errors. Is there some trix importing relations?
    n
    • 2
    • 1
  • z

    zonofthor

    05/20/2018, 6:05 PM
    I'm creating new IDs on the fly (regluard 25 char uuids) but relations are definitely matching, should this be an issue?
  • z

    zonofthor

    05/20/2018, 6:15 PM
    the main error is
    SQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails
  • z

    zonofthor

    05/20/2018, 6:35 PM
    even weirder - I can create new data, export that and import with no problems - and the syntax for exported data is exactly the same, just different IDs
  • j

    justinrich

    05/20/2018, 7:22 PM
    I’m trying to seed data with predefined IDs … what’s the best way to do this?
  • j

    justinrich

    05/20/2018, 7:23 PM
    my model is like this
    Copy code
    type User {
      id: ID! @unique
      email: String! @unique
      profilePicture: File
      name: String!
      createdAt: DateTime!
      updatedAt: DateTime!
      password: String!
      phone: String
      location: String
      memberships: [Member!]! @relation(name: ā€œMemberOnUserā€,cascadeDelete: true)
      membershipRequests:[MembershipRequest!]! @relation(name: ā€œUsersRequestingMembershipā€)
      admin: Boolean! @default(value:false)
    }
  • j

    justinrich

    05/20/2018, 7:24 PM
    and my seed is like this
    Copy code
    user2: createUser(data:{
            id:"123",
            name:"athena",
            email:"<mailto:athena@hackerpug.com|athena@hackerpug.com>",
            password:"athena",
            phone:"<tel:925-000-0000|925-000-0000>",
            location:"Los Angeles, CA",
        }){
            id
        }
  • j

    justinrich

    05/20/2018, 7:24 PM
    but I’m getting this error
    Copy code
    ERROR: Argument 'data' expected type 'UserCreateInput!' but got: {id: "123", name: "athena" ...
    n
    • 2
    • 1
  • s

    Sam Jackson

    05/20/2018, 8:20 PM
    Anyone have any recommendations for hosting Prisma/Postgres? Preferably a platform that has a free tier or trial period.
    z
    n
    • 3
    • 10
  • j

    jasonhealy

    05/20/2018, 11:40 PM
    Anyone know what the best way would be to reorder multiple items in Prisma. Given an ā€˜order: Int’ on each item. Eg. A drag and drop list that persists the new order on drop. Looking at UpdateMany mutation - it appears you can only change all items with the same value and no way of using a dynamic value?
    s
    n
    • 3
    • 4
  • s

    Sim

    05/21/2018, 12:44 AM
    hi guys i have simple question - i was thinking what if someone got my graphql mutations , is my app is safe or he/she can do bad things to my app by using those mutations ?
    s
    • 2
    • 3
  • s

    siyfion

    05/21/2018, 10:05 AM
    Can anyone explain what the
    _RelayId
    table is for? And what the data relates too?
    n
    • 2
    • 10
  • v

    Vimalraj

    05/21/2018, 10:37 AM
    @john: I have replied you in the forum for the same question, please refer
  • v

    Vimalraj

    05/21/2018, 10:40 AM
    You don't have to provide the
    id
    attribute, since that is not a field in your
    UserCreateInput
    type.
  • s

    siyfion

    05/21/2018, 10:40 AM
    Urgh…
    Copy code
    Creating stage default for service default !
     ā–ø    Server at <http://localhost:4466> requires a cluster secret. Please provide it with the env var
     ā–ø    PRISMA_MANAGEMENT_API_SECRET
    j
    n
    • 3
    • 4
  • s

    siyfion

    05/21/2018, 10:42 AM
    shouts at monitor ā€œBut it’s right there in the
    prisma.yml
    file!!!ā€
    šŸ˜„ 1
  • r

    Radhey

    05/21/2018, 10:50 AM
    Can anyone help me how to implement in android GraphQL
  • s

    siyfion

    05/21/2018, 11:24 AM
    Ok, so now I have Prisma running in AWS Fargate and locally in docker. Development and staging environments, complete! šŸ˜„
    šŸ’Æ 1
    prisma cool 1
    a
    n
    • 3
    • 4
  • s

    siyfion

    05/21/2018, 11:25 AM
    However, now I’ve got questions about implementation. For example, how do I hide certain fields from the public-facing API? Or conversely, how do I add calculated fields that don’t relate to DB fields, on a type?
  • s

    siyfion

    05/21/2018, 11:27 AM
    eg. I’d like to have an
    activityFeed
    field on a
    User
    , but I want it to return a type that doesn’t exist in the DB, built up of related data from various tables and logic..
    n
    • 2
    • 23
  • h

    hamdi

    05/21/2018, 11:47 AM
    hi i want to fetch img from database i use <img src={require ({item.img})} /> but not work img from graphql
  • j

    Jim

    05/21/2018, 12:16 PM
    Im having so much trouble deploying my Prisma service. Is there an idiot proof guide anywhere? Im not having much joy with the docs šŸ˜ž
    n
    j
    • 3
    • 23
  • t

    terion

    05/21/2018, 12:46 PM
    #graphql-import
    is there a way to modify imported types? I want to import mutations from generated schema and lock them with
    auth
    directive. And can't find any way for doing this
  • t

    terion

    05/21/2018, 12:47 PM
    I've also tried this:
    Copy code
    type Mutation @auth {
    #import Mutation.createArticle from "src/schema/generated/mysql.graphql"
    }
    but this doesn't work
    n
    • 2
    • 6
  • m

    Mike

    05/21/2018, 12:56 PM
    is there some syntax that allows a mutation to update a value based on curren value?
    field = field + 1
    ?
    n
    • 2
    • 1
  • d

    dennisko

    05/21/2018, 1:24 PM
    how would you create a local test db?
    n
    • 2
    • 2
1...353637...637Latest