Strawberry-graphql

Latest version: v0.235.0

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

Scan your dependencies

Page 100 of 122

0.42.3

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

This release type improves support for strawberry.field in mypy,
now we don't get `Attributes without a default cannot follow attributes with one`
when using strawberry.field before a type without a default.

0.42.2

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

Bugfix to allow the use of `UNSET` as a default value for arguments.

python
import strawberry
from strawberry.arguments import UNSET, is_unset


strawberry.type
class Query:
strawberry.field
def hello(self, name: Optional[str] = UNSET) -> str:
if is_unset(name):
return "Hi there"
return "Hi {name}"


schema = strawberry.Schema(query=Query)

result = schema.execute_async("{ hello }")
assert result.data == {"hello": "Hi there"}

result = schema.execute_async('{ hello(name: "Patrick" }')
assert result.data == {"hello": "Hi Patrick"}


SDL:

graphql
type Query {
hello(name: String): String!
}

0.42.1

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

This release improves mypy support for strawberry.field

0.42.0

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

* Completely revamped how resolvers are created, stored, and managed by
StrawberryField. Now instead of monkeypatching a `FieldDefinition` object onto
the resolver function itself, all resolvers are wrapped inside of a
`StrawberryResolver` object with the useful properties.
* `arguments.get_arguments_from_resolver` is now the
`StrawberryResolver.arguments` property
* Added a test to cover a situation where a field is added to a StrawberryType
manually using `dataclasses.field` but not annotated. This was previously
uncaught.

0.41.1

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

This release fixes an issue with forward types

0.41.0

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

This release adds a built-in dataloader. Example:

python
async def app():
async def idx(keys):
return keys

loader = DataLoader(load_fn=idx)

[value_a, value_b, value_c] = await asyncio.gather(
loader.load(1),
loader.load(2),
loader.load(3),
)

assert value_a == 1
assert value_b == 2
assert value_c == 3

Page 100 of 122

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.