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

    pbassut

    05/31/2017, 10:44 PM
    Yea. If there was a doc on how to do it I could expand relay classic to support subscription using this lib: https://github.com/edvinerikson/relay-subscriptions/
  • m

    martin

    05/31/2017, 11:57 PM
    Is there anyway to obtain the
    user
    property in the first component as part of a filter variable? This throws an error (
    user
    comes up as undefined):
    Copy code
    export default graphql(userQuery, { options: { fetchPolicy: 'cache-and-network' } })(
    	graphql(getContacts, {
    		options: ({ user }) => ({
    			variables: { contactFilter: { contactToUser: { id: user.id } } },
    			fetchPolicy: 'cache-and-network'
    		})
    	})(Main)
    )
    But when I put the
    getContacts
    query on its own in another react component that’s called from that above react component, it works. Like this: Parent component:
    Copy code
    export default graphql(userQuery, { options: { fetchPolicy: 'cache-and-network' } })(Main)
    Child component:
    Copy code
    export default graphql(getContacts, {
    	options: ({ user }) => ({
    		variables: { contactFilter: { contactToUser: { id: user.id } } },
    		fetchPolicy: 'cache-and-network'
    	})
    })(ChildComponent)
    • 1
    • 1
  • f

    fourcolors

    06/01/2017, 12:10 AM
    Hey, I’m trying to go through the “Learn Apollo” tutorial for React Native but the website keeps breaking. Is this a know issue? I’m getting a cross origin error
    n
    • 2
    • 6
  • p

    pbassut

    06/01/2017, 12:29 AM
    @fourcolors on graphcool? CORS are a known issue, yeah. https://github.com/graphcool/console/issues/1033
  • f

    fourcolors

    06/01/2017, 12:31 AM
    ah, ok so that’s breaking the apollo tutorial then.
  • p

    pbassut

    06/01/2017, 12:35 AM
    If that's when you're using the function playground, then yeah.
  • p

    pbassut

    06/01/2017, 12:35 AM
    Because functions work normally if executed out of the "playground"
  • y

    yus

    06/01/2017, 1:25 AM
    hi guys, is it possible to have async code in server side subscription functions?
    s
    • 2
    • 5
  • y

    yus

    06/01/2017, 1:27 AM
    I have an example below, the callback after calling stripe api to create a customer never gets called (line 10)
  • y

    yus

    06/01/2017, 1:28 AM
    Async_callback_in_Functions.js
  • y

    yus

    06/01/2017, 1:29 AM
    Please help
    n
    • 2
    • 3
  • p

    pbassut

    06/01/2017, 1:47 AM
    @yus wrap it in a promise
  • p

    pbassut

    06/01/2017, 1:50 AM
    -.js
  • p

    pbassut

    06/01/2017, 1:51 AM
    @yus ^
  • p

    pbassut

    06/01/2017, 1:51 AM
    Note that I'm resolving the promise to
    response.body
    which might not be what you want. But it must be resolve to something
  • y

    yus

    06/01/2017, 2:00 AM
    cool @pbassut i'll give it a shot
  • y

    yus

    06/01/2017, 2:02 AM
    although @pbassut the console.log on line 16 never got executed though
  • y

    yus

    06/01/2017, 2:03 AM
    even without the fetch statement, it seems the entire block doesn't get reached
  • p

    pbassut

    06/01/2017, 2:04 AM
    It makes sense. Because the functions returns and graphcool doesn't catch de logs anymore
    👍 1
  • p

    pbassut

    06/01/2017, 2:05 AM
    By wrapping in a promise, you give it time so the query can run the callback. That is, when it finishes the request
  • y

    yus

    06/01/2017, 2:21 AM
    trying now
  • y

    yus

    06/01/2017, 3:23 AM
    -.js
  • u

    user

    06/01/2017, 3:23 AM
    @yus commented on @pbassut’s file https://prisma.slack.com/files/U5KE0SJD8/F5MM3438W/-.js: @pbassut it works! thank you so much!
    -.js
  • w

    wallslide

    06/01/2017, 4:18 AM
    Where can I find documentation about the environment the serverless functions are running in? Should I be reading https://auth0.com/extend/ directly, or are there docs that graphcool has about it? I want to know what version of node it's using, what version of javascript (es2015, etc) is supported, and which libraries I can require.
  • y

    yus

    06/01/2017, 4:21 AM
    @wallslide you can check here for all the libraries you can require https://tehsis.github.io/webtaskio-canirequire/
    👍 1
  • w

    wallslide

    06/01/2017, 4:22 AM
    can I use arrow functions and await/async?
  • y

    yus

    06/01/2017, 4:22 AM
    arrow functions yes
  • y

    yus

    06/01/2017, 4:22 AM
    await/async no
  • w

    wallslide

    06/01/2017, 4:23 AM
    ahh, thanks for the help. thats too bad
  • y

    yus

    06/01/2017, 4:24 AM
    although if u provide a webhook, you can pretty much do whatever you want
1...209210211...637Latest