Handling conditional directives (@include and @skip) in middleware - query analyzing #7131
Unanswered
mbenedykconfigit
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have encountered a challenge that I need assistance with.
My current implementation relies on a custom directive, and I need to count its occurrences on the backend and perform specific actions based on the total count at the end of the operation. To achieve this, I am using middleware to inspect
SyntaxNodesand check the Directives collection for my custom directive.However, I have encountered a problem when queries contain
@includeor@skipdirectives. To accurately count the occurrences of my custom directive, I need to account for the@includeand@skipconditions and stop counting in cases where sub-nodes are excluded or skipped.Is there a method to resolve the values of
@includeand@skipdirectives based onDirectiveNodeandISelectionNodetypes without manually matching the variables used within them to the provided variables?Any guidance or suggestions on how to handle this scenario would be greatly appreciated.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions