Closed moritz89 closed 1 year ago
Hi @moritz89 ,
For curiosity, what is gql
in there? I know strawberry-django-plus had a shortcut called gql
, but in there gql.type
would be the same as strawberry.type
(i.e. not related to the django integration)
Can you provide more information regarding the context so that I can look into it?
Ah yes, to minimize the diff I simply changed the from strawberry_django_plus import gql
to import strawberry_django as gql
. Updated the description as well
I also tried running the example app, but it results in start errors (with commit 644df4e
):
File "/home/moritz/.cache/pypoetry/virtualenvs/strawberry-graphql-django-Rxi-z_BV-py3.10/lib/python3.10/site-packages/strawberry_django/__init__.py", line 1, in <module>
from . import auth, filters, mutations, ordering, relay
File "/home/moritz/.cache/pypoetry/virtualenvs/strawberry-graphql-django-Rxi-z_BV-py3.10/lib/python3.10/site-packages/strawberry_django/auth/__init__.py", line 1, in <module>
from .mutations import login, logout, register
File "/home/moritz/.cache/pypoetry/virtualenvs/strawberry-graphql-django-Rxi-z_BV-py3.10/lib/python3.10/site-packages/strawberry_django/auth/mutations.py", line 10, in <module>
from strawberry_django.mutations import mutations, resolvers
File "/home/moritz/.cache/pypoetry/virtualenvs/strawberry-graphql-django-Rxi-z_BV-py3.10/lib/python3.10/site-packages/strawberry_django/mutations/__init__.py", line 1, in <module>
from .mutations import create, delete, input_mutation, mutation, update
File "/home/moritz/.cache/pypoetry/virtualenvs/strawberry-graphql-django-Rxi-z_BV-py3.10/lib/python3.10/site-packages/strawberry_django/mutations/mutations.py", line 16, in <module>
from strawberry.extensions.field_extension import FieldExtension
ModuleNotFoundError: No module named 'strawberry.extensions.field_extension'
Ah yes, to minimize the diff I simply changed the
from strawberry_django_plus import gql
toimport strawberry_django as gql
. Updated the description as well
The translations of gql
it self is not straight forward, only gql.django
is mostly. For example, gql.type
is strawberry.type
and not strawberry.django.type
(which was gql.django.type
)
In your example, gql.type
is strawberry_django.type
, meaning you are not using it correctly: it expects a model as the first argument, i.e. @gql.type(SomeModel)
Now, if you were trying to use those as a basic strawberry object, then you would need to change import import to import strawberry as gql
I also tried running the example app, but it results in start errors (with commit 644df4e):
Oh, the example app probably needs to be updated! Thanks for pointing it out :)
Describe the Bug
The following code worked in 0.9.5 but broke in the 0.10.2 version:
During runtime the following error is thrown:
System Information
Additional Context
...
Upvote & Fund