graphql-shield or fieldAuthorizePlugin, that is th...
# graphql-nexus
m
graphql-shield or fieldAuthorizePlugin, that is the question πŸ€”
s
We use graphql-shield and love it. It was super duper easy to set up and does the job for us.
πŸ™Œ 1
πŸ’― 1
m
I use it too but I want to give a try on the fieldAuthorizePlugin
a
choose whatever has the most stable support, none of them looks promising in this regard, but graphql-shield looks more safe to me
s
I also have a plugin
There is also an excellent plugin for graphql shield
m
@Albert Gao why do you think that graphql-shield is safer than plugins ? the solutons seem pretty similar to me.
a
more stars, to this regard, so the repo is more likely to be maintain in a long term speaking, and apollo eco system has far more users than nexus eco system πŸ™‚
but you know, future is unpredictable @Mikastark
m
Apollo community and nexus/prisma community are not separated. I don't thinks it's a popularity problem (as Nexus has 1.8k stars and graphql-shield 2.5k. Not "big" diff)
a
This is about one plugin vs a schema system. It’s actually quite big difference, at least my idea. Far More apollo users so more mrobust that plugin gonna get.
m
I think fieldAuthorizePlugin is more relevant as the
authorize
method is included inside the type definition. With graphql-shield you have to write a separated schema-like in order to define permissions. I think is less error prone to configure the whole type logic inside the type definition itself (it's the heart of code-first approach after all). But I like to confront my point of view with other devs (and certainly more experimented as I am)