Catalysis of the transfer of the amide nitrogen of glutamine to a variety of substrates. GATases catalyze two separate reactions at two active sites, which are located either on a single polypeptide chain or on different subunits. In the glutaminase reaction, glutamine is hydrolyzed to glutamate and ammonia, which is added to an acceptor substrate in the synthase reaction.