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

    matic

    06/29/2018, 1:28 PM
    Hey guys đź‘‹ Does anyone know if there is any documentation for
    connections
    in Prisma API besides Schema itself? (I might have missed it in the docs as well 🤞)
    n
    n
    • 3
    • 3
  • j

    Jenkins

    06/29/2018, 3:47 PM
    How would you go about protecting parts of your schema? E.g. only revealing that a said query exists if the user provides a valid token? I just learned that schema directives existed yesterday and I'm pretty hyped about those. Currently using them for auth purposes. Would that be something that could solve that problem?
    s
    n
    +3
    • 6
    • 21
  • v

    Vinnie

    06/29/2018, 4:38 PM
    Currently, is there a resource collecting projects that are using Yoga + Prisma? Examples, open source projects, and the like. It’d be nice to create a public list of these if there isn’t one.
    n
    • 2
    • 1
  • p

    pettanko

    06/29/2018, 6:07 PM
    Anyone have a working example using Prisma/GraphQL-yoga and React-Apollo for File Upload? :s I keep getting rip by "Request disconnected during file upload stream parsing." I have tried googling but I feel stupid since I can't find the solution.
    l
    • 2
    • 2
  • n

    Nick

    06/29/2018, 6:35 PM
    I wonder what made you guys go out and create graphql-yoga and prisma tooling around it? In the other examples referring to https://www.howtographql.com/ backend part You are using MVC frameworks like django and ruby on rails even Spring. in Node.js however there is a exiting MVC framework like sails.js but its not used here why?
    l
    • 2
    • 3
  • j

    Jacob

    06/29/2018, 10:41 PM
    Hey all đź‘‹ This Prisma tutorial on how to deploy your prisma server to AWS Fargate was super helpful: https://www.prisma.io/docs/tutorials/-joofei3ahd. I'm wondering if anyone could point me to any docs/ tutorials/ recommendations on how to deploy your graphql server (i.e. graphql-yoga) to Fargate as well. I need subscriptions so I don't think Lambda is a great option in this case. I'd also like my graphql-server to live as close as possible to the prisma server (us-west). Any direction would be greatly appreciated. Thanks!
  • m

    Michael Jones

    06/30/2018, 2:56 AM
    Is there a way to add a field along with the
    info
    object in prisma-binding? Basically, always add a field that should be grabbed regardless of the
    info
    object's contents.
    m
    • 2
    • 6
  • g

    Gorodov Maksim

    06/30/2018, 8:59 AM
    I need to make such mutation from frontend:
    Copy code
    input ActionMemberInput {
        personId: ID!
        side: String!
      }
    
      createAction(
        title: String!
        date: String!
        description: String
        karma: String!
        executors: String!
        members: [ActionMemberInput!]!
      ): Action!
    That's schema from frontend:
    Copy code
    export const CREATE_ACTION = gql`
      mutation createAction(
        $title: String!,
        $date: String!,
        $description: String!,
        $karma: String!,
        $executors: String!,
        $members: [ActionMembersInput!]!,
      ) {
        createAction(
          title: $title,
          date: $date,
          description: $description,
          karma: $karma,
          executors: $executors,
          members: $members,
        ) {
          id
          title
          date
          description
          karma
          executors
          members {
            person {
              id
              name
            }
            side
          }
        }
      }
    `;
    When I'm trying to make such mutation from frontend, I get error 404. I guess the problem somewhere there -
    $members: [ActionMembersInput!]!,
    (frontend schema) I tried to make same mutation from frontend and from playground and it worked in playground but didn't work in frontend
  • g

    Gorodov Maksim

    06/30/2018, 9:00 AM
    I tried to do something like this, but I don't completely understand how it works https://www.prisma.io/forum/t/how-do-i-add-an-array-of-objects-to-a-mutation-in-apollo-react/365/6
    m
    • 2
    • 10
  • j

    Jim

    06/30/2018, 11:19 AM
    Ive added helmet.js to my server however when I look in the network tab in the first document has “X-Powered-By: Express” in the response header, so I think this means it’s not working properly? Does my code look OK? Thanks
    Copy code
    const { GraphQLServer } = require('graphql-yoga');
    const { Prisma } = require('prisma-binding');
    const resolvers = require('./resolvers');
    const authoriseToken = require('./other/auth');
    const helmet = require('helmet');
    
    const server = new GraphQLServer({
      typeDefs: './src/schema.graphql',
      resolvers,
      context: req => ({
        ...req,
        db: new Prisma({
          typeDefs: 'src/generated/prisma.graphql', // the auto-generated GraphQL schema of the Prisma API
          endpoint: process.env.PRISMA_ENDPOINT, // the endpoint of the Prisma API (value set in `.env`)
          debug: true, // log all GraphQL queries & mutations sent to the Prisma API
          // secret: process.env.PRISMA_SECRET, // only needed if specified in `database/prisma.yml` (value set in `.env`)
        }),
      }),
    });
    
    server.use(helmet());
    
    <http://server.express.post|server.express.post>('*', authoriseToken);
    
    server.start(() => console.log('Server is running on <http://localhost:4000'>));
    p
    • 2
    • 2
  • a

    artindaniel

    06/30/2018, 11:20 AM
    Hey all, is it possible to access query/mutation arguments in a directive resolver?
  • a

    artindaniel

    06/30/2018, 11:21 AM
    For example I want to implement a directive resolver
    isPostOwner
    . How would I get the
    postID
    from the query/mutation?
    j
    • 2
    • 3
  • v

    Vinnie

    06/30/2018, 3:11 PM
    do I have to do something in particular to get the generated prisma graphql schema updated on deploy?
    n
    • 2
    • 25
  • s

    Steve

    07/01/2018, 12:58 AM
    How does prisma deal with race conditions in read-then-update -kind of mutations? All I could find was someone else asking the same, but no answers: https://www.prisma.io/forum/t/best-way-to-add-1-to-a-model-field-on-prisma-db-binding/3333
  • j

    jonthewayne

    07/01/2018, 1:21 AM
    Hey everyone! I’d like to build real time collaboration into an app I’m building. So multiple people would be able to edit inside the same text field, add to a list of photos and change their order, etc. I’m trying to figure out the best way to implement this, specifically how to handle conflict resolution for two edits made at the same time (or someone editing offline and then getting connected and syncing when other changes have been made by others in the mean time). I had heard that aws appsync has conflict resolution, but I’m curious how I can achieve this using Prisma. Thanks!
  • j

    jasonkuhrt

    07/01/2018, 2:49 AM
    Has anyone built a chat messaging system on top of Prisma?
    j
    • 2
    • 1
  • g

    Gorodov Maksim

    07/01/2018, 4:59 AM
    is there any way to make something like this in schema:
    Copy code
    type ActionMember {
      id: ID! @unique
      person: Person! || User!
      side: String!
    }
    Something like OR operation
    c
    • 2
    • 6
  • g

    Gorodov Maksim

    07/01/2018, 7:08 AM
    Is increment/decrement feature still on roadmap or alr shipped? https://github.com/prismagraphql/prisma/issues/266
  • n

    Nick

    07/01/2018, 10:11 AM
    Looking at this image is it possible to see the SQL query executed under the hood.
  • u

    user

    07/01/2018, 10:34 AM
    A file was commented on
  • a

    alexey.rodionov

    07/01/2018, 11:11 AM
    Hi, guys! Currently, Prisma GraphQL database WebSocket endpoint supports only subscriptions, but not queries and mutations. I've opened https://github.com/prismagraphql/prisma/issues/2607. If I use Apollo Server, I can create a full WebSocket transport that handles all type of GraphQL operations over the WebSocket (https://github.com/apollographql/subscriptions-transport-ws#full-websocket-transport). I did not fully understand the relationship between
    prisma
    ,
    graphql-yoga
    and
    apollo-server
    . According to `graphql-yoga`'s docs,
    graphql-yoga
    is based on
    apollo-server
    . Right? Since
    apollo-server
    supports full WebSocket transport, why
    graphql-yoga
    don't?
    • 1
    • 1
  • a

    alexey.rodionov

    07/01/2018, 11:46 AM
    Since
    graphql-yoga
    is based on
    apollo-server
    and Apollo Server 2.0 currently is in release candidate stage (https://github.com/apollographql/apollo-server/releases), does this mean that when the Apollo Server 2.0 stable version is officially released, I will be able to use all new mind-blowing features (such as https://dev-blog.apollodata.com/easy-and-performant-graphql-over-rest-e02796993b2b and https://dev-blog.apollodata.com/automatic-persisted-queries-and-cdn-caching-with-apollo-server-2-0-bf42b3a313de) that Apollo Server 2.0 offer directly in
    graphql-yoga
    ?
    m
    c
    p
    • 4
    • 6
  • g

    Gorodov Maksim

    07/01/2018, 5:34 PM
    is there any prisma community in discord?
  • v

    Vinnie

    07/01/2018, 5:46 PM
    If I wanted to relay to my Yoga server a particular data type with all the ORM-like GraphQL operations created by Prisma, what would be the best approach? As in exposing a subset of the Prisma-generated GraphQL schema through my own schema in Yoga.
  • c

    cmcinroy

    07/01/2018, 6:38 PM
    I want to use graphql to replace an existing API and I am struggling with how to model the existing response. The API currently returns a list of things that can be of three types: Thing1, Thing2 or AlertThing. There may not be an AlertThing, but if there is, there is only one and it is the first item in the list. Any suggestions how best to model this? Should the schema enforce the list item types (and, if so, how??)? Or should the schema be a a bit more relaxed and simply define the result list as being comprised of the three types and have the resolver enforce the "AlertThing-first-if-any" rule? 🤪
    h
    • 2
    • 6
  • g

    Gorodov Maksim

    07/02/2018, 3:27 AM
    I have such subscription:
    Copy code
    Subscription: {
        personUpdate: {
          subscribe: (parent, args, context, info) => {
            return context.prisma.subscription.person({}, info);
          },
        },
      },
    How can I detect was person created or deleted on the frontend? I receive completely same data when person was created or deleted
    n
    • 2
    • 4
  • g

    Gorodov Maksim

    07/02/2018, 3:30 AM
    I push
    person
    into array of
    persons
    anytime I receive data from the backend, even when person was deleted because Idk how to detect is this person deleted or created so my application works not how I expect
  • g

    Gorodov Maksim

    07/02/2018, 6:59 AM
    where r docs for Cascading Deletes?
    n
    • 2
    • 1
  • g

    Gorodov Maksim

    07/02/2018, 7:27 AM
    Guys, can u help me with cascading deletes, please? https://www.prisma.io/forum/t/help-with-cascading-deletes/3878
  • m

    martin

    07/02/2018, 9:06 AM
    Hello, is it possible that any of Graphcool service developers take a look on my thread ? Thnx https://www.prisma.io/forum/t/graphcool-update-and-create-mutation-behaving-differently/3853
1...697071...637Latest