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

    Yao Hong Chun

    09/13/2017, 8:43 AM
    Is there a graphql query I can run to get currentUser relying solely on the token? (on graphcool) somethign like:
    Copy code
    {
        currentUser {
            id email
        }
    }
    • 1
    • 1
  • c

    congy

    09/13/2017, 9:12 AM
    Hello, how do I handle different environments using graph.cool? E.g test/production?
    n
    • 2
    • 3
  • n

    nilan

    09/13/2017, 10:18 AM
    what's the operation of the permission, @Yao Hong Chun?
  • y

    Yao Hong Chun

    09/13/2017, 10:18 AM
    Update
  • y

    Yao Hong Chun

    09/13/2017, 10:20 AM
    Applying to whole type
  • n

    nilan

    09/13/2017, 10:27 AM
    thanks, I added a new bug report, we'll fix this as soon as possible: https://github.com/graphcool/graphcool/issues/552
    👍 1
  • n

    nick.kozhukharenko

    09/13/2017, 11:16 AM
    Is my data backed up?
    Yes. We take periodic snapshots and can perform point in time restore up to 7 days back in time.
    As I see graphcool do automatic backups (as it mentioned on the pricing page). But how to restore the DB? @nilan
    n
    • 2
    • 1
  • n

    nick.kozhukharenko

    09/13/2017, 11:43 AM
    Does Graphcool API provides backup mutation? It’s mentions here (https://www.producthunt.com/posts/graphcool-2) but cant find in the docs.
    n
    • 2
    • 1
  • m

    mwickett

    09/13/2017, 6:04 PM
    I’m ripping my hair on on an inline function. Getting this back:
    Copy code
    {
      "error": "Function returned invalid status code: 500. Raw body: {\n  \"code\": 500,\n  \"error\": \"Script generated an unhandled synchronous exception.\",\n  \"details\": \"TypeError: Cannot read property 'graphcool' of undefined\",\n  \"name\": \"TypeError\",\n  \"message\": \"Cannot read property 'graphcool' of undefined\",\n  \"stack\": \"TypeError: Cannot read property 'graphcool' of undefined\\n    at fromEvent (/data/_verquire/graphcool-lib/0.0.3/node_modules/graphcool-lib/dist/src/index.js:96:39)\\n    at module.exports (/data/io/d653e2ed87574830ac0f87875203c432/webtask.js:7:19)\\n    at /data/io/d653e2ed87574830ac0f87875203c432/webtask.js:40:24\\n    at Async.series.Request.get.Async.series.Async.forEachOf.createError.code (/data/sandbox/lib/sandbox.js:854:33)\\n    at /data/sandbox/node_modules/async/dist/async.js:3853:24\\n    at replenish (/data/sandbox/node_modules/async/dist/async.js:946:17)\\n    at iterateeCallback (/data/sandbox/node_modules/async/dist/async.js:931:17)\\n    at /data/sandbox/node_modules/async/dist/async.js:906:16\\n    at /data/sandbox/node_modules/async/dist/async.js:3858:13\\n    at /data/sandbox/lib/sandbox.js:928:24\"\n}"
    }
  • m

    mwickett

    09/13/2017, 6:04 PM
    code:
    Copy code
    'use latest'
    const fromEvent = require('graphcool-lib').fromEvent
    
    module.exports = function(event) {
      const graphcool = fromEvent(event)
      const api = graphcool.api('simple/v1')
    
      function getPrices() {
        return api
          .request(
            `
          query {
            allPricings {
              type
              price
            }
          }
        `
          )
          .then(pricingQueryResult => {
          console.log(pricingQueryResult)
            const filteredEntries = pricingQueryResult.allPricings.filter(
              price => price.type === event.data.type
            )
            const applicableEntry = filteredEntries.length
              ? filteredEntries[0]
              : false
            console.log(applicableEntry.price)
            return applicableEntry.price
          })
          .catch(error => {
            return { error: error }
          })
      }
    
      return getPrices().then((price) => {
        const dataResponse = Object.assign({}, event.data, { priceBase: price })
    
        return { data: dataResponse }
      })
    }
  • m

    mwickett

    09/13/2017, 6:05 PM
    The purpose is to grab the price of a product from another collection and ‘bake’ it into this newly created product record
  • m

    mwickett

    09/13/2017, 6:06 PM
    It seems to be something I’m doing incorrectly with
    graphcool-lib
    , but I can’t see it.
    a
    n
    d
    • 4
    • 18
  • c

    chandlervdw

    09/13/2017, 6:57 PM
    Graph.cool is complaining about an invalid JWT which was obtained through the Auth0 plugin. But I can verify it on jwt.io when I paste the
    Public Key
    in the Verify Signature (generated via
    lokey
    and the JSON Web Key Set endpoint for my client). What gives?
    • 1
    • 2
  • d

    dardub

    09/13/2017, 7:44 PM
    Is there a way to query for a record that with the MAX value on an int field? Been searching but haven't found any leads.
    d
    • 2
    • 5
  • d

    dardub

    09/13/2017, 7:46 PM
    Don't even need the max record, just max value.
  • b

    bkoltai

    09/13/2017, 11:11 PM
    Howdie, what can I request Beta access?
    a
    • 2
    • 2
  • m

    matty

    09/13/2017, 11:47 PM
    for updateOrCreateType, both update and create parameters are required?
  • m

    matty

    09/13/2017, 11:47 PM
    if i supply both, what is the expected difference between the two - just the ID?
  • j

    johhansantana

    09/13/2017, 11:48 PM
    hello I have a question in the FAQ area it says
    Copy code
    When you submit multiple mutations or queries in the same http request they all count towards your request limit
    does this mean in a query like so:
    Copy code
    {
      post(id:"123") {
        id
        title
        comments {
            id
            comment
        }
      }
    }
    it will count as 2 queries? since it's fetching the post and the comments of the post?
  • m

    matty

    09/13/2017, 11:49 PM
    @johhansantana - I believe they are talking about batched requests here, the query you pasted is just a single query
    n
    • 2
    • 1
  • j

    johhansantana

    09/13/2017, 11:49 PM
    @matty ok thanks!
  • m

    matty

    09/13/2017, 11:55 PM
    for
    createOrUpdate
    , if I'm doing a create, what should the ID for the UpdateType object be?
  • m

    matty

    09/13/2017, 11:58 PM
    ok nevermind, just read on github using this feature could expose us to breaking changes
  • b

    bakumn

    09/14/2017, 3:30 AM
    hello
  • b

    bakumn

    09/14/2017, 3:30 AM
    there anyone?
  • b

    bakumn

    09/14/2017, 3:30 AM
    what mean 'Treeservant Soarer' is not a valid project alias...?
    a
    • 2
    • 7
  • m

    matty

    09/14/2017, 5:02 AM
    there's nothing more terrifying than manually copying functions from one environment to the next 😰
  • m

    matty

    09/14/2017, 5:03 AM
    and then updating the environment variables in the file for the new environment, and making sure each one is copied correctly! 🤞
    n
    • 2
    • 2
  • m

    matty

    09/14/2017, 5:11 AM
    anyone had success using https://github.com/apollographql/eslint-plugin-graphql with a graphcool schema?
    n
    • 2
    • 2
  • j

    jimmy

    09/14/2017, 7:24 AM
    anyone else having trouble updating inline functions?
    ✅ 1
1...338339340...637Latest