graphql-shield
graphql-shield copied to clipboard
Move from graphql-middleware to Resolvers Composition
Resolvers Composition is a small, well maintained, and well tested package being part of graphql-tools
This would be amazing! I love graphql-shield, but do not use graphql-middleware. Resolver composition is nice but I do not like it's dot notation for naming. Your nested objects API is much cleaner & easier for typesafety when combined with codegen.
I'd be happy to write a PR for this if you'd like. It's only about 60 LOCs: https://github.com/ParabolInc/parabol/blob/fa767a6f719cec03a966d41cc45d1a077a1857fb/packages/server/graphql/composeResolvers.ts#L27-L91
thank you @mattkrick ! I'll check it!
Hi @mattkrick ! Looks like I'm doing something similar to what you've mentioned, using Resolvers Composition, preserving Fragments functionality, and solving the problem you've mentioned in your code about Permissions don't get applied to fields that don't have custom resolvers.
Please take a look at the draft PR, maybe you could share some thoughts about it
looks good! i didn't realize the stock composeResolvers handlers a ruleTree using nested object notation instead of dot notation. It'll be great to have 1 less dependency!