Open Moumouls opened 1 year ago
You can get and set the config at the moment with the global property Parse.Server
, which will return the current config
.
Is this related to #8448?
Not related @dblythy the set and get config is a singleton implementation pattern. With some limitations.
Her it's a inversion of control, dependency injection that allow to modify, overwrite the config for each request just before the request is forwarded to the parse server engine.
This kind of pattern allow:
New Feature / Enhancement Checklist
Current Limitation
No way to leverage inversion of control/dependency injection properly for each request
Feature / Enhancement Description
Parse Server is build following Hexagonal software architecture, and originally heavily use inversion of control patterns, that allow parse server to be easily extendable and customizable.
Currently there is no way to add some custom controllers with request granularity to the parse config. Following the Parse Server DNA, developers should be able to modify config per request, mutate config object if needed. Then the config is forwarded to each Parse Server hooks, and even in each Parse Server GraphQL resolvers.
Example Use Case
See the linked PR
8480
In my company we already use this feature from my fork to implement elegantly custom controllers related to request data (user, keys etc...), and for example a "FeatureFlagController".
Alternatives / Workarounds
No workarounds
3rd Party References