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

    sweekar

    06/21/2018, 9:54 AM
    Copy code
    Exception in thread "main" org.postgresql.util.PSQLException: ERROR: permission denied for database db_ltr_stg
    n
    • 2
    • 1
  • d

    Darryl

    06/21/2018, 10:07 AM
    Can I please get some help. I have a createRecipe mutation in my resolvers and I’m getting these errors when I try to create a new recipe:
  • d

    Darryl

    06/21/2018, 10:07 AM
    Copy code
    GraphQL server is running on <http://localhost:4000>
    { name: 'New Recipe',
      ingredients:
       [ { name: 'Ingredient 1', quantity: '1' },
         { name: 'Ingredient 2', quantity: '2' } ],
      instructions: [ 'Step 1', 'Step 2' ],
      categories: [ { name: 'SNACK' }, { name: 'DINNER' } ] }
    Error: Variable "$_v0_data" got invalid value {"name":"New Recipe","ingredients":[{"name":"Ingredient 1","quantity":"1"},{"name":"Ingredient 2","quantity":"2"}],"instructions":["Step 1","Step 2"],"categories":[{"name":"SNACK"},{"name":"DINNER"}]}; Field "0" is not defined by type RecipeCreateinstructionsInput at value.instructions.
    Variable "$_v0_data" got invalid value {"name":"New Recipe","ingredients":[{"name":"Ingredient 1","quantity":"1"},{"name":"Ingredient 2","quantity":"2"}],"instructions":["Step 1","Step 2"],"categories":[{"name":"SNACK"},{"name":"DINNER"}]}; Field "1" is not defined by type RecipeCreateinstructionsInput at value.instructions.
    Variable "$_v0_data" got invalid value {"name":"New Recipe","ingredients":[{"name":"Ingredient 1","quantity":"1"},{"name":"Ingredient 2","quantity":"2"}],"instructions":["Step 1","Step 2"],"categories":[{"name":"SNACK"},{"name":"DINNER"}]}; Field "0" is not defined by type IngredientCreateManyInput at value.ingredients.
    Variable "$_v0_data" got invalid value {"name":"New Recipe","ingredients":[{"name":"Ingredient 1","quantity":"1"},{"name":"Ingredient 2","quantity":"2"}],"instructions":["Step 1","Step 2"],"categories":[{"name":"SNACK"},{"name":"DINNER"}]}; Field "1" is not defined by type IngredientCreateManyInput at value.ingredients.
    Variable "$_v0_data" got invalid value {"name":"New Recipe","ingredients":[{"name":"Ingredient 1","quantity":"1"},{"name":"Ingredient 2","quantity":"2"}],"instructions":["Step 1","Step 2"],"categories":[{"name":"SNACK"},{"name":"DINNER"}]}; Field "0" is not defined by type CategoryCreateManyWithoutRecipesInput at value.categories.
    Variable "$_v0_data" got invalid value {"name":"New Recipe","ingredients":[{"name":"Ingredient 1","quantity":"1"},{"name":"Ingredient 2","quantity":"2"}],"instructions":["Step 1","Step 2"],"categories":[{"name":"SNACK"},{"name":"DINNER"}]}; Field "1" is not defined by type CategoryCreateManyWithoutRecipesInput at value.categories.
  • d

    Darryl

    06/21/2018, 10:08 AM
    The top log is the args. The correct shape is being passed and this exact mutation (in the playground) works for the API but not when calling it in the server.
  • d

    Darryl

    06/21/2018, 10:09 AM
    In the generated prisma.grapql,
    RecipeCreateinstructionsInput
    (mentioned in the first error) is:
    Copy code
    input RecipeCreateinstructionsInput {
      set: [String!]
    }
    n
    • 2
    • 54
  • d

    Darryl

    06/21/2018, 10:16 AM
    In schema.graphql:
    Copy code
    type Mutation {
      ...
      createRecipe(
        name: String!
        ingredients: [IngredientInput!]!
        instructions: [String!]!
        categories: [CategoryInput!]!
      ): Recipe
    }
    And the mutation in resolves (index.js):
    Copy code
    createRecipe: (_, args, context, info) => {
          return context.prisma.mutation.createRecipe(
            {
              data: {
                name: args.name,
                ingredients: args.ingredients,
                instructions: args.instructions,
                categories: args.categories
              }
            },
            info
          );
        }
  • s

    sclarsk

    06/21/2018, 11:10 AM
    hello, I was wondering if prisma would be suitable for a blog api since I'm confused about something things like directives or protective fields. There is no mention of it. I also saw this https://www.prisma.io/docs/tutorials/connect-to-prisma-from-the-frontend-fbgaeyrou7 which seems to confirm it. Will it be hard to add an authentication or role layer on top of prisma project? or adding protective fields?
    a
    j
    c
    • 4
    • 3
  • d

    Darryl

    06/21/2018, 11:44 AM
    Can anyone help with my questions above? I’m going around in circles here. 🙂
    👍 1
  • a

    alexey.rodionov

    06/21/2018, 12:54 PM
    The great article https://blog.graph.cool/tutorial-building-a-graphql-server-with-graphql-yoga-6da86f346e68 is deleted from blog (and Medium)? 🤔
    n
    • 2
    • 3
  • i

    iamclaytonray

    06/21/2018, 2:48 PM
    So, I’ve decided to try out GraphQL Yoga (and co) for an app I am working on. The boilerplate that I am mainly looking at looks like I have to provide
    where
    options, even when I want a list of unfiltered objects. Is this true?
    posts: [Post!]!
    should not need a
    where
    argument. That should be optional but crashes my server because I don’t provide that in my resolver
    n
    • 2
    • 36
  • j

    jaybauer

    06/21/2018, 3:25 PM
    I posted about this yesterday and didn’t get a response, I’m still struggling with the problem today. I’m getting an error in playground when trying to submit a mutation that says:
    Whoops. Looks like an internal server error. Search your cluster logs for request ID: the-id
    Running
    prisma cluster logs
    shows “Loading logs from docker…“, a checkmark after a few seconds, then shows “Attaching to” and immediately ends with no error. Most of my mutations/queries work fine. Nothing has changed in my project recently, I had to step away from it for a few weeks and now this problem has arisen when there was none before. I’ve tried nuking my cluster/database a few times now in an attempt to fix it to no avail.
    n
    • 2
    • 14
  • j

    Jim

    06/21/2018, 3:36 PM
    Has anyone managed to deploy a Prisma service to Digital Ocean? The official docs arn’t up to date and I cant find any unofficial ones.
    a
    d
    +3
    • 6
    • 36
  • j

    Jim

    06/21/2018, 4:59 PM
    Has the forum gone down?
  • u

    user

    06/21/2018, 5:00 PM
    A file was commented on
  • u

    user

    06/21/2018, 5:14 PM
    A file was commented on
  • a

    Arnab

    06/21/2018, 5:34 PM
    Does prisma have support for
    group_by
    behavior? For instance if I have a table of
    Persons
    and
    Cars
    where each car has a
    owner: Person! @unique
    , it is quite easy to list all the cars with their corresponding owners. However, if I want to go the other way around, how would I proceed? Usually in SQL I'd go with
    group_by
    t
    • 2
    • 6
  • c

    cjjenkinson

    06/21/2018, 7:28 PM
    Are people successfully using the input type in create and update mutations?
    p
    n
    • 3
    • 5
  • z

    zbarnes

    06/21/2018, 7:51 PM
    @cjjenkinson yup. It works like a charm
    Copy code
    input createUserInput {
      email: String!
      password: String!
      role: String
    }
    
    type Mutation {
      createUser(input: createUserInput!): User!
    }
    c
    • 2
    • 1
  • z

    zbarnes

    06/21/2018, 7:52 PM
    I do wish there was a way to do some sort of data validation on the inputs though
    👍 1
  • z

    zbarnes

    06/21/2018, 7:52 PM
    something like
    email: String! @constraint(type: "email")
    c
    • 2
    • 1
  • a

    Arnab

    06/21/2018, 7:57 PM
    I think you can do that with graphQL @zbarnes. Read: https://hackernoon.com/graphql-tips-after-a-year-in-production-419341db52e3
    🦆 1
    e
    d
    • 3
    • 2
  • a

    Arnab

    06/21/2018, 7:59 PM
    There are a bunch of popular libraries out there like the bloated Joi and the async Yup, but I roll my own 100 LOC solution that plugs directly into redux-form so both client and server can use the same validation schema.
    👍 2
    💯 1
  • e

    eelke

    06/21/2018, 9:48 PM
    The age old question: would you rather fight 1 horse-sized duck, or 100 duck-sized horses?
    a
    • 2
    • 3
  • c

    csamu

    06/21/2018, 10:29 PM
    I am unable to authenticate via CLI. I use the command login --token command from the Console, but I get "Error: Exited with code 3". What should I do?
  • n

    Nick

    06/21/2018, 11:04 PM
    I just released there is no PHP example https://www.howtographql.com Also a tip in the Node.js section it would be great if you added a section or additonal chapter detailing on how to deploy either to zeit now or heroku. This things can be tricky considering that graphql is API operating over HTTP
    👀 2
    n
    • 2
    • 1
  • k

    Khoa Huynh

    06/22/2018, 1:38 AM
    hey guys, how can we do a full-text search on Prisma?
  • d

    Dukuo

    06/22/2018, 5:28 AM
    I'm a little confused on dividing schemas into services... Let's say we have on one service the authentication schema, with `User`s, `Role`s and such, and another
    todo-service
    that has `Todo`s and `List`s, and `List`s have a field that references a
    User
    type; now here's what confusing to me: should I maintain the full Prisma schema on both services? Or maybe that's where stitching to one
    api-service
    comes to play? I know there's nothing written in stone here, but i'm trying to figure out how to properly decouple everything neatly 😛
    a
    c
    • 3
    • 5
  • n

    nick

    06/22/2018, 6:31 AM
    is this project dead? https://github.com/prismagraphql/graphql-request
    n
    • 2
    • 3
  • p

    pettanko

    06/22/2018, 11:25 AM
    How does prisma binding write to array? Would I have to read old array and add new data then write? Like add to friends and likes.
    a
    • 2
    • 1
  • z

    zonofthor

    06/22/2018, 11:53 AM
    re schema design; if I define a relation like
    Copy code
    type Books { author: [User!]! }
    am I required to define relation also in
    User
    type? it seems to work fine without
    n
    • 2
    • 1
1...636465...637Latest