We have a glass slab whose refractive index varies with distance 'x'. The emergent ray will be parallel to the incident ray.
If the medium around glass slab is the same, then the emergent ray will be parallel to the incident ray. It does not depend upon the nature of the slab. This is similiar to the case of multiple glass slabs through which refraction happens, where in the emergent ray still remains parallel to the incident ray. Similarly, increase in length does not affect the angle subtended by the emergent ray.