Knocking only when you are on the bike is probably loose spoke. The replaced spoke has probably settled in to position and now needs tightening.
If the knocking is only when the wheel is freewheeling ( check by turning the pedals while the wheel is spinning) it is probably a sticking pawl in the freehub. Take it back to the shop to fix since it is a new bike.