How to throw appropriately on subscribe call? #195
-
I have a service with multiple subscription handlers, and would like to be able to throw in certain circumstances (eg subscription-specific perm check) when the handler is called. I'm able to do this in our non-giraphql infrastructure, but it seems I can only do this in the resolver definition in giraph, which means that an event has to pass through first before I can throw. (I want you to know that I am using merged schemas, so it could be something specific to a merged schema and the native behavior actually works.)
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
GiraphQL passes subscribe and resolve directly through to the underlying schema (some plugins do some wrapping in certain cases) but generally the subscribe and resolve functions are exactly what ends up in the built schema. This is likely an issue with how the schemas are merged. Hard to say for sure without more details |
Beta Was this translation helpful? Give feedback.
-
Got to this discussion through a link in our code that Theo, the original reporter, put there. Tested this again in the version that we're using, 3.10.1, and it appears that this now works as we expect. |
Beta Was this translation helpful? Give feedback.
GiraphQL passes subscribe and resolve directly through to the underlying schema (some plugins do some wrapping in certain cases) but generally the subscribe and resolve functions are exactly what ends up in the built schema. This is likely an issue with how the schemas are merged.
Hard to say for sure without more details