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

    tafelito

    05/24/2019, 5:03 PM
    Hi, is there any documentation on how to deploy a locally prisma server? The docs I found online were to old, and with the prisma cloud it creates a new service, I couldn’t find how to use the one I already have locally
    n
    • 2
    • 16
  • a

    Aviv Stern

    05/24/2019, 6:05 PM
    Anybody knows when prisma helm chart for prisma 1.3x will be available? thanks.
  • u

    Umeed

    05/24/2019, 7:34 PM
    Hello everyone, I am new to prisma, I created a service on prisma’s demo server. I have created email type too for user type in graphql, using prisma playground I can mutate or query “email” also but its not on my MySql db record. Do I have to config something. Thanks.
  • t

    tafelito

    05/24/2019, 8:25 PM
    Hi guys, can anyone help me with this? Having this simple schema
    Copy code
    type Group {
        id: ID!
        name: String!
        rule: [Rule!]
    }
    type Rule {
       id: ID!
       name: String!
       group: Group
       logs: [Log]
    }
    type Log {
       id: ID!
       text: String
       rule: Rule!
    }
    The rules resolver just uses the prisma client
    Copy code
    rules: (parent, args, ctx) => {
        return ctx.prisma.rules(args);
      }
    And then I have the group and the logs resolver for the Rule
    Copy code
    group: async (parent, args, { prisma }) => {
        const [group] = await prisma.rulesGroups({
          where: { rules_some: { id: parent.id } },
        });
        return group;
      },
      logs: async (parent, args, { prisma, logLoader }) => {
        const logs = await prisma.logs({
          where: { rule: { id: parent.id } },
        });
        return logs;
      }
    The problem I see here is that in the group resolver, I don’t have the groupId from the parent rule, so I need to query all groups that has that rule id that is always going to be 1. Same apply for the logs Another problem without having this is if I want to implement a dataloader because I’m seeing a lot of request to the DB. (I’m not sure if I need it for the prisma client as I read at the docs that prisma includes a Dataloader I wasn’t sure if that’s internally or if I still need to do it myself on the server) But in case I needed to, I would still need the ids
    s
    b
    • 3
    • 12
  • t

    tafelito

    05/24/2019, 9:31 PM
    anyone looking at this issue https://github.com/prisma/prisma-templates/issues/28?
  • j

    JorgeAM

    05/25/2019, 5:55 AM
    hi people, I have a question: If I have a resolver, lets say "deletePost", I want only can delete by the author, I know I can use a conditional, but is there something like policies in laravel or something like that?
    s
    • 2
    • 2
  • n

    nobyf

    05/25/2019, 6:38 AM
    Hi, could anyone give me some pointers to how I can add something like likes, liked, follows, and followers to datamodel.prisma in terms of creating a social media app? For example I have a user model like below: I have newly added likes, follows, and followers, but prisma asks me to add relationship.
    Copy code
    type User {
        id: ID! @unique
        username: String! @unique
        likes: [Item!]!
        follows: [User!]!
        followers: [User!]!
        categories: [Category!]! @relation(name: "CategoryToUser", onDelete: CASCADE)
        items: [Item!]! @relation(name: "ItemToUser", onDelete: CASCADE)
        comments: [Comment!]! @relation(name: "CommentToUser", onDelete: CASCADE)
        ...
    }
    What is the best way to set up relations for likes, follows, followers as the items do not usually belong to the user him/herself? or better to do like below? (just keep user or item ids).
    Copy code
    likes: [ID!]!
     follows: [ID!]!
     followers: [ID!]!
    and add some logic in the node server?
    s
    t
    • 3
    • 6
  • f

    Francis John

    05/26/2019, 6:03 AM
    After setting up a new prisma server via the heroku prisma cloud integration (which has the managementApiSecret set), why is my prisma server endpoint supposed to be publically accessible? My expectation was that it would not be publically accessible when the
    managementApiSecret
    is set..
    • 1
    • 1
  • a

    andrux

    05/26/2019, 6:57 PM
    anyone knows how to prevent my prisma endpoint from requiring an authorization token? or at least how to prevent it from expiring… I’m still on the dev phase so I’m not concerned about security at this point
    s
    • 2
    • 1
  • d

    dennisko

    05/26/2019, 7:24 PM
    I think you can remove the
    managementApiSecret
    from
    docker-compose.yml
    ?
  • d

    dennisko

    05/26/2019, 7:25 PM
    https://www.prisma.io/docs/prisma-server/authentication-and-security-kke4/#management-api-secret
    👍 1
    a
    • 2
    • 1
  • p

    pedro

    05/27/2019, 1:47 AM
    Anyone has
    java.lang.RuntimeException: Encountered unknown SQL type timestamptz with column created_at. IntrospectedColumn(created_at,timestamptz,null,false)
    problem?
    • 1
    • 3
  • k

    kitze

    05/27/2019, 8:39 AM
    I have extracted the methods I'm using for authentication in all of my Prisma projects in a package: https://github.com/kitze/graphql-user
    💯 4
    graphql 3
    s
    z
    • 3
    • 5
  • m

    Michał Chmura

    05/27/2019, 12:38 PM
    Hey guys, how can I access the
    server
    mutations from the seeding script? I want to access the mutations and resolvers we created as opposed to using the
    database
    ones. Example of accessing the
    db
    ones:
    Copy code
    const db: Prisma = new Prisma({
      endpoint: '<http://localhost:4466>',
    })
    
    await db.mutation.createUser(...)
    could someone provide me with relevant code for accessing the
    server
    ? Do I need
    apollo-client
    ??
    s
    • 2
    • 8
  • p

    pedro

    05/28/2019, 12:35 AM
    Hi Guys, is there anyway to expose
    createdAt
    and
    updatedAt
    as the query result as well?
  • m

    Mike Whitlaw

    05/28/2019, 1:31 AM
    just add it to your schema.graphql
    👍 1
  • o

    Olaf

    05/28/2019, 6:31 AM
    I created a user model
    Copy code
    type User {
      id: ID!
      first_name: String!
      last_name: String!
      email_address: String!
    }
    and would like to group
    first_name
    and
    last_name
    into a
    name
    object that, when the user is queried, nests the two names like
    name: { first, last }
    so I can do a
    name.first
    etc. Can this be done without creating a 'name' table in the database? I.e. Simply at the Prisma interpretation level, not database. Thanks for any advice for converting my current (flat) structure.
    n
    • 2
    • 4
  • s

    Syed Ali Zaidi

    05/28/2019, 6:47 AM
    Hi guys I need some help, i have model with 15 attributes, but can i dynamically set the attributes in query. What can i do to make this query dynamically if i want to get only top five attributes or more or less
    n
    • 2
    • 7
  • s

    Syed Ali Zaidi

    05/28/2019, 6:48 AM
    I should only pass the attributes and get result of respective attributes like agentId, agentStatus, FirstName, team_id
  • s

    Syed Ali Zaidi

    05/28/2019, 6:52 AM
    -.js
  • d

    dennisko

    05/28/2019, 8:26 AM
    yo when using prisma cloud to create a heroku server - where does the managementApiSecret come from?
  • d

    dennisko

    05/28/2019, 8:27 AM
    atm I have to look it up in heroku and set it locally manually, then deploy
  • d

    dennisko

    05/28/2019, 8:29 AM
    it would be nicer if it would be part of the setup
    m
    • 2
    • 2
  • z

    Ziad Saab

    05/28/2019, 8:41 AM
    Hello 👋 I see that there isn’t much activity in the #graphqlgen channel, the last post before mine being from April 8th. Is there a better place to ask questions about
    graphqlgen
    ?
    n
    • 2
    • 4
  • m

    Michael Schonfeld

    05/28/2019, 9:22 PM
    hi guys. i’m trying to understand how to impl relay-style connection pagination with the
    graphql-schema
    generated schema.graphql… say I have User -> [MessageThread] -> [Message] model, and I want both MessageThread, and Message to respond with the connection types, can/should I not use the generated schema file?
    • 1
    • 1
  • m

    Morten Bo Rønsholdt

    05/29/2019, 8:01 AM
    any ETA on when usage metrics can be disabled? I'm not a fan of our production servers sending data to Prisma: https://www.prisma.io/docs/faq/usage-tracking-fq10/#how-to-opt-out-of-usage-tracking
    d
    • 2
    • 4
  • m

    Michał Chmura

    05/29/2019, 9:28 AM
    can anyone recommend good resources on
    jest
    Integration Testing of APIs built with Prisma?
  • g

    gem

    05/29/2019, 10:41 AM
    how to migrate graphcool server-side subscriptions in graphcool.yml to prisma ?
  • c

    Christian Svenkerud

    05/29/2019, 11:29 AM
    Hey I have a question. I'm looking at this doc under database properties: https://www.prisma.io/docs/prisma-server/deployment-environments/docker-rty1/ Im trying to set another database name for my mysql database where it says the default value is prisma. Regardless of what I set there prisma creates a database called "prisma".
  • m

    m.jarzebski

    05/29/2019, 11:53 AM
    couldn’t find answer for it anywhere: I want subscription for deleted nodes and I have a query for
    Copy code
    previousValues {
            id
          }
    this is the response:
    "previousValues": { "id": "StringIdGCValue(ID)"}
    is it wanted behavior? why not return
    id
    only?
1...272273274...637Latest