While the 940M is a weaker video card than most of the 900 series from nVidia, that's only likely to be a part of the problem.
Some 940m setups do not use discrete memory, and instead share off of the system's RAM. This can contribute to slowdowns and is worth a look to see if this is happening. If it is, try to throttle the behavior so that at least 3GB is left available to your system and the rest for your video card.
Here's your big issue:
"Processor: Intel Core i7-7500U (7th Gen)"
The i7 is a great processor. I use 2nd gen and 8th gen ones at home. The problem is that Intel did some shady nonsense with their mobile platform marketing. This is specific to the suffix: U vs HQ.
An i7 HQ functions as a proper i7. It stands for "High Quality", to my understanding, and is a nice, albeit expensive, mobile processor.
The i7 U is dirty pool. It literally means "Ultra-Low Power". It is actually a dual-core processor more similar to an i3 in structure and performance. They benchmark 30-50% slower than the HQ and HK models of the same line. They are placed in laptops to conserve battery life, but marketed as an i7 to boost sales. GTA V is pretty CPU-heavy, as are most open-world games. You can find intel's processor naming schema here.
Unfortunately, you're sort of stuck. You'll need a different processor, and laptops are more challenging when it comes to user-service than desktops. I recommend upgrading the machine altogether when you can, as the 940M is an older mobile card that will struggle with newer games above moderate settings.