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

    Ted

    10/13/2018, 11:01 PM
    Hi guys, where I can find some Prisma Enterprise example and documentation?
  • c

    codingcoop

    10/14/2018, 10:25 AM
    Hey all - Awesome product, new to the community - Kudos on the great work so far. I was wondering, are there any user access / security group control on a single project/channel Prisma GraphQL Model? IE: anonymous can Read and admin can CRUD?
    n
    • 2
    • 2
  • m

    michal.tomsia

    10/14/2018, 5:18 PM
    Hello guys, where can I find an example of connection resolver? Something like this
    return ctx.prisma.categoriesConnection(args);
    throws an Error
    Field 'categoriesConnection' of type 'CategoryConnection' must have a sub selection.
    n
    • 2
    • 2
  • k

    Kosh Naranak

    10/15/2018, 12:56 AM
    can someone PLEASE point me to a simple, basic, easy to understand, tutorial on GraphQL. I have a CRUD app (Django Rest Framework on back-end as api and VueJS on front-end as client) with POST methods I am trying to convert to mutations….but I have NO idea HOW. And all the resources I have are either incomplete or well, just come up short. I need a tutorial that shows how to take a front-end client that talks to a back-end api and goes from REST CRUD to GraphQL (I hope I’m making sense)
  • k

    karolis

    10/15/2018, 5:07 AM
    I'm trying to bookmark and unbookmark a post. The mutation depends on whether bookmarkId already exist or not. new bookmark works well, then unbookmark works well then if I try to bookmark the same post again, I get an error:
    Error: GraphQL error: No Node for the model Bookmark with value cjn8j3ka0ktwl0b77katcw8eu for id found.
    I tried to refetch FEED_QUERY and ME_QUERY but It still doesn't work. I guess this would be something similar as adding a downwote feature to
    howtographql
    tutorial. I just can't make this work. My Button's Mutation:
    Copy code
    <Mutation
              mutation={bookmarkId ? UN_BOOKMARK_MUTATION : BOOKMARK_MUTATION}
              variables={variables}
              // refetchQueries={[{ query: FEED_QUERY }]}
              update={(cache, payload) => {
                const data = cache.readQuery({
                  query: ME_QUERY,
                })
                if (payload.data.createBookmark) {
                  const { createBookmark } = payload.data
                  data.me.bookmarks = [...data.me.bookmarks, createBookmark]
                }
                if (
                  payload.data.deleteBookmark &&
                  payload.data.deleteBookmark.id
                ) {
                  filledIcon = false
                  const { deleteBookmark } = payload.data
                  console.log('deleteBookmark', deleteBookmark)
                  data.me.bookmarks = data.me.bookmarks.filter(
                    bm => bm.id !== deleteBookmark.id,
                  )
                }
                console.log('data after', data)
                cache.writeQuery({
                  query: ME_QUERY,
                  data,
                })
              }}
            >
    Here's the repo https://github.com/kstulgys/blog-demo-app/blob/master/src/components/Post/CreateBookmark.js
    n
    • 2
    • 3
  • i

    Industrial

    10/15/2018, 1:20 PM
    Hi.
  • i

    Industrial

    10/15/2018, 1:21 PM
    I'm getting a
    Copy code
    SchemaFetcher.ts:75 Uncaught Error: {
      "errors": [
        {
          "message": "Project not found: 'default$default'",
          "code": 3016,
          "requestId": "local:api:cjnabu37200050a15q42wm8p3"
        }
      ]
    }
        at Object.next (SchemaFetcher.ts:75)
        at f (Observable.js:126)
        at d (Observable.js:161)
        at e.value (Observable.js:215)
        at httpLink.js:91
  • i

    Industrial

    10/15/2018, 1:21 PM
    In my console in the browser in the GraphQL Playground.
  • i

    Industrial

    10/15/2018, 1:21 PM
    Can I empty/drop my DB to reset it?
    n
    • 2
    • 19
  • d

    d4hines

    10/15/2018, 2:05 PM
    Is this an appropriate place to ask questions about graph.cool as well?
    d
    • 2
    • 2
  • g

    Giancarlo Anemone

    10/15/2018, 2:40 PM
    Hello everyone! I submitted a PR adding some features to vscode-graphql here: https://github.com/prisma/vscode-graphql/pull/77
    d
    • 2
    • 1
  • d

    dennis

    10/15/2018, 7:32 PM
    Hi, how can I set an empty array as default value for a type in my datamodel ? The following example is not working:
    Copy code
    type User {
      id: ID! @unique
      email: String @unique
      name: String!
      imageUrl: String
      collections: [Collection!]! @default(value: "[]")
    }
  • d

    dennis

    10/15/2018, 7:33 PM
    Copy code
    type Collection {
      id: ID! @unique
      title: String!
      published: Boolean! @default(value: "false")
      owner: User!
    }
    e
    • 2
    • 2
  • f

    FurrySolver

    10/15/2018, 7:38 PM
    Hey everyone, I've been trying to use Prisma to get my startup's mvp done. Question on documentation, can I safely ignore all the docs that's version
    1.16
    or below? The reason I said
    1.16
    is because I'm using
    prisma-client
    , seems to be a feature for
    prisma 1.17 and above
    , and it seems to be a replacement over
    prisma-bindings
    . I started with the prisma bolierplates and didn't know what
    prisma-bindings
    was, I was pretty confused
    j
    a
    • 3
    • 2
  • j

    johhansantana

    10/15/2018, 8:01 PM
    question: is there a way to add custom type keys descriptions so it displays in the graphql playground?
    👀 1
  • a

    Abhi

    10/16/2018, 4:15 AM
    Hi all, what do I need to get some urgent Prod support?
    d
    • 2
    • 1
  • k

    kYuZz

    10/16/2018, 9:38 AM
    hello! how can I use the
    graphl query
    command with
    graphql-cli
    ? there seems to be no documentation about it
    n
    • 2
    • 2
  • b

    Bruno Prela

    10/16/2018, 2:33 PM
    i’d just like to bump this issue on here bc I think it’s a lot of people’s favorite issue https://github.com/prisma/prisma/issues/95
  • g

    Greyson

    10/16/2018, 2:38 PM
    Does anyone know a way to reduce this login mutation so I'm not having to make multiple redundant
    prisma.login
    calls?
    Copy code
    const jwtFragment = `
    fragment JWTFragment on User {
      id
      company {
        accessLevel
        account {
          accountType
        }
      }
    }
    `;
    
    async function login(_: unknown, { email, password }: ArgsLogin) {
      const userLogin = await prisma.login({ email });
      if (!userLogin || !(await compare(password, userLogin.password))) {
        throw new AuthenticationError();
      }
      const user = await prisma.login({ email }).user();
      const payload: any = await prisma.login({ email }).user().$fragment(jwtFragment);
      return {
        token: sign({
          id: payload.id,
          accessLevel: payload.company.accessLevel,
          accountType: payload.company.account.accountType
        }, process.env.APP_SECRET),
        user
      }
    }
  • g

    Greyson

    10/16/2018, 4:35 PM
    Also, is there any way to pass data from a directive-resolver to its corresponding resolver function? IE. if I have an auth directive-resolver but need auth info inside my query/mutation resolver is there some way to use the nextFn to pass authentication data from the directive-resolver?
    l
    f
    • 3
    • 5
  • h

    huv1k

    10/16/2018, 6:02 PM
    We just release new version of
    graphql-playground
    . You can now freely share your playgrounds on https://www.graphqlbin.com/ and your middlewares should be fixed. Enjoy 🚀
    🤾‍♂️ 1
    ⛱️ 1
    🎉 7
    graphql 1
    👍 5
  • a

    andykay

    10/16/2018, 8:38 PM
    So, I'm a little confused how to query fragments from the frontend with Apollo and how it works with Prisma client?
    n
    • 2
    • 13
  • r

    Ritchie

    10/16/2018, 8:48 PM
    hello all.. i'm new to prisma and graphql.. i'm working through a tutorial and using grahql playground on my local to run a query but im getting the following error.
    Copy code
    Error: GraphQL Error: {
      "0": "T",
      "1": "h",
      "2": "e",
      "3": "r",
      "4": "e",
      "5": " ",
      "6": "w",
      "7": "a",
      "8": "s",
      "9": " ",
      "10": "a",
      "11": "n",
      "12": " ",
      "13": "i",
      "14": "n",
      "15": "t",
      "16": "e",
      "17": "r",
      "18": "n",
      "19": "a",
      "20": "l",
      "21": " ",
      "22": "s",
      "23": "e",
      "24": "r",
      "25": "v",
      "26": "e",
      "27": "r",
      "28": " ",
      "29": "e",
      "30": "r",
      "31": "r",
      "32": "o",
      "33": "r",
      "34": ".",
      "status": 500
    }
        at BatchedGraphQLClient.<anonymous> (/Users/ritchie/Sites/wesBos/Advanced-React/sick-fits/backend/node_modules/http-link-dataloader/dist/src/BatchedGraphQLClient.js:69:35)
        at step (/Users/ritchie/Sites/wesBos/Advanced-React/sick-fits/backend/node_modules/http-link-dataloader/dist/src/BatchedGraphQLClient.js:40:23)
        at Object.next (/Users/ritchie/Sites/wesBos/Advanced-React/sick-fits/backend/node_modules/http-link-dataloader/dist/src/BatchedGraphQLClient.js:21:53)
        at fulfilled (/Users/ritchie/Sites/wesBos/Advanced-React/sick-fits/backend/node_modules/http-link-dataloader/dist/src/BatchedGraphQLClient.js:12:58)
        at process._tickCallback (internal/process/next_tick.js:68:7)
    Query
    Copy code
    mutation {
      createItem(
        title: "test"
    description: "test test"
    price: 1000
    image: "dog.jpg"
    largeImage: "doggo.jpg"
    ) {
        id
        title
      }
    }
    I've tried looking everywhere and have had no luck... would really appreciate some help
    n
    • 2
    • 1
  • r

    Ritchie

    10/16/2018, 8:49 PM
    i've had no issues with deploying to prisma via command line so wondering what is causing this
  • c

    cedric

    10/17/2018, 12:15 AM
    hi all, i'm really interested in exploring prisma for some business tools i'm developing, but i'm running into some challenges with reporting. i know there's an open issue for native support for aggregations and another pending feature for raw sql access, but are there any current strategies for doing agg functions like sum, etc
  • c

    cedric

    10/17/2018, 12:16 AM
    there's a pretty high cardinality of records i'm doing agg functions on, so it'd be preferable not to have to pull them down and do the math in memory
  • c

    cedric

    10/17/2018, 12:22 AM
    also, it's possible that raw database access is a thing and documentation is just "coming soon"
  • c

    cedric

    10/17/2018, 12:22 AM
  • c

    cedric

    10/17/2018, 1:30 AM
    stumbled upon https://github.com/prisma/prisma/issues/2052 which seems to provide a few usage examples, unfortunately i haven't been able to get the most basic of them to work though
    d
    f
    n
    • 4
    • 48
  • c

    cedric

    10/17/2018, 1:30 AM
1...136137138...637Latest