Strawberry-graphql

Latest version: v0.263.0

Safety actively analyzes 723177 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 81 of 133

0.92.1

Not secure
-------------------

Fix cross-module type resolving for fields and resolvers

The following two issues are now fixed:

- A field with a generic (typeless) resolver looks up the
type relative to the resolver and not the class the field is
defined in. (1448)

- When inheriting fields from another class the origin of the
fields are set to the inheriting class and not the class the
field is defined in.

Both these issues could lead to a rather undescriptive error message:

> TypeError: (...) fields cannot be resolved. Unexpected type 'None'

Contributed by [Michael P. Jung](https://github.com/bikeshedder) [PR #1449](https://github.com/strawberry-graphql/strawberry/pull/1449/)

0.92.0

Not secure
-------------------

This releases fixes an issue where you were not allowed
to return a non-strawberry type for fields that return
an interface. Now this works as long as each type
implementing the interface implements an `is_type_of`
classmethod. Previous automatic duck typing on types
that implement an interface now requires explicit
resolution using this classmethod.

Contributed by [Etty](https://github.com/estyxx) [PR #1299](https://github.com/strawberry-graphql/strawberry/pull/1299/)

0.91.0

Not secure
-------------------

This release adds a `GraphQLTestClient`. It hides the http request's details and asserts that there are no errors in the response (you can always disable this behavior by passing `asserts_errors=False`). This makes it easier to test queries and makes your tests cleaner.

If you are using `pytest` you can add a fixture in `conftest.py`

python
import pytest

from django.test.client import Client

from strawberry.django.test import GraphQLTestClient


pytest.fixture
def graphql_client():
yield GraphQLTestClient(Client())


And use it everywere in your test methods

python
def test_strawberry(graphql_client):
query = """
query Hi($name: String!) {
hi(name: $name)
}
"""

result = graphql_client.query(query, variables={"name": "Marcotte"})

assert result.data == {"hi": "Hi Marcotte!"}


It can be used to test the file uploads as well

python
from django.core.files.uploadedfile import SimpleUploadedFile


def test_upload(graphql_client):
f = SimpleUploadedFile("file.txt", b"strawberry")
query = """
mutation($textFile: Upload!) {
readText(textFile: $textFile)
}
"""

response = graphql_client.query(
query=query,
variables={"textFile": None},
files={"textFile": f},
)

assert response.data["readText"] == "strawberry"


Contributed by [Etty](https://github.com/estyxx) [PR #1225](https://github.com/strawberry-graphql/strawberry/pull/1225/)

0.90.3

Not secure
-------------------

This release fixes an issue that prevented using enums as
arguments for generic types inside unions.

Contributed by [Patrick Arminio](https://github.com/patrick91) [PR #1463](https://github.com/strawberry-graphql/strawberry/pull/1463/)

0.90.2

Not secure
-------------------

This release fixes the message of `InvalidFieldArgument` to properly show the field's name in the error message.

Contributed by [Etty](https://github.com/estyxx) [PR #1322](https://github.com/strawberry-graphql/strawberry/pull/1322/)

0.90.1

Not secure
-------------------

This release fixes an issue that prevented using `classmethod`s and `staticmethod`s as resolvers

python
import strawberry


strawberry.type
class Query:
strawberry.field
staticmethod
def static_text() -> str:
return "Strawberry"

strawberry.field
classmethod
def class_name(cls) -> str:
return cls.__name__


Contributed by [Illia Volochii](https://github.com/illia-v) [PR #1430](https://github.com/strawberry-graphql/strawberry/pull/1430/)

Page 81 of 133

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.