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

    veksen

    06/28/2018, 4:09 PM
    from: https://www.prisma.io/forum/t/access-connection-info-e-g-count-for-type-in-a-resolver/2522/3 this gives access to the count inside my resolver, but not as the result of my query?
    Copy code
    let connection = await ctx.db.query.postsConnection(
      { },
      `{ aggregate { count } } }`,
    )
    let count = connection.aggregate.count
    a
    • 2
    • 5
  • j

    jaybauer

    06/28/2018, 5:01 PM
    Hey guys, I’m having some trouble with returning nested information from a query located in my resolver. The line
    const user = await ctx.db.query.user({ where: { id } })
    is working as expected, but it’s not returning any nested data (in this case a nested type containing Stripe customer information is what I want to get back). These two nodes have a relation set up in my datamodel, and I’m correctly able to return the data using the same query in my playground. Am I missing something here? Why am I not able to get the nested data back in my resolver? And how else would I approach this, if it’s not doable?
    a
    • 2
    • 15
  • q

    quadsurf

    06/28/2018, 5:36 PM
    is this the right slack for GraphCool-related questions? Anyway, one of my apps is still on legacy console, and it's no longer loading "system" data for "User" type
  • q

    quadsurf

    06/28/2018, 5:40 PM
    error reads:
    Whoops. Looks like an internal server error.
    πŸ‘€ 1
    n
    • 2
    • 1
  • p

    peter

    06/28/2018, 6:18 PM
    out of curiosity, is anyone who has deployed
    prisma
    servers keeping track of operating costs?
    j
    a
    • 3
    • 16
  • j

    Jenkins

    06/28/2018, 6:30 PM
    I have mine running on GKE, and so far I'm sitting at about $20/m for a smaller solution. I'll most likely migrate to Digital Ocean when they open up their Kubernetes platform as I like DO more.
    πŸ‘ 1
  • j

    Jenkins

    06/28/2018, 6:31 PM
    Under heavy load, and with horizontal scaling, it would probably scale to about $60, but at that point it'd be fine.
  • s

    sunrising

    06/28/2018, 6:39 PM
    In my
    BILLING
    tab inside settings i always have
    We're currently synchronizing your project data.
    message. Is it quite a long process? πŸ™‚
    n
    • 2
    • 1
  • n

    nate

    06/28/2018, 6:50 PM
    when seeding data, is it possible to use returned values?
  • n

    nate

    06/28/2018, 6:50 PM
    for example, in my seed.graphql i have something like:
  • n

    nate

    06/28/2018, 6:51 PM
    -.txt
  • n

    nate

    06/28/2018, 6:51 PM
    if that makes sense
  • n

    nate

    06/28/2018, 6:52 PM
    i can do most of it with create/connect, but i've run into a couple cases where it would be much easier to use returned data like the id
    n
    • 2
    • 1
  • b

    Blaz

    06/28/2018, 7:47 PM
    Hey guys! I'm trying to figure out how to do user authentication with prisma cloud. Couldn't find any documentation. They way you would setup this with Graphcool was using functions like this:
  • b

    Blaz

    06/28/2018, 7:47 PM
  • b

    Blaz

    06/28/2018, 7:48 PM
    but this doesn't work with prisma
  • b

    Blaz

    06/28/2018, 8:07 PM
    can't find any documentation on how to edit prisma.yml for prisma cloud
    s
    • 2
    • 1
  • n

    Nick

    06/28/2018, 9:46 PM
    Prisma deploy to heroku can you use mysql as datatype?
    n
    n
    • 3
    • 6
  • j

    jhony0311

    06/28/2018, 10:52 PM
    I’m having issues with graphql-yoga and prisma-binding I’m trying to write the a resolver to retrieve all
    Users
    , I have this resolver:
    Copy code
    users: (_, args, context, info) => {
            console.log(info);
            return context.prisma.query.users({}, info);
        }
    And when I hit the query I get this error:
    Copy code
    Cannot return null for non-nullable field User.name.
    The query looks like this:
    Copy code
    {
      users {
        name
      }
    }
    Any idea on what I’m doing wrong?
    m
    • 2
    • 5
  • c

    Chris H

    06/29/2018, 2:48 AM
    Where is the documentation for the syntax used in the
    where
    object below?
    Copy code
    homesInPriceRange: async (parent, args, ctx: Context, info) => {
        const where = {
          AND: [
            { pricing: { perNight_gte: args.min } },
            { pricing: { perNight_lte: args.max } },
          ],
        }
        return ctx.db.query.places({ where }, info)
      },
    and the gql
    aggregate
    thingie below:
    Copy code
    numRatings: {
        fragment: `fragment NumRatings on Place { id }`,
        resolve: async ({ id }, args, ctx: Context, info) => {
          const reviews = await ctx.db.query.reviewsConnection(
            { where: { place: { id } } },
            gql`{ aggregate { count } }`,
          )
          return reviews.aggregate.count
        },
      },
    I have been looking for some kind of reference on when you can use
    filter
    or that you can use
    min
    and
    max
    on an Int? Is google no longer serving me or is the documentation on this stuff sparse?
    • 1
    • 1
  • l

    Luke

    06/29/2018, 3:53 AM
    running
    prisma seed
    is giving me
    Copy code
    ➜  lyra-api prisma seed
    
    ERROR: Workspace * does not exist
    
    {
      "data": {
        "generateClusterToken": null
      },
      "errors": [
        {
          "message": "Workspace * does not exist",
          "locations": [
            {
              "line": 3,
              "column": 9
            }
          ],
          "path": [
            "generateClusterToken"
          ],
          "code": 222
        }
      ],
      "status": 200
    }
    
    Get in touch if you need help: <https://www.prisma.io/forum/>
    To get more detailed output, run $ export DEBUG="*"
    n
    • 2
    • 1
  • j

    jaydenseric

    06/29/2018, 3:54 AM
    Where does graphql-playground keep the application cache? I would like to clear the opened projects history
    n
    • 2
    • 1
  • l

    Luke

    06/29/2018, 3:54 AM
    google showed other people with this error but it was fixed in older versions of the CLI, I just upgraded to the newest πŸ˜•
    n
    • 2
    • 4
  • j

    Jordan Beja

    06/29/2018, 5:57 AM
    πŸ‘‹ Hello - had a quick question. If I am making a dedicated server for hosting a graphql API, and want to use the prisma API on the server as an ORM, do I need to deploy prisma to a separate server altogether? Or can I simply install it on my dedicated server?
    n
    • 2
    • 2
  • g

    Gorodov Maksim

    06/29/2018, 6:01 AM
    I have such type:
    Copy code
    type Action {
      id: ID! @unique
      title: String!
      date: String!
      description: String
      karma: String!
      executors: String!
      members: [ActionMember!]
      author: User!
    }
    And I get this error: The relation field
    members
    has the wrong format:
    [ActionMember]
    Possible Formats:
    ActionMember
    ,
    ActionMember!
    ,
    [ActionMember!]!
    Why can't I have
    [ActionMember!]
    ? I want to make this field optional
    a
    j
    • 3
    • 12
  • g

    Gorodov Maksim

    06/29/2018, 6:21 AM
    Could somebody help me with this? I'm trying to solve this problem for a few days but I cannot find the solution :(( https://www.prisma.io/forum/t/i-get-wrong-result-after-mutation/3850
    j
    n
    • 3
    • 54
  • g

    Gorodov Maksim

    06/29/2018, 6:39 AM
    @Jenkins
  • g

    Gorodov Maksim

    06/29/2018, 7:04 AM
    @Jenkins that's what I get when I use that schema
  • j

    Jim

    06/29/2018, 8:26 AM
    I have an update User mutation where the name, email and body are requried:
    Copy code
    return ctx.db.mutation.updateUser(
      {
        where: { id },
        data: {
          name,
          email,
          body,
        },
      },
      info,
    );
    Is there a smart way to make the name, email and body optional, and only update them if a value has been passed? I could do it with some if statements but it makes my soul feel dirty:
    Copy code
    if (name) {
    	ctx.db.mutation.updateUser(
    	  {
    	    where: { id },
    	    data: {
    	      name,
    	    },
    	  },
    	  info,
    	);
    }
    if (email) {
    	ctx.db.mutation.updateUser(
    	  {
    	    where: { id },
    	    data: {
    	      email,
    	    },
    	  },
    	  info,
    	);
    }
    if (body) {
    	ctx.db.mutation.updateUser(
    	  {
    	    where: { id },
    	    data: {
    	      email,
    	    },
    	  },
    	  info,
    	);
    }
    j
    • 2
    • 2
  • t

    taikn

    06/29/2018, 8:41 AM
    Any chance this - https://github.com/prismagraphql/prisma/issues/2333 can be given a higher priority? Its been there for a while already, and its the only issue that prevents my project from operating properly. πŸ™
    πŸ‘ 2
1...686970...637Latest