is there a way to add authentication to certain op...
# kgraphql
m
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
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
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.