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

    yahya

    06/02/2017, 11:33 AM
    -.txt
  • s

    sebastien

    06/02/2017, 4:36 PM
    I'm trying to implement Stripe payments. I've been following the tutorial here: https://www.graph.cool/docs/tutorials/stripe-payments-with-mutation-callbacks-using-micro-and-now-soiyaquah7/, but adapting it for the new Server-side subscriptions. I've got it half working, and customers are being correctly created in Stripe, but no update is being performed on the user (updating the stripeId field). Wondering what I'm wrong there. I'm using pretty much the same code as in the tutorial:
    Copy code
    stripe.customers.create({
        email: user.email,
        description: user.name,
        source: cardDetails.cardToken
      }, (err, customer) => {
        if (err) {
          console.log(err)
          send(res, 400, { error: `Stripe customer with card details ${cardDetailsId} could not be created for user ${userId}` })
        } else {
          // then update user with obtained Stripe customer id
          const updateUser = `mutation {
            updateUser(id: "${userId}", stripeId: "${customer.id}") {
              id
            }
          }`
          <http://request.post|request.post>({
            url: endpoint,
            headers: {
              'Authorization' : graphcoolToken,
              'content-type': 'application/json',
            },
            body: JSON.stringify({query: updateUser}),
          }).on('error', (e) => {
            send(res, 400, { error: `User ${userId} could not be updated` })
          }).on('response', (response) => {
            send(res, 200, { message: `User ${userId} was successfully registered at Stripe` })
          })
        }
      }
    )
    I set the
    endpoint
    to my Graphcool simple API endpoint and
    graphcoolToken
    to a permanent auth token that I generated. I also have the update permission on users fully open for now.
  • s

    sebastien

    06/02/2017, 4:53 PM
    I figured it out it seems. Not sure what did the trick, but it works now!
    n
    • 2
    • 11
  • j

    jony

    06/02/2017, 4:56 PM
    hey guys I'm doing the Learn Apollo tutorial but the graphiQL endpoint never shows up
    n
    • 2
    • 2
  • j

    jony

    06/02/2017, 4:56 PM
    ...am I in the right place?
  • j

    jony

    06/02/2017, 4:58 PM
    also the download button never shows up either - stuck on the first step
  • j

    jony

    06/02/2017, 5:02 PM
    it's showing up now 🙂
  • g

    giedriusr

    06/02/2017, 5:05 PM
    hello! following the tutorial https://www.graph.cool/docs/quickstart/rn-apollo-instagram/ and running
    graphcool init --schema <http://graphqlbin.com/instagram.graphql>
    In the past it worked, but now I get:
    Copy code
    â ‹ Creating project Dewcrane Ogre...:heavy_multiplication_x: Error: No .schema file found or specified
  • g

    giedriusr

    06/02/2017, 5:05 PM
    checked the schema url, it works and returns proper schema
  • g

    giedriusr

    06/02/2017, 5:07 PM
    oh, ok, I thought I need to execute npm install -g graphcool only once, but I did it again and now it worked.
    n
    • 2
    • 2
  • y

    yahya

    06/02/2017, 5:42 PM
    Hey everyone-- I am trying to do a simple filter for query permission and have this:
  • y

    yahya

    06/02/2017, 5:42 PM
    -.txt
  • y

    yahya

    06/02/2017, 5:42 PM
    However, this only works when trying to access an indvidual record-- when I use the all* query it just says insufficient permissions
  • y

    yahya

    06/02/2017, 5:43 PM
    So in this case, if I try
    query { allTimelogs { id }}
    it says i don't have permission
  • y

    yahya

    06/02/2017, 5:43 PM
    is that how its supposed to work instead of just returning the timelogs that I have access to?
    n
    • 2
    • 1
  • n

    niwat

    06/02/2017, 8:13 PM
    What are the “interfaces” coming soon in the schema tabs?
    n
    • 2
    • 2
  • s

    swttt

    06/02/2017, 9:05 PM
    Having issues connecting to the websocket endpoint. Giving an error 400, anyone else having this problem?
  • l

    lastmjs

    06/02/2017, 9:16 PM
    @swttt Just dug into this yesterday
  • l

    lastmjs

    06/02/2017, 9:17 PM
    Take a look: https://github.com/lastmjs/content/blob/4de42e5b967b8ce9a4cb68fb06f89fa4cd904fda/content/reference/api/simple-api/making-api-requests.md
  • l

    lastmjs

    06/02/2017, 9:18 PM
    @niwat I believe it will be support for the standard GraphQL interfaces: http://graphql.org/learn/schema/#interfaces
    👍 1
  • s

    swttt

    06/02/2017, 9:19 PM
    @lastmjs Thanks, but i was handeling everything correctly..seems to be some (api?) changes in the subscriptions-transport-ws module
  • s

    swttt

    06/02/2017, 9:19 PM
    just found this issue 🙂
  • s

    swttt

    06/02/2017, 9:19 PM
    https://github.com/apollographql/subscriptions-transport-ws/issues/149
  • l

    lastmjs

    06/02/2017, 9:21 PM
    @swttt Look at the documentation in the link, it has the old api. graph.cool is currently using the old api
  • l

    lastmjs

    06/02/2017, 9:21 PM
    Are you using subscriptions-transport-ws module?
  • l

    lastmjs

    06/02/2017, 9:21 PM
    Or Apollo which depends on it?
  • l

    lastmjs

    06/02/2017, 9:22 PM
    If so, I think you need to use v0.5.4 of subscriptions-transport-ws
  • s

    swttt

    06/02/2017, 9:22 PM
    ye downgraded to 0.6.0
  • e

    ed

    06/02/2017, 9:26 PM
    Hello team. I have a question. Does graphcool use mongodb as a db?
    n
    • 2
    • 1
  • d

    dbkooper

    06/02/2017, 10:10 PM
    https://get.digits.com/blog/introducing-firebase-phone-authentication
1...214215216...637Latest