it's enough to look at doing our own backend
# prisma-whats-new
z
it's enough to look at doing our own backend
a
You can easily do this in a resolver function.
r
@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
I have created something to support that. https://github.com/kbrandwijk/graphcool-mutex
👍 1
n
there is no first level concept to ensure thread safety in resolvers yet - we're working on different approaches here though
r
@agartha i am trying to use this library and this is the below code snippet
Copy code
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
@nilan: what are the types of approaches that you guys are working with?
a
@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
@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
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