Closed lukvermeulen closed 4 months ago
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.
Thanks alot for the heads up. I dug into it again and it looks like some noise made me miss a stupid typo. Sorry for the noise!
That's ok, if it was something that was easy to break it would've still made sense to look into.
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