Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: Bump strawberry to 0.236.0 and refactor changed imports #591

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
198 changes: 99 additions & 99 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ django = ">=3.2"
asgiref = ">=3.8"
django-choices-field = { version = ">=2.2.2", optional = true }
django-debug-toolbar = { version = ">=3.4", optional = true }
strawberry-graphql = ">=0.235.1"
strawberry-graphql = ">=0.236.0"

[tool.poetry.group.dev.dependencies]
Markdown = "^3.3.7"
Pygments = "^2.15.1"
channels = { version = ">=3.0.5" }
django-choices-field = "^2.2.2"
django-debug-toolbar = "^4.2.0"
django-debug-toolbar = "^3.4"
django-guardian = "^2.4.0"
django-mptt = "^0.14.0"
django-types = "^0.19.1"
Expand Down
2 changes: 1 addition & 1 deletion strawberry_django/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from strawberry import UNSET
from strawberry.annotation import StrawberryAnnotation
from strawberry.arguments import StrawberryArgument
from strawberry.types.arguments import StrawberryArgument


def argument(
Expand Down
12 changes: 6 additions & 6 deletions strawberry_django/fields/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
from django.db.models import ForeignKey
from strawberry import LazyType, relay
from strawberry.annotation import StrawberryAnnotation
from strawberry.auto import StrawberryAuto
from strawberry.field import UNRESOLVED, StrawberryField
from strawberry.type import (
from strawberry.types import get_object_definition
from strawberry.types.auto import StrawberryAuto
from strawberry.types.base import (
StrawberryContainer,
StrawberryList,
StrawberryOptional,
StrawberryType,
WithStrawberryObjectDefinition,
get_object_definition,
)
from strawberry.union import StrawberryUnion
from strawberry.types.field import UNRESOLVED, StrawberryField
from strawberry.types.union import StrawberryUnion
from strawberry.utils.inspect import get_specialized_type_var_map

from strawberry_django.resolvers import django_resolver
Expand All @@ -30,8 +30,8 @@

if TYPE_CHECKING:
from django.db import models
from strawberry.object_type import StrawberryObjectDefinition
from strawberry.types import Info
from strawberry.types.object_type import StrawberryObjectDefinition
from typing_extensions import Literal, Self

from strawberry_django.type import StrawberryDjangoDefinition
Expand Down
6 changes: 3 additions & 3 deletions strawberry_django/fields/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@
if TYPE_CHECKING:
from graphql.pyutils import AwaitableOrValue
from strawberry import BasePermission
from strawberry.arguments import StrawberryArgument
from strawberry.extensions.field_extension import (
FieldExtension,
SyncExtensionResolver,
)
from strawberry.field import _RESOLVER_TYPE, StrawberryField
from strawberry.relay.types import NodeIterableType
from strawberry.unset import UnsetType
from strawberry.types.arguments import StrawberryArgument
from strawberry.types.field import _RESOLVER_TYPE, StrawberryField
from strawberry.types.unset import UnsetType
from typing_extensions import Literal, Self

from strawberry_django.utils.typing import (
Expand Down
4 changes: 2 additions & 2 deletions strawberry_django/fields/filter_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from strawberry import UNSET
from strawberry.annotation import StrawberryAnnotation
from strawberry.exceptions import MissingArgumentsAnnotationsError
from strawberry.field import StrawberryField
from strawberry.types.field import StrawberryField
from strawberry.types.fields.resolver import ReservedName, StrawberryResolver
from typing_extensions import Self

Expand All @@ -22,8 +22,8 @@
from collections.abc import Callable, MutableMapping

from strawberry.extensions.field_extension import FieldExtension
from strawberry.field import _RESOLVER_TYPE, T
from strawberry.types import Info
from strawberry.types.field import _RESOLVER_TYPE, T


QUERYSET_PARAMSPEC = ReservedName("queryset")
Expand Down
2 changes: 1 addition & 1 deletion strawberry_django/fields/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
from django.db.models import Field, Model, fields
from django.db.models.fields import files, json, related, reverse_related
from strawberry import UNSET, relay
from strawberry.enum import EnumValueDefinition
from strawberry.file_uploads.scalars import Upload
from strawberry.scalars import JSON
from strawberry.types.enum import EnumValueDefinition
from strawberry.utils.str_converters import capitalize_first, to_camel_case

from strawberry_django import filters
Expand Down
9 changes: 5 additions & 4 deletions strawberry_django/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
import strawberry
from django.db.models import Q, QuerySet
from strawberry import UNSET, relay
from strawberry.field import StrawberryField, field
from strawberry.tools import create_type
from strawberry.type import WithStrawberryObjectDefinition, has_object_definition
from strawberry.unset import UnsetType
from strawberry.types import has_object_definition
from strawberry.types.base import WithStrawberryObjectDefinition
from strawberry.types.field import StrawberryField, field
from strawberry.types.unset import UnsetType
from typing_extensions import Self, assert_never, dataclass_transform

from strawberry_django.fields.filter_order import (
Expand All @@ -47,8 +48,8 @@
from types import FunctionType

from django.db.models import Model
from strawberry.arguments import StrawberryArgument
from strawberry.types import Info
from strawberry.types.arguments import StrawberryArgument


T = TypeVar("T")
Expand Down
11 changes: 7 additions & 4 deletions strawberry_django/mutations/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from django.db import models, transaction
from strawberry import UNSET, relay
from strawberry.annotation import StrawberryAnnotation
from strawberry.field import UNRESOLVED
from strawberry.types.field import UNRESOLVED
from strawberry.utils.str_converters import capitalize_first, to_camel_case
from typing_extensions import Annotated

Expand All @@ -33,10 +33,13 @@

if TYPE_CHECKING:
from graphql.pyutils import AwaitableOrValue
from strawberry.arguments import StrawberryArgument
from strawberry.type import StrawberryType, WithStrawberryObjectDefinition
from strawberry.types import Info
from strawberry.types.types import StrawberryObjectDefinition
from strawberry.types.arguments import StrawberryArgument
from strawberry.types.base import (
StrawberryObjectDefinition,
StrawberryType,
WithStrawberryObjectDefinition,
)
from typing_extensions import Literal, Self


Expand Down
2 changes: 1 addition & 1 deletion strawberry_django/mutations/mutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from strawberry.field_extensions import InputMutationExtension
from strawberry.permission import BasePermission
from strawberry.types.fields.resolver import StrawberryResolver
from strawberry.unset import UNSET, UnsetType
from strawberry.types.unset import UNSET, UnsetType
from typing_extensions import Literal

from .fields import (
Expand Down
9 changes: 5 additions & 4 deletions strawberry_django/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@
from graphql.type.definition import GraphQLResolveInfo, get_named_type
from strawberry import relay
from strawberry.extensions import SchemaExtension
from strawberry.lazy_type import LazyType
from strawberry.object_type import StrawberryObjectDefinition
from strawberry.relay.utils import SliceMetadata
from strawberry.schema.schema import Schema
from strawberry.schema.schema_converter import get_arguments
from strawberry.type import StrawberryContainer, get_object_definition
from strawberry.types import get_object_definition
from strawberry.types.base import StrawberryContainer
from strawberry.types.info import Info
from strawberry.types.lazy_type import LazyType
from strawberry.types.object_type import StrawberryObjectDefinition
from typing_extensions import assert_never, assert_type

from strawberry_django.fields.types import resolve_model_field_name
Expand Down Expand Up @@ -74,7 +75,7 @@
)

if TYPE_CHECKING:
from strawberry.field import StrawberryField # noqa: I001
from strawberry.types.field import StrawberryField # noqa: I001
from strawberry.types.execution import ExecutionContext
from strawberry.utils.await_maybe import AwaitableOrValue
from django.contrib.contenttypes.fields import GenericRelation
Expand Down
9 changes: 5 additions & 4 deletions strawberry_django/ordering.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
from django.db.models import F, OrderBy, QuerySet
from graphql.language.ast import ObjectValueNode
from strawberry import UNSET
from strawberry.field import StrawberryField, field
from strawberry.type import WithStrawberryObjectDefinition, has_object_definition
from strawberry.unset import UnsetType
from strawberry.types import has_object_definition
from strawberry.types.base import WithStrawberryObjectDefinition
from strawberry.types.field import StrawberryField, field
from strawberry.types.unset import UnsetType
from strawberry.utils.str_converters import to_camel_case
from typing_extensions import Self, dataclass_transform

Expand All @@ -34,8 +35,8 @@

if TYPE_CHECKING:
from django.db.models import Model
from strawberry.arguments import StrawberryArgument
from strawberry.types import Info
from strawberry.types.arguments import StrawberryArgument

_T = TypeVar("_T")
_QS = TypeVar("_QS", bound="QuerySet")
Expand Down
4 changes: 2 additions & 2 deletions strawberry_django/pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from django.db import DEFAULT_DB_ALIAS
from django.db.models import Count, Window
from django.db.models.functions import RowNumber
from strawberry.arguments import StrawberryArgument
from strawberry.types import Info
from strawberry.unset import UNSET, UnsetType
from strawberry.types.arguments import StrawberryArgument
from strawberry.types.unset import UNSET, UnsetType
from typing_extensions import Self

from strawberry_django.fields.base import StrawberryDjangoFieldBase
Expand Down
6 changes: 3 additions & 3 deletions strawberry_django/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
FieldExtension,
SyncExtensionResolver,
)
from strawberry.field import StrawberryField
from strawberry.schema_directive import Location
from strawberry.type import StrawberryList, StrawberryOptional
from strawberry.types.base import StrawberryList, StrawberryOptional
from strawberry.types.field import StrawberryField
from strawberry.types.info import Info
from strawberry.union import StrawberryUnion
from strawberry.types.union import StrawberryUnion
from typing_extensions import Literal, assert_never

from strawberry_django.auth.utils import aget_current_user, get_current_user
Expand Down
3 changes: 2 additions & 1 deletion strawberry_django/relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
from strawberry import relay
from strawberry.relay.exceptions import NodeIDAnnotationError
from strawberry.relay.types import NodeIterableType
from strawberry.type import StrawberryContainer, get_object_definition
from strawberry.types import get_object_definition
from strawberry.types.base import StrawberryContainer
from strawberry.types.info import Info
from strawberry.utils.await_maybe import AwaitableOrValue
from typing_extensions import Literal, Self
Expand Down
7 changes: 4 additions & 3 deletions strawberry_django/type.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
from strawberry.exceptions import (
MissingFieldAnnotationError,
)
from strawberry.field import StrawberryField
from strawberry.private import is_private
from strawberry.type import WithStrawberryObjectDefinition, get_object_definition
from strawberry.types import get_object_definition
from strawberry.types.base import WithStrawberryObjectDefinition
from strawberry.types.field import StrawberryField
from strawberry.types.private import is_private
from strawberry.utils.deprecations import DeprecatedDescriptor
from typing_extensions import Literal, Self, dataclass_transform

Expand Down
10 changes: 5 additions & 5 deletions strawberry_django/utils/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@

from django.db.models.query import Prefetch, QuerySet
from django.db.models.sql.where import WhereNode
from strawberry.lazy_type import LazyType
from strawberry.type import (
from strawberry.types import has_object_definition
from strawberry.types.base import (
StrawberryContainer,
StrawberryObjectDefinition,
StrawberryType,
StrawberryTypeVar,
has_object_definition,
)
from strawberry.types.types import StrawberryObjectDefinition
from strawberry.union import StrawberryUnion
from strawberry.types.lazy_type import LazyType
from strawberry.types.union import StrawberryUnion
from strawberry.utils.str_converters import to_camel_case
from typing_extensions import assert_never

Expand Down
4 changes: 2 additions & 2 deletions strawberry_django/utils/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
from django.db.models.expressions import BaseExpression, Combinable
from graphql.type.definition import GraphQLResolveInfo
from strawberry.annotation import StrawberryAnnotation
from strawberry.auto import StrawberryAuto
from strawberry.type import (
from strawberry.types.auto import StrawberryAuto
from strawberry.types.base import (
StrawberryContainer,
StrawberryType,
WithStrawberryObjectDefinition,
Expand Down
3 changes: 2 additions & 1 deletion tests/auth/test_types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import strawberry
from django.contrib.auth.models import Group, User
from strawberry.type import StrawberryList, get_object_definition
from strawberry.types import get_object_definition
from strawberry.types.base import StrawberryList

import strawberry_django
from strawberry_django import DjangoModelType
Expand Down
2 changes: 1 addition & 1 deletion tests/fields/test_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.db import models
from django.test import override_settings
from strawberry import BasePermission, auto, relay
from strawberry.type import get_object_definition
from strawberry.types import get_object_definition

import strawberry_django
from strawberry_django.fields.field import StrawberryDjangoField
Expand Down
3 changes: 2 additions & 1 deletion tests/fields/test_input.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import strawberry
from django.db import models
from strawberry import auto
from strawberry.type import StrawberryOptional, get_object_definition
from strawberry.types import get_object_definition
from strawberry.types.base import StrawberryOptional

import strawberry_django

Expand Down
2 changes: 1 addition & 1 deletion tests/fields/test_ref.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.db import models
from strawberry import auto
from strawberry.type import get_object_definition
from strawberry.types import get_object_definition

import strawberry_django

Expand Down
4 changes: 2 additions & 2 deletions tests/fields/test_relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import strawberry
from django.db import models
from strawberry import auto
from strawberry.type import (
from strawberry.types import get_object_definition
from strawberry.types.base import (
StrawberryList,
StrawberryOptional,
get_object_definition,
)

import strawberry_django
Expand Down
6 changes: 3 additions & 3 deletions tests/fields/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
from django.core.exceptions import FieldDoesNotExist
from django.db import models
from strawberry import auto
from strawberry.enum import EnumDefinition, EnumValue
from strawberry.scalars import JSON
from strawberry.type import (
from strawberry.types import get_object_definition
from strawberry.types.base import (
StrawberryContainer,
StrawberryList,
StrawberryOptional,
get_object_definition,
)
from strawberry.types.enum import EnumDefinition, EnumValue

import strawberry_django
from strawberry_django.fields.field import StrawberryDjangoField
Expand Down
4 changes: 2 additions & 2 deletions tests/filters/test_filters_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from strawberry import auto
from strawberry.exceptions import MissingArgumentsAnnotationsError
from strawberry.relay import GlobalID
from strawberry.type import WithStrawberryObjectDefinition, get_object_definition
from strawberry.types import ExecutionResult
from strawberry.types import ExecutionResult, get_object_definition
from strawberry.types.base import WithStrawberryObjectDefinition, get_object_definition

import strawberry_django
from strawberry_django.exceptions import (
Expand Down
3 changes: 2 additions & 1 deletion tests/filters/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
import pytest
import strawberry
from strawberry import auto
from strawberry.type import StrawberryOptional, get_object_definition
from strawberry.types import get_object_definition
from strawberry.types.base import StrawberryOptional

import strawberry_django
from strawberry_django.filters import get_django_model_filter_input_type
Expand Down
Loading
Loading