The verb 'ask' can take both a direct object and an indirect object.
In this
article, "I need to ask John a question" is treated as a special case, where the indirect object immediately follows the verb 'ask'. I admit this sounds much better. However, I'm quite certain I've heard the next sentence the article spotlights both ways. And, "He promised it to me," sounds much better than "He promised me it."