Strawberry-graphql

Latest version: v0.229.1

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

Scan your dependencies

Page 34 of 119

0.156.1

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

Add `GraphQLWebsocketCommunicator` for testing websockets on channels.
i.e:

python
import pytest
from strawberry.channels.testing import GraphQLWebsocketCommunicator
from myapp.asgi import application


pytest.fixture
async def gql_communicator():
async with GraphQLWebsocketCommunicator(
application=application, path="/graphql"
) as client:
yield client


async def test_subscribe_echo(gql_communicator):
async for res in gql_communicator.subscribe(
query='subscription { echo(message: "Hi") }'
):
assert res.data == {"echo": "Hi"}


Contributed by [ניר](https://github.com/nrbnlulu) via [PR #2458](https://github.com/strawberry-graphql/strawberry/pull/2458/)

0.156.0

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

This release adds support for specialized generic types.
Before, the following code would give an error, saying that `T` was not
provided to the generic type:

python
strawberry.type
class Foo(Generic[T]):
some_var: T


strawberry.type
class IntFoo(Foo[int]): ...


strawberry.type
class Query:
int_foo: IntFoo


Also, because the type is already specialized, `Int` won't get inserted to its name,
meaning it will be exported to the schema with a type name of `IntFoo` and not
`IntIntFoo`.

For example, this query:

python
strawberry.type
class Query:
int_foo: IntFoo
str_foo: Foo[str]


Will generate a schema like this:

graphql
type IntFoo {
someVar: Int!
}

type StrFoo {
someVar: String!
}

type Query {
intFoo: IntFoo!
strfoo: StrFoo!
}


Contributed by [Thiago Bellini Ribeiro](https://github.com/bellini666) via [PR #2517](https://github.com/strawberry-graphql/strawberry/pull/2517/)

0.155.4

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

Fix file not found error when exporting schema with lazy types from CLI 2469

Contributed by [San Kilkis](https://github.com/skilkis) via [PR #2512](https://github.com/strawberry-graphql/strawberry/pull/2512/)

0.155.3

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

Fix missing custom `resolve_reference` for using pydantic with federation

i.e:

python
import typing
from pydantic import BaseModel
import strawberry
from strawberry.federation.schema_directives import Key


class ProductInDb(BaseModel):
upc: str
name: str


strawberry.experimental.pydantic.type(
model=ProductInDb, directives=[Key(fields="upc", resolvable=True)]
)
class Product:
upc: str
name: str

classmethod
def resolve_reference(cls, upc):
return Product(upc=upc, name="")


Contributed by [filwaline](https://github.com/filwaline) via [PR #2503](https://github.com/strawberry-graphql/strawberry/pull/2503/)

0.155.2

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

This release fixes a bug in subscriptions using the graphql-transport-ws protocol
where the conversion of the NextMessage object to a dictionary took an unnecessary
amount of time leading to an increase in CPU usage.

Contributed by [rjwills28](https://github.com/rjwills28) via [PR #2481](https://github.com/strawberry-graphql/strawberry/pull/2481/)

0.155.1

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

A link to the changelog has been added to the package metadata, so it shows up on PyPI.

Contributed by [Tom Most](https://github.com/twm) via [PR #2490](https://github.com/strawberry-graphql/strawberry/pull/2490/)

Page 34 of 119

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.