strawberry-django icon indicating copy to clipboard operation
strawberry-django copied to clipboard

maximum recursion depth exceeded

Open jeemyeong opened this issue 2 years ago • 2 comments

Describe the Bug

Error Maximum recursion depth exceeded has occurred when I use DjangoOptimizerExtension

System Information

  • Operating system: OSX 13.5.1 (22G90)
  • Strawberry version (if applicable):
    strawberry-graphql==0.207.0 strawberry-graphql-django==0.17.1

Additional Context

image

If needed, I'll prepare sample codes that can reproduce these symptoms

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar

jeemyeong avatar Sep 16 '23 08:09 jeemyeong

Hi @jeemyeong ,

Indeed it would be nice if you could provide a reproduction example, or at least more details about the issue, like its traceback.

bellini666 avatar Sep 16 '23 14:09 bellini666

Hi @bellini666 :) Thank you for the response.

# https://github.com/jeemyeong/strawberry-django-bug-report/blob/main/mysite/polls/models.py#L6-L8
class Question(models.Model):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.__original_question_text = self.question_text
        self.__original_pub_date = self.pub_date

This code is an extension of the Django tutorial with four additional lines. Modifying the constructor of a Django model to add custom fields like this can lead to the occurrence of that error.

image

jeemyeong avatar Sep 16 '23 18:09 jeemyeong

@jeemyeong -- how did you resolve this? I'm running into it too

pfcodes avatar Jul 11 '24 04:07 pfcodes

@jeemyeong -- how did you resolve this? I'm running into it too

@pfcodes I decided to give up using the DjangoOptimizerExtension and directly optimized resolvers using dataloader.

jeemyeong avatar Jul 11 '24 06:07 jeemyeong

@pfcodes can you still reproduce it?

patrick91 avatar Jul 11 '24 07:07 patrick91