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

    afgh

    03/01/2017, 12:11 PM
    The new subscription setup is much nicer than the previous one, good work everyone 🙂 👍
    👍 6
    🦜 2
    ❤️ 5
    graphcool 4
    n
    • 2
    • 1
  • t

    tim2

    03/01/2017, 1:18 PM
    @lprocks just asked how our subscriptions compare to Scaphold’s. Here is my answer for those who are interested: @lprocks That's indeed a good and valid question. As I am a part of Graphcool, this answer will probably be opinionated, but I try to stay as objective as I can. First of all, we’re in contact with Scaphold and highly respect the work they’re doing. Both Scaphold and Graphcool had subscriptions out there now for months, Graphcool however in beta, so we could iterate over our Implementation more easily. What you see now is the 2nd iteration of our API. And now a feature breakdown: In Scaphold and Graphcool you can subscribe to multiple mutations in one subscription query. That allows you to write less code and maintain less subscriptions. In Scaphold however, you can not distinguish the behavior of the subscriptions per mutation type. Graphcool allows that by having the
    mutation
    on the level of the
    filter
    . People who are used to the
    AND
    and
    OR
    syntax know, which powerful filters you can write with that. Scaphold supports basic scalar filters in their subscriptions. However, as soon as you’re building a real big application, relational filters on subscriptions are a necessity. Imagine you want to build Facebook and only get notified when a friend creates a Post, but not when someone else of the hundred millions of users post something. As far as I can see, in Scaphold you currently can’t define a filter for that. So before we released the Subscriptions it was very important to us to support that use case. Graphcool not only supports scalar and relational filters in the subscription, but you can also combine the normal filters with subscription specific filters like
    mutation_in
    or
    updatedFields_contains
    . That means in a chat you can say I am interested in all related messages and if the
    text
    of a message has been updated. This is how you would express it with Graphcools API:
    Copy code
    Message(filter: {
    	node: {
    		room: {
    			name: "my chatroom"
    		}	
    	}
    	mutation_in: [CREATED,UPDATED]
    	updatedFields_contains: "text"
    }) {
    	mutation
    	updatedFields
    	node {
    		id
    		text
    		author {
    			id
    			name
    		}
    	}
    	previousValues {
    		text
    	}
    }
    There is much more to say, especially when it comes to our backend implementation, but I hope this could already give you an overview about the two implementations. In the next weeks we will release a blog article discussing our backend implementation of the GraphQL Subscriptions.
    🤓 1
    👍 2
    đź’Ż 1
    🚀 5
    ❤️ 1
    graphcool 4
    đź’Ş 1
    k
    l
    • 3
    • 3
  • d

    daver182

    03/01/2017, 3:42 PM
    Hi everyone, with Auth0 and React-router is enough to check for the token in localstorage in a route with "onEnter" prop?
    n
    n
    • 3
    • 8
  • a

    artyom

    03/01/2017, 4:16 PM
    hello @fh @oliver welcome to our slack! let us know if you have any questions graphcool 🚀
  • o

    oliver

    03/01/2017, 4:25 PM
    Hi, I get random internal server errors like this: "GraphQL error: Whoops. Looks like an internal server error. Please contact us in Slack (https://slack.graph.cool) and send us your Request ID: cizr59rs7yp000115tajq8alv"
    n
    • 2
    • 4
  • m

    martin

    03/01/2017, 6:19 PM
    https://medium.com/@ConsciousApps/integrating-stripe-with-react-graphql-and-apollo-client-e09fdc9e5b95#.1fha0nq2b
    👍 2
    🎉 4
    🙌 2
  • a

    artyom

    03/01/2017, 7:41 PM
    hello @mathieusylvain @davidyoung 🙌 👋 !
  • m

    mathieusylvain

    03/01/2017, 7:45 PM
    Cheers!
  • d

    davidyoung

    03/01/2017, 8:06 PM
    hey @artyom, thanks!
  • j

    jarvis

    03/01/2017, 8:23 PM
    When setting a default date, can it be set to "today" or "now" or some other type of reasonable default?
    n
    • 2
    • 6
  • j

    jarvis

    03/01/2017, 8:25 PM
    I've checked the documentation, and it doesn't seem to indicate a way to do this.
  • s

    sorenbs

    03/01/2017, 10:14 PM
    thanks for writing this up @martin !
  • m

    martin

    03/01/2017, 10:14 PM
    Yeah, no worries. Thanks for everything you do!
  • t

    theraccoun

    03/01/2017, 10:25 PM
    Hey there, great work on the new subscriptions!
  • t

    theraccoun

    03/01/2017, 10:25 PM
    Wondering if there exists an example for using vanilla js for setting up the query
  • t

    theraccoun

    03/01/2017, 10:25 PM
    ie a combo of watchquery and subscribe
  • t

    theraccoun

    03/01/2017, 10:25 PM
    we are not using react in our app
  • d

    davidyoung

    03/02/2017, 12:06 AM
    @martin Great article, thank you! I have one question, could a user hypothetically just call updateUser with paid set to true manually to skip purchasing?
    m
    s
    • 3
    • 7
  • s

    sashko

    03/02/2017, 1:40 AM
    @theraccoun the API should work just as is, but you call
    watchQuery
    instead of using the
    graphql
    container
  • s

    sashko

    03/02/2017, 1:40 AM
    so you can use
    subscribeToMore
  • s

    sashko

    03/02/2017, 1:40 AM
    or call
    client.subscribe
    directly
  • t

    theraccoun

    03/02/2017, 1:52 AM
    @sashko thanks. I did try calling subscribe directly, but that does not return a promise. I then tried subscribe().result().then() and got "result is not a funciton"
  • t

    theraccoun

    03/02/2017, 1:53 AM
    according to the docs subscribe takes some argument that is an observer type
  • s

    sashko

    03/02/2017, 1:53 AM
    @theraccoun it returns an observable
  • t

    theraccoun

    03/02/2017, 1:54 AM
    @sashko hmmm. Still confused. Docs say: subscribe(observer): Subscription
  • t

    theraccoun

    03/02/2017, 1:54 AM
    so subscribe takes an observer and returns a subscription
  • s

    sashko

    03/02/2017, 1:55 AM
    I think you're looking at subscribe on watchQuery
  • s

    sashko

    03/02/2017, 1:55 AM
    I'm talking about subscribe on the client instance.
  • s

    sashko

    03/02/2017, 1:55 AM
    It might not be documented
  • t

    theraccoun

    03/02/2017, 1:55 AM
    yeah, so the docs aren't updated for that
1...114115116...637Latest