https://kotlinlang.org logo
#kgraphql
Title
# kgraphql
m

Mattlangsenkamp

07/06/2020, 4:16 AM
is there a way to add authentication to certain operations only, while excluding others? for example having the querying of items be open but requiring auth for mutations. I am using ktor.
👍 1
for anyone following this, I solved it by extracting headers into a map and passing them into the a Context builder and passing that in with the execute call
j

jeggy

07/10/2020, 12:38 PM
I'm not fully happy with how the implementation of authentication is setup still within KGraphQL. If you have any ideas on how we could improve the setup and make it easier. Ideas are welcome and we'll try to implement it 👌
m

Mattlangsenkamp

07/10/2020, 3:57 PM
I did see some other libraries in js using a concept called "custom directives" do do it. I believe it is something that is built into the graphql spec but idk if it is supported by kgraphql yet. I havent used that approach ever so i cant vouch for it but other people seemed pleased with it.
6 Views