https://www.prisma.io/ logo
Join SlackCommunities
Powered by
# prisma-whats-new
  • p

    peter

    02/17/2018, 7:54 PM
    running into
    Copy code
    Error: Cannot use GraphQLSchema "[object Object]" from another module or realm.
    
    Ensure that there is only one instance of "graphql" in the node_modules
    directory. If different versions of "graphql" are the dependencies of other
    relied on modules, use "resolutions" to ensure only one version is installed.
    
    <https://yarnpkg.com/en/docs/selective-version-resolutions>
    
    Duplicate "graphql" modules cannot be used at the same time since different
    versions may have different capabilities and behavior. The data from one
    version used in the function from another could produce confusing and
    spurious results.
        at instanceOf (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/graphql/jsutils/instanceOf.js:17:13)
        at isSchema (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/graphql/type/schema.js:48:35)
        at validateSchema (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/graphql/type/validate.js:51:25)
        at assertValidSchema (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/graphql/type/validate.js:76:16)
        at Object.validate (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/graphql/validation/validate.js:61:35)
        at doRunQuery (/Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/apollo-server-core/src/runQuery.ts:143:30)
        at /Users/peter/Sources/Repos/notes/packages/notes-prisma-local/node_modules/apollo-server-core/src/runQuery.ts:69:39
        at <anonymous>
        at process._tickDomainCallback (internal/process/next_tick.js:228:7)
    a
    n
    m
    • 4
    • 14
  • l

    lawjolla

    02/17/2018, 9:31 PM
    Is anyone else having an issue exporting data from a shared cluster. I'm getting
    Copy code
    Downloading nodes !
     ▸    Cannot read property 'jsonElements' of undefined
    which meant the service didn't have data. But mine does. Not sure what's going on.
    n
    • 2
    • 4
  • s

    Sean King

    02/17/2018, 10:30 PM
    Is Graphcool still supported or has focus shifted to Prisma?
  • p

    patstrz

    02/17/2018, 11:22 PM
    Hi I am trying to get query aliases (http://graphql.org/learn/queries/#aliases) to work on my graphql-yoga server. I used resolver forwarding to expose 1-to-1 maps of my prisma service on my yoga server, and when I go to graphiql I can get query aliases to work with my prisma playground but not with my graphql server, is this expected ?
  • p

    patstrz

    02/17/2018, 11:23 PM
  • p

    patstrz

    02/17/2018, 11:23 PM
  • i

    iamclaytonray

    02/17/2018, 11:26 PM
    For anyone who may not know, Ken Wheeler open sourced URQL, a new GraphQL client. Basically a lightweight version of Apollo. 🙂
  • h

    harmony

    02/17/2018, 11:27 PM
    "35.7kB MINIFIED + GZIPPED" 🤔
    i
    • 2
    • 1
  • i

    iamclaytonray

    02/18/2018, 12:05 AM
    For anyone here using Yarn, there is an issue with
    graphql
    and Yarn. I’m not 100% sure how it works but from what I know, it seems as if Yarn tries to install multiple versions of
    graphql
    in your
    node_modules
    . The simplest solution is to
    rm -rf node_modules && npm i
    until the issue is resolved from Yarn’s side
  • f

    Futurekam

    02/18/2018, 1:31 AM
    Hey do y'all know why an error like this would occur? it only happens with my deployed endpoint
    Copy code
    {
      "data": null,
      "errors": [
        {
          "message": "Field \"user\" of type \"User\" must have a selection of subfields. Did you mean \"user { ... }\"?",
          "locations": [
            {
              "line": 2,
              "column": 3
            }
          ],
          "path": [
            "login"
          ]
        }
      ]
    }
    l
    • 2
    • 6
  • b

    brad.barnes

    02/18/2018, 2:01 AM
  • b

    brad.barnes

    02/18/2018, 2:01 AM
    I have a schema that seems to be creating a single sided relation in my data:
    Copy code
    type User @model {
      id: ID! @isUnique # read-only (managed by Graphcool)
      facebookFriends: [User!]! @relation(name:"FacebookFriends")
    }
    Anybody know why this is happening?
  • g

    Gijo Varghese

    02/18/2018, 10:54 AM
    If I use Prisma, can I add a field that query data from a redis db? Also what about implementing my own caching layer on top of psql? Is this possible?
    a
    • 2
    • 24
  • p

    pnicolaou

    02/18/2018, 11:29 AM
    Hey I was wondering how I can implement this filtering behaviour in my own resolvers. So when I am quering ‘posts’ using the prisma generated resolver i can do something like
    Copy code
    {
      posts {
       id
       comments(first: 2) {
         id
       }
      }
    }
    But if i create my own resolver, lets say ‘getPosts’, how do can I implement the same filtering behaviour on the comments, so I can write a query like so
    Copy code
    {
      getPosts {
        id
        comments(first: 2) {
          id
        }
      }
    }
  • m

    mv

    02/18/2018, 3:18 PM
    Hey guys, have you been able to get self-relations (one to many) to work properly with Prisma? I have behavior inconsistencies when I compare graphcool to prisma, with the same data model.
  • m

    mv

    02/18/2018, 3:21 PM
    Here is my model:
    Copy code
    type Cell {
      id: ID! @unique
      name: String!
      parent: Cell @relation(name: "CellsRelationship")
      children: [Cell!]! @relation(name: "CellsRelationship")
    }
    And here is what I obtain when I create two cells: 1) a first with no parent (root of the structure) 2) then another with the previously created cell defined as a parent:
    Copy code
    {
            "id": "cjdswp3h40bnl0128th7xh704",
            "name": "Vision",
            "parent": null,
            "children": []
          },
          {
            "id": "cjdswzmjh0bwh0128tw6l18fv",
            "name": "Market Channels",
            "parent": {
              "name": "Vision"
            },
            "children": [
              {
                "id": "cjdswp3h40bnl0128th7xh704",
                "name": "Vision"
              }
            ]
          }
  • m

    mv

    02/18/2018, 3:22 PM
    instead of getting the second cell in the parent's
    children
    list, it ends up in its own
    children
    list.
  • j

    jaaberg

    02/18/2018, 3:41 PM
    I’m having problems with with the default-directive
    type: UserType! @default(value: "SOME_ENUM")
    . The field gets created, but without the default value. Is this some kind of bug or just me doing something wrong?
  • m

    Moritz

    02/18/2018, 3:58 PM
    Hi, does anyone have an example on how to use the
    every
    filter in a query? I would like to query a group that contains exactly an array of users like so:
    Copy code
    const group = await ctx.db.query.groups(
            {
              where: {
                users_every: users
              }
            },
            info,
          )
    wherein users is an array of ids. However, I somehow cannot meet the required format. What do I pass to the users_every as a parameter?
  • m

    Moritz

    02/18/2018, 4:18 PM
    Figured it out myself, a nested
    OR
    with the id array does the trick. I did not realize that OR is an
    UserWhereInput
    type. Nice design!
    Copy code
    const group = await ctx.db.query.groups(
          {
            where:{
              users_every: {OR: users}
            }
          },
          info,
        )
    👍 1
  • j

    jof

    02/18/2018, 5:28 PM
    I'm running a local cluster (docker) and using the key generated by
    prisma token
    in prisma.yml but getting
    your token is invalid
    when running
    prisma playground
    still. What am I doing wrong?
    a
    f
    • 3
    • 22
  • j

    jof

    02/18/2018, 5:28 PM
    Also: using the docker image uses the linux filesystem on macOS which absolutely eats CPU 😞
    e
    • 2
    • 5
  • a

    atito

    02/18/2018, 5:40 PM
    What are the best practices for organizing the resolvers?
    f
    • 2
    • 1
  • p

    peter

    02/18/2018, 8:55 PM
    anyone experienced the following error from `apollo-client`:
    Copy code
    Error: Error: Network error: Network request failed. Payload is not serializable: Converting circular structure to JSON
  • m

    martin

    02/18/2018, 9:02 PM
    Have anyone here used herkou for deploying?
    f
    • 2
    • 1
  • f

    Futurekam

    02/19/2018, 2:32 AM
    I tested it today!
    n
    • 2
    • 5
  • f

    fragosti

    02/19/2018, 3:26 AM
    Has anyone followed the digital ocean tutorial and gotten this error when trying to deploy?
    Could not connect to cluster digital-ocean-cluster with host <http://159.65.177.26:4466>. Did you provide the right port?
    w
    n
    l
    • 4
    • 6
  • w

    wsakaren

    02/19/2018, 7:18 AM
    Re working with GraphQL queries and mutations on the client side it feels to me that we are missing the ability to go from Objects to the graphql string, if I look at Node/React, Java, PHP they all hit this issue of translation.
    n
    • 2
    • 2
  • j

    jsan

    02/19/2018, 11:20 AM
    how to get pass this error while working with the functions via web console:
    Copy code
    <http://d0b5iw4041.execute-api.eu-west-1.amazonaws.com/:1|d0b5iw4041.execute-api.eu-west-1.amazonaws.com/:1> POST <https://d0b5iw4041.execute-api.eu-west-1.amazonaws.com/prod/create/> net::ERR_ABORTED
    VM55 edit:1 Failed to load <https://d0b5iw4041.execute-api.eu-west-1.amazonaws.com/prod/create/>: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<https://console.graph.cool>' is therefore not allowed access. The response had HTTP status code 502. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
    VM55 edit:1 Uncaught (in promise) TypeError: Failed to fetch
    n
    • 2
    • 1
  • j

    jsan

    02/19/2018, 11:21 AM
    it's getting really annoying
1...578579580...637Latest