Had to dig through the zshcompsys manual to find out the right commands
The below code at the end of ~/.zshrc works for me
function _my_completions() { local -a mywords mywords=( foo bar ) compadd -a mywords } compdef _my_completions -first-
The important flag here is the context -first-
. As per zshcompsys man page
-first- This is tried before any other completion function. The function called may set the _compskip parameter to one of various values: all: no further completion is attempted; a string containing the substring patterns: no pattern completion functions will be called; a string containing default: the function for the `-default-' context will not be called, but functions defined for commands will