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

    TangoJuliett

    07/11/2018, 7:07 PM
    Never mind, I figured it out
    a
    • 2
    • 3
  • f

    Felipe

    07/11/2018, 7:27 PM
    Can you see the console functions ?
  • p

    prolink007

    07/11/2018, 7:45 PM
    Can someone help me out with this issue. Here is the link to the issue i posted on the forums. https://www.prisma.io/forum/t/cant-pass-info-into-mutation/3961
    ⁉️ 1
  • z

    zak.singh

    07/11/2018, 7:51 PM
    has anyone used AWS Cognito with Prisma?
    m
    p
    o
    • 4
    • 7
  • j

    Jenkins

    07/11/2018, 8:36 PM
    Got a weird issue. Querying all users works fine, but when querying a single user by id it returns null - even though the id is correct.
    Copy code
    query {
      users {
        id
        email
      }
    }
    gives:
    Copy code
    {
      "data": {
        "users": [
          {
            "id": "63f14583-de97-429a-bfc0-c296eb636e6d",
            "email": "<mailto:christian@jenkins.no|christian@jenkins.no>"
          }
        ]
      }
    }
    but this:
    Copy code
    query {
      user(where: {
        id: "63f14583-de97-429a-bfc0-c296eb636e6d"
      }) {
        id
        email
      }
    }
    gives:
    Copy code
    {
      "data": {
        "user": null
      }
    }
    Querying by only email works. Id and email are unique.
  • b

    brandon

    07/11/2018, 8:48 PM
    Hello guys, I am new to GraphQL and I wanted to know if someone could answer a question for me. I am passing a public token that is being exchanged for a private token that comes with meta data, which we can call token_items. I wanted to create this token_item and update a user at the same time. Does anyone have a good way of doing this? So my Graphql schema is
    Copy code
    User {
      id: ID! @unique
      name: String!
      token_items: [Token!]!
    }
    Token {
      id: ID! @unique
      info: String!
      carrier: String!
    }
    I've tried something along the lines of:
    Copy code
    mutation {
      updateUser (
        where: {
          id: "1234"
        },
        data: {
          create: {
            info: "1234"
            carrier: "1234"
          }
       }
      )
      {
        id
        name
        email
        token_items {
          id
          info
          carrier
        }
      }
    }
  • s

    Sam Jackson

    07/11/2018, 8:56 PM
    Hey all. I'm having an issue running
    yarn prisma deploy
  • s

    Sam Jackson

    07/11/2018, 8:56 PM
    with the following error:
    Copy code
    Error: Whoops. Looks like an internal server error. Search your server logs for request ID: local:management:cjjhlsbf4000n0910xoq3oage: {"response":{"data":{"addProject":null},"errors":[{"message":"Whoops. Looks like an internal server error. Search your server logs for request ID: local:management:cjjhlsbf4000n0910xoq3oage","path":["addProject"],"locations":[{"line":2,"column":9}],"requestId":"local:management:cjjhlsbf4000n0910xoq3oage"}],"status":200},"request":{"query":"      mutation addProject($name: String! $stage: String! $secrets: [String!]) {\n        addProject(input: {\n          name: $name,\n          stage: $stage\n          secrets: $secrets\n        }) {\n          project {\n            name\n          }\n     }\n      }\n      ","variables":{"name":"default","stage":"default","secrets":null}}}
  • b

    brandon

    07/11/2018, 9:57 PM
    So I was able to solve it. What I did was I just created the token_item and connected it to the user like so:
    Copy code
    mutation {
      createTokenItems (
        data: {
          info: "foo"
          carrier: "bar"
          connect: {
            id: userId
          }   
        }
      )
    }
  • b

    brandon

    07/11/2018, 9:58 PM
    i also changed my schema to this:
    Copy code
    User {
      id: ID! @unique
      name: String!
      token_items: [Token!]!
    }
    Token {
      id: ID! @unique
      info: String!
      carrier: String!
      owner: User
    }
  • t

    Timo

    07/11/2018, 10:09 PM
    hey guys! glad to join this slack channel.... So i have deployed a graphql server and prisma container onto AWS, and now i have started coding some examples from howtographql... everything went smooth except that i cant do anything in the app playground... dev playground is fine... but whenever i try to query or mutation in the app playground, i would get token is invalid... i m using the authorization header token for both the dev and the app....
  • b

    brandon

    07/11/2018, 10:28 PM
    @Timo Have you followed the tutorial from here?
  • b

    brandon

    07/11/2018, 10:28 PM
    https://www.howtographql.com/react-apollo/0-introduction/
  • b

    brandon

    07/11/2018, 10:30 PM
    It stores your token currently in local storage
    Copy code
    const httpLink = new HttpLink({ uri: '<http://localhost:4000>' })
    
    const middlewareAuthLink = new ApolloLink((operation, forward) => {
      const token = localStorage.getItem(AUTH_TOKEN);
      const authorizationHeader = token ? `Bearer ${token}` : null;
      operation.setContext({
        headers: {
          authorization: authorizationHeader
        }
      })
      return forward(operation)
    })
  • b

    brandon

    07/11/2018, 10:30 PM
    or in the server:
    Copy code
    function getUserId(context) {
      const Authorization = context.request.get('Authorization')
      if (Authorization) {
        const token = Authorization.replace('Bearer ', '')
        const { userId } = jwt.verify(token, APP_SECRET)
        return userId
      }
    
      throw new Error('Not authenticated')
    }
    t
    • 2
    • 3
  • b

    brandon

    07/11/2018, 10:31 PM
    It should be in this tutorial for the serverside if using node: https://www.howtographql.com/graphql-js/0-introduction/
  • t

    TangoJuliett

    07/12/2018, 1:56 AM
    The TypeScript generator is generating all kinds of errors
    s
    n
    • 3
    • 9
  • z

    zak.singh

    07/12/2018, 4:43 AM
    Is it possible to use Prisma Cloud when your Prisma server is hosted on a Fargate instance? I'm getting a "cannot connect to server" error
    t
    • 2
    • 2
  • s

    Sam Jackson

    07/12/2018, 4:57 AM
    Has anyone had any success deploying Prisma with Kompose? http://kompose.io
    j
    • 2
    • 7
  • j

    Jim

    07/12/2018, 10:22 AM
    If many users are going to be requesting the same query, does Prisma do any caching? Or should this be handled by my node server instead?
  • j

    Jerry Jäppinen

    07/12/2018, 10:51 AM
    Hmm, I just tried adding a new Prisma server with Heroku and went through this flow:

    https://i.imgur.com/YftVRrw.png▾

  • j

    Jerry Jäppinen

    07/12/2018, 10:52 AM
    I got the success message and can also see the new dyno up on Heroku. However I can’t see the server on Prisma Cloud, and the last green button in the image above just takes me back to the start (i.e. adding a new service)
    n
    • 2
    • 11
  • j

    Jerry Jäppinen

    07/12/2018, 10:53 AM
    I guess I’m missing something obvious?
  • j

    Jerry Jäppinen

    07/12/2018, 10:54 AM
    Can’t really find any details in the docs either so I’m not sure if there’s another step involved here
  • p

    panzupa

    07/12/2018, 11:14 AM
    Hi all
    👋 4
  • s

    senorcodecat

    07/12/2018, 12:23 PM
    Is Graphcool Cloud console down for anyone else?
    n
    • 2
    • 1
  • r

    rajit

    07/12/2018, 12:27 PM
    It is down for me
  • r

    rajit

    07/12/2018, 12:27 PM
    https://status.graph.cool/ offers no useful information
  • r

    rajit

    07/12/2018, 12:28 PM
    When I visit https://console.graph.cool/ I see an eternally displayed loading indicator and there are errors in the console.
  • r

    rajit

    07/12/2018, 12:28 PM
    Our app, built on Graphcool, is also down now as a result
    n
    • 2
    • 2
1...818283...637Latest