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

    thisismissem

    11/24/2016, 12:03 AM
    yeah
  • t

    thisismissem

    11/24/2016, 12:03 AM
    this is like you want to cache individual nodes of a query at edge
  • t

    thisismissem

    11/24/2016, 12:04 AM
    so like
    query { foo { name } bar { name } }
  • t

    thisismissem

    11/24/2016, 12:04 AM
    and you want to cache the result for
    query { foo { name }
    and
    query { bar { name } }
    separately
  • t

    thisismissem

    11/24/2016, 12:04 AM
    and then combine those values if you get foo && bar
  • t

    thisismissem

    11/24/2016, 12:05 AM
    or if you get
    query { foo { name } post(1) { title } }
    then
    foo
    comes from the cache
  • t

    thisismissem

    11/24/2016, 12:06 AM
    which I think is way more complexity than needed, and you should just wrap your resolver in a caching function
  • t

    thisismissem

    11/24/2016, 12:06 AM
    caching the entire query sounds far more reasonable
  • t

    thisismissem

    11/24/2016, 12:06 AM
    (although, likely could break with query batching by clients)
  • t

    thisismissem

    11/24/2016, 12:09 AM
    I guess one thing that could be done is sending variables by header instead of post body
  • t

    thisismissem

    11/24/2016, 12:10 AM
    In it's simplest form you could probably do just
    sha1(req.body)
    to cache
  • e

    emilrmoeller

    11/24/2016, 12:17 AM
    i see, it sounds pretty complex 🙂 Isn’t the graphql dataLoader enough for caching? Or is it because it’s better to be able to let people from around the globe hit up different instances of varnish depending on their location ?
  • e

    emilrmoeller

    11/24/2016, 12:17 AM
    (sorry if it’s noobish, I’m getting more and more in to backend development atm)
  • t

    thisismissem

    11/24/2016, 12:30 AM
    it's like if you're querying for articles by id, without user-specific data
  • t

    thisismissem

    11/24/2016, 12:31 AM
    then it's better to store copies as close as possible to the edge (the user), rather than actually hitting your server and having your server do work
  • e

    emilrmoeller

    11/24/2016, 1:24 AM
    Ah yeah ofc, because even with DataLoader the server still does the work of returning the cache
  • e

    emilrmoeller

    11/24/2016, 1:25 AM
    Thanks for explaining it for me @thisismissem
  • t

    thisismissem

    11/24/2016, 1:26 AM
    also, with DataLoader, the loaders are usually only caching per request, not per server
  • e

    emilrmoeller

    11/24/2016, 1:41 AM
    ah, so if i’m firing a request with multiple queries and parts like
    author {…}
    is the same 😮 I actually got the impression that it made a full server cache so the next request would read from a cache. Wow, i’m stoked, i misunderstood big time then
  • t

    thisismissem

    11/24/2016, 1:54 AM
    nope
  • t

    thisismissem

    11/24/2016, 1:55 AM
    if you create your Dataloader instance on request, then it's per request
  • t

    thisismissem

    11/24/2016, 1:55 AM
    i.e., https://github.com/facebook/dataloader#creating-a-new-dataloader-per-request
  • e

    emilrmoeller

    11/24/2016, 2:07 AM
    I see thank you!
  • t

    thisismissem

    11/24/2016, 2:12 AM
    no worries 🙂
  • e

    emilrmoeller

    11/24/2016, 3:39 AM
    Hi! I’m trying to create a change password form, but i can’t figure what mutations i need to change password of a user. Looking at the mutation
    updateUser
    the only arguments are
    id, username
    . Any help would be useful 🙂
  • n

    nilan

    11/24/2016, 9:20 AM
    hey @annek I will have a look right away simple smile
  • n

    nilan

    11/24/2016, 10:00 AM
    hey @emilrmoeller, that is not possible at the moment. we just discussed our road map for email/password: https://github.com/graphcool/feature-requests/issues/39 with things like email validation and reset password emails. would be nice if you could add your thoughts simple smile
  • n

    nilan

    11/24/2016, 11:39 AM
    Welcome @musbell simple smile
  • s

    schickling

    11/24/2016, 4:37 PM
    Hey everyone <!here|@here>! Even though it has been available for a few days now, today we're officially introducing support for Auth0 & Digits. You can read more about it here: https://blog.graph.cool/user-authentication-in-graphql-with-auth0-digits-4ce01788950
    🙌 3
  • s

    sunrising

    11/24/2016, 4:38 PM
    👍
1...535455...637Latest