How do I make my own badge query?

Aha! That was the part I was missing. Thank you for connecting those dots!