وَعَن عبَادَة بن الصَّامِت قَالَ: سَمِعْتُ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسلم يَقُول «إِنَّ أَوَّلَ مَا خَلَقَ اللَّهُ الْقَلَمُ فَقَالَ اكْتُبْ فَقَالَ مَا أَكْتُبُ قَالَ اكْتُبِ الْقَدَرَ مَا كَانَ وَمَا هُوَ كَائِنٌ إِلَى الْأَبَدِ» . رَوَاهُ التِّرْمِذِيُّ وَقَالَ هَذَا حَدِيثٌ غَرِيبٌ إِسْنَادًا
Translation
‘A’isha said

I asked, “Messenger of God, what happens to the offspring of believers?’’ He replied, “They are joined to their parents." I asked, “Although they have done nothing, messenger of God” lie replied, “God knows best what they were doing.” I asked, “What happens to the offspring of polytheists?” He replied, “They are joined to their parents.” I asked, “Although they have done nothing?” He replied, “God knows best what they were doing.” Abu Dawud transmitted it.