Add rule in run time
See original GitHub issueQuestion about GraphQL Shield
I’m interested in knowing if it’s possible to add/remove rule in run-time.
The use case is:
- I have a list of ‘system-rules’ and a list of ‘user-rules’
- The ‘system-rules’ are added when the server starts
- The ‘user-rules’ are added if the user use a method
addRule
where he specifies a resolver (eg: query.addUser, mutation.removeUser) and chooses one rule (eg: isAdmin, isAuthenticated)
I have no problem adding the ‘system-rules’ when the server starts. But I can’t find a way to add ‘user-rules’.
Is there a way to add rules after the shield middleware is created or to add a new shield middleware in run time?
Thanks!
- I have checked other questions and found none that matches mine.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Drools - Ability to define rules at runtime? - Stack Overflow
Yes, Drools is completely dynamic. You can add/remove/replaces rules at runtime. All the existing sessions are automatically updated in order to keep ...
Read more >Adding Run Time Prompts to Business Rules
Adding Run Time Prompts to Business Rules · From the Business Rules page, click Independent. · Click · Select the business rule to...
Read more >How to create rules at runtime - Google Groups
First, you will need to implement a couple of interfaces (rule repository and rule set) that will be used to load rules from...
Read more >Adding rules at Runtime · Issue #43 · j-easy/easy-rules - GitHub
Hi,. If I understood correctly, it is only possible to modify certain rules at runtime (like the example on changing the adult age)....
Read more >Runtime Fields in Detection Rule - Elastic Discuss
Hello, I created a runtime field which I need to use in a detection rule, but I get no alerts. For the detection...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think there is an api for that, but maybe this could work:
This will recreate and reassign the whole schema to the running apollo server instance. It should work with
apollo-server
andgraphql-yoga
(as it usesapollo-server
unter the hood).This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.