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 54 of 119

0.111.1

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

Rename internal variable `custom_getter` in FastAPI router implementation.

Contributed by [Gary Donovan](https://github.com/garyd203) via [PR #1875](https://github.com/strawberry-graphql/strawberry/pull/1875/)

0.111.0

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

This release adds support for Apollo Federation 2 directives:
- shareable
- tag
- override
- inaccessible

This release does **not** add support for the link directive.

This release updates the key directive to align with Apollo Federation 2 updates.

See the below code snippet and/or the newly-added test cases for examples on how to use the new directives.
The below snippet demonstrates the override directive.
python
import strawberry
from typing import List


strawberry.interface
class SomeInterface:
id: strawberry.ID


strawberry.federation.type(keys=["upc"], extend=True)
class Product(SomeInterface):
upc: str = strawberry.federation.field(external=True, override=["mySubGraph"])


strawberry.federation.type
class Query:
strawberry.field
def top_products(self, first: int) -> List[Product]:
return []


schema = strawberry.federation.Schema(query=Query)


should return:

graphql
extend type Product implements SomeInterface key(fields: "upc", resolvable: "True") {
id: ID!
upc: String! external override(from: "mySubGraph")
}

type Query {
_service: _Service!
_entities(representations: [_Any!]!): [_Entity]!
topProducts(first: Int!): [Product!]!
}

interface SomeInterface {
id: ID!
}

scalar _Any

union _Entity = Product

type _Service {
sdl: String!
}


Contributed by [Matt Skillman](https://github.com/mtskillman) via [PR #1874](https://github.com/strawberry-graphql/strawberry/pull/1874/)

0.110.0

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

This release adds support for passing a custom name to schema directives fields,
by using `strawberry.directive_field`.

python
import strawberry


strawberry.schema_directive(locations=[Location.FIELD_DEFINITION])
class Sensitive:
reason: str = strawberry.directive_field(name="as")
real_age_2: str = strawberry.directive_field(name="real_age")


strawberry.type
class Query:
first_name: str = strawberry.field(
directives=[Sensitive(reason="GDPR", real_age_2="42")]
)


should return:

graphql
type Query {
firstName: String! sensitive(as: "GDPR", real_age: "42")
}


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

0.109.1

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

0.109.0

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

Changed the location of `UNSET` from `arguments.py` to `unset.py`. `UNSET` can now also be imported directly from `strawberry`. Deprecated the `is_unset` method in favor of the builtin `is` operator:

python
from strawberry import UNSET
from strawberry.arguments import is_unset old

a = UNSET

assert a is UNSET new
assert is_unset(a) old

Further more a new subsection to the docs was added explaining this.

Contributed by [Dominique Garmier](https://github.com/DominiqueGarmier) via [PR #1813](https://github.com/strawberry-graphql/strawberry/pull/1813/)

0.108.3

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

Fixes a bug when converting pydantic models with NewTypes in a List.
This no longers causes an exception.

python
from typing import List, NewType
from pydantic import BaseModel
import strawberry

password = NewType("password", str)


class User(BaseModel):
passwords: List[password]


strawberry.experimental.pydantic.type(User)
class UserType:
passwords: strawberry.auto


Contributed by [James Chua](https://github.com/thejaminator) via [PR #1770](https://github.com/strawberry-graphql/strawberry/pull/1770/)

Page 54 of 119

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.