You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed the query resolver running on create methods - causing my app to prevent the creation of an item since I was limiting the query by a property that does not exist for the user without creating sad item (a user needs to create a tenant, that is then assigned to him. He can only view tenant information of his own tenant - thats what the query resolver is for.)
To keep my getTenantId resolver generic, I added a configuration option to skip the check on certain methods (e.g. create), while keeping the query resolver itself intact on all methods.
Error
Thats when I noticed, that context.method returned findin all cases - even on create calls.
Steps to reproduce
I discovered logging context.method always prints "find", even in hooks.
Adding this example hook
async(context)=>{console.log(context.method);},
to the before > create hook also returns findwhen creating an object.
I am not able to reproduce this and would be surprised if this was a general issue since many applications and plugins are using similar checks. Please provide a full repository that illustrates your problem.
Context
I noticed the query resolver running on
create
methods - causing my app to prevent the creation of an item since I was limiting the query by a property that does not exist for the user without creating sad item (a user needs to create a tenant, that is then assigned to him. He can only view tenant information of his own tenant - thats what the query resolver is for.)To keep my
getTenantId
resolver generic, I added a configuration option to skip the check on certain methods (e.g. create), while keeping the query resolver itself intact on all methods.Error
Thats when I noticed, that context.method returned
find
in all cases - even on create calls.Steps to reproduce
I discovered logging
context.method
always prints "find", even in hooks.Adding this example hook
to the before > create hook also returns
find
when creating an object.Expected behavior
I'm not sure what is causing this, as this happens on all services for me. I expect the method to return the name of the method, e.g.
create
,get
, ...Actual behavior
context.method
holds the valuefind
in all cases, ignore the actual method type that was called.System configuration
Tell us about the applicable parts of your setup.
Module versions: @featherjs .. tested with 5.0.9, 5.0.21
NodeJS version: 18.17
Operating System: mac os
The text was updated successfully, but these errors were encountered: