fix direction issue with graph search queries