Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support GraphQL-core 3.3 #577

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ jobs:
django-version:
- 4.2.*
- 5.0.*
graphql-core-version:
- 3.3.0a5
- 3.2.3
patrick91 marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe 3.2.*, just to make sure we get the latest patch release, like we do for django?

Not sure if 3.3.* would work as it is a pre-release, and usually those have to be totally hardcoded

python-version:
- '3.8'
- '3.9'
Expand Down Expand Up @@ -80,6 +83,8 @@ jobs:
run: poetry install
- name: Install Django ${{ matrix.django-version }}
run: poetry run pip install "django==${{ matrix.django-version }}"
- name: Install graphql-core ${{ matrix.graphql-core-version }}
run: poetry run pip install "graphql-core==${{ matrix.graphql-core-version }}"
- name: Test with pytest
run: poetry run pytest --showlocals -vvv --cov-report=xml
- name: Upload coverage to Codecov
Expand Down
41 changes: 21 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion strawberry_django/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@
GraphQLWrappingType,
get_argument_values,
)
from graphql.execution.collect_fields import collect_sub_fields

try:
from graphql.execution.collect_fields import collect_sub_fields
except ImportError:
from graphql.execution.collect_fields import collect_subfields as collect_sub_fields

Check failure on line 42 in strawberry_django/optimizer.py

View workflow job for this annotation

GitHub Actions / Typing

"collect_subfields" is unknown import symbol (reportAttributeAccessIssue)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably will need to type ignore this line


from graphql.language.ast import OperationType
from graphql.type.definition import GraphQLResolveInfo, get_named_type
from strawberry import relay
Expand Down
Loading