Add content.config to the context object. #7320
timleslie
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When writing hooks, access control function, virtual fields, or any other custom functionality which is executed within a resolver, it can be helpful to be able to access information about the full keystone system itself. Which there are various workarounds to this at the moment, none of them are particularly elegant, and they don't lend themselves to consistent, easily explained patterns.
To solve for this, we will add a new object to the
context
object which is passed to all resolver functions.context.config
will mirror the config object exported fromkeystone.ts
, but with some minor adjustments. In particular, any default or computed values which are determined during Keystone start up will be populated. This will give consumers of the object access to the true values being used in a consistent way.Beta Was this translation helpful? Give feedback.
All reactions