https://kotlinlang.org logo
#graphql-kotlin
Title
# graphql-kotlin
v

vio

06/05/2020, 11:39 AM
Hi all, I'm new to graphql, and I was wondering what is the best way to implement queries/mutations with restricted access based on user rights? in a restful api we would make endpoints restricted, I'm not sure how to approach this with graphql. I'm using ktor as well and graphql-kotlin. Thank you!
d

Dariusz Kuc

06/05/2020, 1:58 PM
v

vio

06/05/2020, 2:43 PM
Thank you, I'll look into them 🙂
r

Robert

06/08/2020, 8:27 AM
is there a best practice which could be added to to the docs? Or even code to graphql-kotlin-spring-server?
d

Dariusz Kuc

06/08/2020, 5:26 PM
I’m thinking that the best place for those conversations would be under https://help.github.com/en/github/building-a-strong-community/about-team-discussions
unfortunately it is still in private beta 😞
in the meantime we can probably add some high level overview to the docs
as for the reference implementation - well it is a very broad topic and there is quite a few ways this could be implemented so I don’t think we will be adding it to the
spring-server
data fetchers are plain java classes
they don’t know anything about suspendable functions nor monad types
👍 1
any specific reason you need to store mono in the graphql context instead of unwrapping it?
r

Robert

06/09/2020, 2:14 PM
Nope, I overlook that GraphQLSecurityContextFactory uses `suspend`for the generateContext, which makes it super easy to use later 👍
d

Dariusz Kuc

06/09/2020, 2:40 PM
👍 yeah its suspendable so we can access reactor context through their nice interop
3 Views