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 49 of 133

0.154.1

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

Fix `DuplicatedTypeName` exception being raised on generics declared using
`strawberry.lazy`. Previously the following would raise:

python
issue_2397.py
from typing import Annotated, Generic, TypeVar

import strawberry

T = TypeVar("T")


strawberry.type
class Item:
name: str


strawberry.type
class Edge(Generic[T]):
node: T


strawberry.type
class Query:
edges_normal: Edge[Item]
edges_lazy: Edge[Annotated["Item", strawberry.lazy("issue_2397")]]


if __name__ == "__main__":
schema = strawberry.Schema(query=Query)


Contributed by [pre-commit-ci](https://github.com/pre-commit-ci) via [PR #2462](https://github.com/strawberry-graphql/strawberry/pull/2462/)

0.154.0

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

Support constrained float field types in Pydantic models.

i.e.

python
import pydantic


class Model(pydantic.BaseModel):
field: pydantic.confloat(le=100.0)
equivalent_field: float = pydantic.Field(le=100.0)


Contributed by [Etienne Wodey](https://github.com/airwoodix) via [PR #2455](https://github.com/strawberry-graphql/strawberry/pull/2455/)

0.153.0

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

This change allows clients to define connectionParams when making Subscription requests similar to the way [Apollo-Server](https://www.apollographql.com/docs/apollo-server/data/subscriptions/#operation-context) does it.

With [Apollo-Client (React)](https://www.apollographql.com/docs/react/data/subscriptions/#5-authenticate-over-websocket-optional) as an example, define a Websocket Link:

import { GraphQLWsLink } from 'apollo/client/link/subscriptions';
import { createClient } from 'graphql-ws';

const wsLink = new GraphQLWsLink(createClient({
url: 'ws://localhost:4000/subscriptions',
connectionParams: {
authToken: user.authToken,
},
}));

and the JSON passed to `connectionParams` here will appear within Strawberry's context as the `connection_params` attribute when accessing `info.context` within a Subscription resolver.

Contributed by [Tommy Smith](https://github.com/tsmith023) via [PR #2380](https://github.com/strawberry-graphql/strawberry/pull/2380/)

0.152.0

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

This release adds support for updating (or adding) the query document inside an
extension's `on_request_start` method.

This can be useful for implementing persisted queries. The old behavior of
returning a 400 error if no query is present in the request is still supported.

Example usage:

python
from strawberry.extensions import Extension


def get_doc_id(request) -> str:
"""Implement this to get the document ID using your framework's request object"""
...


def load_persisted_query(doc_id: str) -> str:
"""Implement this load a query by document ID. For example, from a database."""
...


class PersistedQuery(Extension):
def on_request_start(self):
request = self.execution_context.context.request

doc_id = get_doc_id(request)

self.execution_context.query = load_persisted_query(doc_id)


Contributed by [James Thorniley](https://github.com/jthorniley) via [PR #2431](https://github.com/strawberry-graphql/strawberry/pull/2431/)

0.151.3

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

0.151.2

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

This release fixes `strawberry.experimental.pydantic.type` and adds support for the metadata attribute on fields.

Example:
python
strawberry.experimental.pydantic.type(model=User)
class UserType:
private: strawberry.auto = strawberry.field(metadata={"admin_only": True})
public: strawberry.auto


Contributed by [Huy Z](https://github.com/huyz) via [PR #2415](https://github.com/strawberry-graphql/strawberry/pull/2415/)

Page 49 of 133

Links

Releases

Has known vulnerabilities

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.