Include optional match in query graph

o Adds requiredIds to query graph to track what is expected to be in scope
Merge pull request #2261 from davidegrohmann/ronja-optional-match

Include optional match in query graph