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

    iamclaytonray

    11/10/2017, 11:47 PM
    Does anyone know how I would go about versioning a specific resource? For example, say I was re-writing Facebook. How would I go about using GraphQL/Graphcool to version a Post? (That a User can access the latest version on but also access previous versions of that same Post.)
    p
    • 2
    • 6
  • p

    proteus

    11/11/2017, 12:28 AM
    Hello.
  • p

    proteus

    11/11/2017, 12:29 AM
    I'm having trouble with a resolver, which gives me absolutely nothing about the error that occurs.
  • p

    proteus

    11/11/2017, 12:30 AM
    The only thing I get is a request id, which leads me nowhere.
  • p

    proteus

    11/11/2017, 12:32 AM
    Somebody?
    a
    • 2
    • 10
  • w

    wontwon

    11/11/2017, 4:17 AM
    hey all, any idea why when signing out and signing in as another user keeps the data of the previous user cached with Apollo?
  • w

    wontwon

    11/11/2017, 4:17 AM
    I’ve tried using client.resetStore but that doesn’t seem to do as expected
  • w

    wontwon

    11/11/2017, 4:27 AM
    yeah confirmed, when trying to sign in and receiving a new token, the previously signed in user’s data is still cached
  • w

    wontwon

    11/11/2017, 4:55 AM
    interesting, now when I use emailpassword signin and looking at my apollo store, there are two user accounts on there
  • a

    agartha

    11/11/2017, 5:07 AM
    Apollo has been notoriously stubborn with regards to resetStore
  • a

    agartha

    11/11/2017, 5:08 AM
    resetStore
    does not necessarily remove any data from your store. Instead, it just calls refetch on all active queries, causing the cache to be refreshed.
  • a

    agartha

    11/11/2017, 5:08 AM
    However, after logout, all queries that require authentication will actually fail, which sucks.
  • w

    wontwon

    11/11/2017, 5:10 AM
    originally i was querying for the logged in user by id
  • a

    agartha

    11/11/2017, 5:10 AM
    So, you could decide to call
    resetStore
    after login instead of logout, because then you at least have authentication, and all of your queries should actually return data. But that does leave the data cached after logout, so you need another method to make sure no data gets exposed.
  • w

    wontwon

    11/11/2017, 5:10 AM
    yeah that’s what I understand now too @agartha from what i’ve been reading
    👍🏻 1
  • w

    wontwon

    11/11/2017, 5:10 AM
    thanks for the response
    😎 1
  • w

    wontwon

    11/11/2017, 5:11 AM
    is there still a loggedInUser query?
  • w

    wontwon

    11/11/2017, 5:11 AM
    I was trying to use that per the graphcool docs, but
    Copy code
    Error: GraphQL error: Cannot query field 'loggedInUser' on type 'Query'.
  • a

    agartha

    11/11/2017, 5:12 AM
    Where does it say that in the docs?
  • a

    agartha

    11/11/2017, 5:12 AM
    If you use the
    User
    type, the
    user
    query is still available
  • a

    agartha

    11/11/2017, 5:12 AM
    If you use any other Type for your users, you have to add your own resolver function, that's what the
    loggedInUser
    refers to
  • w

    wontwon

    11/11/2017, 5:13 AM
    https://www.graph.cool/docs/tutorials/auth/authentication-with-email-and-password-for-react-and-apollo-cu3jah9ech
  • a

    agartha

    11/11/2017, 5:14 AM
    If you check after step 21, you'll see that
    loggedInUser
    is part of the
    email-password
    template
  • a

    agartha

    11/11/2017, 5:15 AM
    But afaik,
    user
    is also still available
  • w

    wontwon

    11/11/2017, 5:16 AM
    can you elaborate what you mean by user is still availble?
  • w

    wontwon

    11/11/2017, 5:17 AM
    as of recent I was querying on user and passing in the user’s id to retrieve the current user
  • w

    wontwon

    11/11/2017, 5:17 AM
    the id was retrieved via localStorage
  • w

    wontwon

    11/11/2017, 5:19 AM
    @agartha I got it!
  • w

    wontwon

    11/11/2017, 5:21 AM
    thank you
  • g

    glen

    11/11/2017, 8:58 AM
    Anyone do end to ending testing? Curious to know what your setup is.
    m
    • 2
    • 2
1...421422423...637Latest