How to match the pattern of a function in Relay?

The way the API is written, the matcher doesn’t traverse your input graph, it will return false unless the exact node you supply matches the pattern.

The partition and rewriting functions, however, will traverse the relay expression, go into functions, and find the match inside your function. If you partition instead of matching, you should see the extraction of your pattern into a function.