Hi @Gablic
I'm glad to hear you solve the problem ,if you have any issue about SharePoint, you are welcome to raise a ticket in this forum.
By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others." and according to the scenario introduced here: Answering your own questions on Microsoft Q&A, I would make a brief summary of this thread:
[Use Graph API Get Items on a SharePoint List with >5000 items]
Issue Symptom:
Unable to get SharePoint List items over 5000, return error The request is unprocessable because it uses too many resources
Solution:
First remove 'Prefer': 'HonorNonIndexedQueriesWarningMayFailRandomly' in header, then go to list settings -> Indexed columns -> Create a new index -> add all the fields you need in $filter. If your list is large, it may take some time to finish indexing.
You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community member's to see the useful information when reading this thread. Thanks for your understanding!