Title
z

zcaudate

11/02/2017, 9:36 PM
it's enough to look at doing our own backend
a

agartha

11/02/2017, 9:39 PM
You can easily do this in a resolver function.
r

rhishikeshj

11/06/2017, 1:39 PM
@agartha thanks for the help 😊 there is one thing here though which i might be missing. Since this resolver will basically do a get and set operation, is there a way to ensure thread safety and atomicity of this operation ?
Is there support for locking specific entities / objects in graph.cool resolvers ?
a

agartha

11/06/2017, 1:45 PM
I have created something to support that. https://github.com/kbrandwijk/graphcool-mutex
👍 1
n

nilan

11/06/2017, 1:48 PM
there is no first level concept to ensure thread safety in resolvers yet - we're working on different approaches here though
r

rhishikeshj

11/08/2017, 6:31 AM
@agartha i am trying to use this library and this is the below code snippet
const graphcool = await withMutex(fromEvent(event))
    const api = graphcool.api('simple/v1')
this gives me an error “No valid session”. Any help on what i may be missing ?
z

zcaudate

11/08/2017, 12:44 PM
@nilan: what are the types of approaches that you guys are working with?
a

agartha

11/08/2017, 1:31 PM
@rhishikeshj There's some issue with the token required to get the project region. If you do
const graphcool = withMutex(fromEvent(event), 'EU_WEST_1')
or your region, you shouldn't get the error anymore
r

rhishikeshj

11/08/2017, 1:36 PM
@agartha will try this. Anything else i can do to help you fix this ? Is this a graphcool-mutex specific bug ?
@agartha also, what region to use if i am deploying locally ?
a

agartha

11/08/2017, 1:36 PM
It's a
graphcool-mutex
thing. I have to check why it is not picking up the token in the function context.
Good question, I made this before the local deployment. The endpoints are now passed in to the function context, so I have to change some bits and pieces in the lib
However, there's a bug on local that I need to consider, because the subscription endpoint in the function context on local is wrong.
I'll push a new version somewhere today