Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Update dependency strawberry-graphql to ^0.132.0 #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Jun 2, 2022

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
strawberry-graphql (source) ^0.95.1 -> ^0.132.0 age adoption passing confidence

Release Notes

strawberry-graphql/strawberry

v0.132.1

Compare Source

Improve resolving performance by avoiding extra calls for basic fields.

This change improves performance of resolving a query by skipping Info
creation and permission checking for fields that don't have a resolver
or permission classes. In local benchmarks it improves performance of large
results by ~14%.

Contributed by Jonathan Kim via PR #​2194

v0.132.0

Compare Source

Support storing metadata in strawberry fields.

Contributed by Paulo Costa via PR #​2190

v0.131.5

Compare Source

Fixes false positives with the mypy plugin.
Happened when to_pydantic was called on a type that was converted
pydantic with all_fields=True.

Also fixes the type signature when to_pydantic is defined by the user.

from pydantic import BaseModel
from typing import Optional
import strawberry

class MyModel(BaseModel):
    email: str
    password: Optional[str]

@​strawberry.experimental.pydantic.input(model=MyModel, all_fields=True)
class MyModelStrawberry:
    ...

MyModelStrawberry(email="").to_pydantic()

v0.131.4

Compare Source

This release updates the mypy plugin and the typing for Pyright to treat all
strawberry fields as keyword-only arguments. This reflects a previous change to
the Strawberry API.

Contributed by Paulo Costa via PR #​2191

v0.131.3

Compare Source

Bug fix: Do not force kw-only=False in fields specified with strawberry.field()

Contributed by Paulo Costa via PR #​2189

v0.131.2

Compare Source

This release fixes a small issue that might happen when
uploading files and not passing the operations object.

Contributed by Patrick Arminio via PR #​2192

v0.131.1

Compare Source

Fix warnings during unit tests for Sanic's upload.

Otherwise running unit tests results in a bunch of warning like this:

DeprecationWarning: Use 'content=<...>' to upload raw bytes/text content.

Contributed by Paulo Costa via PR #​2178

v0.131.0

Compare Source

This release improves the dataloader class with new features:

  • Explicitly cache invalidation, prevents old data from being fetched after a mutation
  • Importing data into the cache, prevents unnecessary load calls if the data has already been fetched by other means.

Contributed by Paulo Costa via PR #​2149

v0.130.4

Compare Source

This release adds improved support for Pyright and Pylance, VSCode default
language server for Python.

Using strawberry.type, strawberry.field, strawberry.input and
strawberry.enum will now be correctly recognized by Pyright and Pylance and
won't show errors.

Contributed by Patrick Arminio via PR #​2172

v0.130.3

Compare Source

Fix invalid deprecation warning issued on arguments annotated
by a subclassed strawberry.types.Info.

Thanks to @​ThirVondukr for the bug report!

Example:

class MyInfo(Info)
    pass

@&#8203;strawberry.type
class Query:

    @&#8203;strawberry.field
    def is_tasty(self, info: MyInfo) -> bool:
        """Subclassed ``info`` argument no longer raises deprecation warning."""

Contributed by San Kilkis via PR #​2137

v0.130.2

Compare Source

This release fixes the conversion of generic aliases when
using pydantic.

Contributed by Silas Sewell via PR #​2152

v0.130.1

Compare Source

Fix version parsing issue related to dev builds of Mypy in strawberry.ext.mypy_plugin

Contributed by San Kilkis via PR #​2157

v0.130.0

Compare Source

Convert Tuple and Sequence types to GraphQL list types.

Example:

from collections.abc import Sequence
from typing import Tuple

@&#8203;strawberry.type
class User:
    pets: Sequence[Pet]
    favourite_ice_cream_flavours: Tuple[IceCreamFlavour]

Contributed by Jonathan Kim via PR #​2164

v0.129.0

Compare Source

This release adds strawberry.lazy which allows you to define the type of the
field and its path. This is useful when you want to define a field with a type
that has a circular dependency.

For example, let's say we have a User type that has a list of Post and a
Post type that has a User:

v0.128.0

Compare Source

This release changes how dataclasses are created to make use of the new
kw_only argument in Python 3.10 so that fields without a default value can now
follow a field with a default value. This feature is also backported to all other
supported Python versions.

More info: https://docs.python.org/3/library/dataclasses.html#dataclasses.dataclass

For example:

v0.127.4

Compare Source

This release fixes a bug in the subscription clean up when subscribing using the
graphql-transport-ws protocol, which could occasionally cause a 'finally'
statement within the task to not get run, leading to leaked resources.

Contributed by rjwills28 via PR #​2141

v0.127.3

Compare Source

This release fixes a couple of small styling issues with
the GraphiQL explorer

Contributed by Patrick Arminio via PR #​2143

v0.127.2

Compare Source

This release adds support for passing schema directives to
Schema(..., types=[]). This can be useful if using a built-inschema directive
that's not supported by a gateway.

For example the following:

import strawberry
from strawberry.scalars import JSON
from strawberry.schema_directive import Location

@&#8203;strawberry.type
class Query:
    example: JSON

@&#8203;strawberry.schema_directive(locations=[Location.SCALAR], name="specifiedBy")
class SpecifiedBy:
    name: str

schema = strawberry.Schema(query=Query, types=[SpecifiedBy])

will print the following SDL:

directive @&#8203;specifiedBy(name: String!) on SCALAR

"""
The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
"""
scalar JSON
  @&#8203;specifiedBy(
    url: "http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf"
  )

type Query {
  example: JSON!
}

Contributed by Patrick Arminio via PR #​2140

v0.127.1

Compare Source

This release fixes an issue with the updated GraphiQL
interface.

Contributed by Doctor via PR #​2138

v0.127.0

Compare Source

This release updates the built-in GraphiQL version to version 2.0,
which means you can now enjoy all the new features that come with the latest version!

Contributed by Matt Exact via PR #​1889

v0.126.2

Compare Source

This release restricts the backports.cached_property dependency to only be
installed when Python < 3.8. Since version 3.8 cached_property is included
in the builtin functools. The code is updated to use the builtin version
when Python >= 3.8.

Contributed by ljnsn via PR #​2114

v0.126.1

Compare Source

Keep extra discovered types sorted so that each schema printing is
always the same.

Contributed by Thiago Bellini Ribeiro via PR #​2115

v0.126.0

Compare Source

This release adds support for adding descriptions to enum values.

Example
@&#8203;strawberry.enum
class IceCreamFlavour(Enum):
    VANILLA = strawberry.enum_value("vanilla")
    STRAWBERRY = strawberry.enum_value(
        "strawberry", description="Our favourite",
    )
    CHOCOLATE = "chocolate"

@&#8203;strawberry.type
class Query:
    favorite_ice_cream: IceCreamFlavour = IceCreamFlavour.STRAWBERRY

schema = strawberry.Schema(query=Query)

This produces the following schema

enum IceCreamFlavour {
  VANILLA

  """Our favourite."""
  STRAWBERRY
  CHOCOLATE
}

type Query {
  favoriteIceCream: IceCreamFlavour!
}

Contributed by Felipe Gonzalez via PR #​2106

v0.125.1

Compare Source

This release hides resolvable: True in @​keys directives
when using Apollo Federation 1, to preserve compatibility
with older Gateways.

Contributed by Patrick Arminio via PR #​2099

v0.125.0

Compare Source

This release adds an integration with Django Channels. The integration will
allow you to use GraphQL subscriptions via Django Channels.

Contributed by Dan Sloan via PR #​1407

v0.124.0

Compare Source

This release adds full support for Apollo Federation 2.0. To opt-in you need to
pass enable_federation_2=True to strawberry.federation.Schema, like in the
following example:

@&#8203;strawberry.federation.type(keys=["id"])
class User:
    id: strawberry.ID

@&#8203;strawberry.type
class Query:
    user: User

schema = strawberry.federation.Schema(query=Query, enable_federation_2=True)

This release also improves type checker support for the federation.

Contributed by Patrick Arminio via PR #​2047

v0.123.3

Compare Source

This release fixes a regression introduced in version 0.118.2 which was
preventing using circular dependencies in Strawberry django and Strawberry
django plus.

Contributed by Thiago Bellini Ribeiro via PR #​2062

v0.123.2

Compare Source

This release adds support for priting custom enums used only on
schema directives, for example the following schema:

@&#8203;strawberry.enum
class Reason(str, Enum):
    EXAMPLE = "example"

@&#8203;strawberry.schema_directive(locations=[Location.FIELD_DEFINITION])
class Sensitive:
    reason: Reason

@&#8203;strawberry.type
class Query:
    first_name: str = strawberry.field(
        directives=[Sensitive(reason=Reason.EXAMPLE)]
    )

prints the following:

directive @&#8203;sensitive(reason: Reason!) on FIELD_DEFINITION

type Query {
    firstName: String! @&#8203;sensitive(reason: EXAMPLE)
}

enum Reason {
    EXAMPLE
}

while previously it would omit the definition of the enum.

Contributed by Patrick Arminio via PR #​2059

v0.123.1

Compare Source

This release adds support for priting custom scalar used only on
schema directives, for example the following schema:

SensitiveConfiguration = strawberry.scalar(str, name="SensitiveConfiguration")

@&#8203;strawberry.schema_directive(locations=[Location.FIELD_DEFINITION])
class Sensitive:
    config: SensitiveConfiguration

@&#8203;strawberry.type
class Query:
    first_name: str = strawberry.field(directives=[Sensitive(config="Some config")])

prints the following:

directive @&#8203;sensitive(config: SensitiveConfiguration!) on FIELD_DEFINITION

type Query {
    firstName: String! @&#8203;sensitive(config: "Some config")
}

scalar SensitiveConfiguration

while previously it would omit the definition of the scalar.

Contributed by Patrick Arminio via PR #​2058

v0.123.0

Compare Source

This PR adds support for adding schema directives to the schema of
your GraphQL API. For printing the following schema:

@&#8203;strawberry.schema_directive(locations=[Location.SCHEMA])
class Tag:
    name: str

@&#8203;strawberry.type
class Query:
    first_name: str = strawberry.field(directives=[Tag(name="team-1")])

schema = strawberry.Schema(query=Query, schema_directives=[Tag(name="team-1")])

will print the following:

directive @&#8203;tag(name: String!) on SCHEMA

schema @&#8203;tag(name: "team-1") {
    query: Query
}

type Query {
    firstName: String!
}
"""

Contributed by Patrick Arminio via PR #​2054

v0.122.1

Compare Source

This release fixes that the AIOHTTP integration ignored the operationName of query
operations. This behaviour is a regression introduced in version 0.107.0.

Contributed by Jonathan Ehwald via PR #​2055

v0.122.0

Compare Source

This release adds support for printing default values for scalars like JSON.

For example the following:

import strawberry
from strawberry.scalars import JSON

@&#8203;strawberry.input
class MyInput:
    j: JSON = strawberry.field(default_factory=dict)
    j2: JSON = strawberry.field(default_factory=lambda: {"hello": "world"})

will print the following schema:

input MyInput {
    j: JSON! = {}
    j2: JSON! = {hello: "world"}
}

Contributed by Patrick Arminio via PR #​2048

v0.121.1

Compare Source

This release adds a backward compatibility layer with libraries
that specify a custom get_result.

Contributed by Patrick Arminio via PR #​2038

v0.121.0

Compare Source

This release adds support for overriding the default resolver for fields.

Currently the default resolver is getattr, but now you can change it to any
function you like, for example you can allow returning dictionaries:

@&#8203;strawberry.type
class User:
    name: str

@&#8203;strawberry.type
class Query:
    @&#8203;strawberry.field
    def user(self) -> User:
        return {"name": "Patrick"}  # type: ignore

schema = strawberry.Schema(
    query=Query,
    config=StrawberryConfig(default_resolver=getitem),
)

query = "{ user { name } }"

result = schema.execute_sync(query)

Contributed by Patrick Arminio via PR #​2037

v0.120.0

Compare Source

This release add a new DatadogTracingExtension that can be used to instrument
your application with Datadog.

import strawberry

from strawberry.extensions.tracing import DatadogTracingExtension

schema = strawberry.Schema(
    Query,
    extensions=[
        DatadogTracingExtension,
    ]
)

Contributed by Patrick Arminio via PR #​2001

v0.119.2

Compare Source

Fixed edge case where Union types raised an UnallowedReturnTypeForUnion
error when returning the correct type from the resolver. This also improves
performance of StrawberryUnion's _resolve_union_type from O(n) to O(1) in
the majority of cases where n is the number of types in the schema.

For
example the below)
would previously raise the error when querying two as StrawberryUnion would
incorrectly determine that the resolver returns Container[TypeOne].

import strawberry
from typing import TypeVar, Generic, Union, List, Type

T = TypeVar("T")

@&#8203;strawberry.type
class Container(Generic[T]):
    items: List[T]

@&#8203;strawberry.type
class TypeOne:
    attr: str

@&#8203;strawberry.type
class TypeTwo:
    attr: str

def resolver_one():
    return Container(items=[TypeOne("one")])

def resolver_two():
    return Container(items=[TypeTwo("two")])

@&#8203;strawberry.type
class Query:
    one: Union[Container[TypeOne], TypeOne] = strawberry.field(resolver_one)
    two: Union[Container[TypeTwo], TypeTwo] = strawberry.field(resolver_two)

schema = strawberry.Schema(query=Query)

Contributed by Tim OSullivan via PR #​2029

v0.119.1

Compare Source

An explanatory custom exception is raised when union of GraphQL input types is attempted.

Contributed by Dhanshree Arora via PR #​2019

v0.119.0

Compare Source

This release changes when we add the custom directives extension, previously
the extension was always enabled, now it is only enabled if you pass custom
directives to strawberry.Schema.

Contributed by bomtall via PR #​2020

v0.118.2

Compare Source

This release adds an initial fix to make strawberry.auto work when using
from __future__ import annotations.

Contributed by Patrick Arminio via PR #​1994

v0.118.1

Compare Source

Fixes issue where users without pydantic were not able to use the mypy plugin.

Contributed by James Chua via PR #​2016

v0.118.0

Compare Source

You can now pass keyword arguments to to_pydantic

from pydantic import BaseModel
import strawberry

class MyModel(BaseModel):
   email: str
   password: str

@&#8203;strawberry.experimental.pydantic.input(model=MyModel)
class MyModelStrawberry:
   email: strawberry.auto

v0.117.1

Compare Source

Allow to add alias to fields generated from pydantic with strawberry.field(name="ageAlias").

class User(pydantic.BaseModel):
    age: int

@&#8203;strawberry.experimental.pydantic.type(User)
class UserType:
    age: strawberry.auto = strawberry.field(name="ageAlias")

Contributed by Alex via PR #​1986

v0.117.0

Compare Source

This release fixes an issue that required installing opentelemetry when
trying to use the ApolloTracing extension

Contributed by Patrick Arminio via PR #​1977

v0.116.4

Compare Source

Fix regression caused by the new resolver argument handling mechanism
introduced in v0.115.0. This release restores the ability to use unhashable
default values in resolvers such as dict and list. See example below:

@&#8203;strawberry.type
class Query:
    @&#8203;strawberry.field
    def field(
        self, x: List[str] = ["foo"], y: JSON = {"foo": 42}  # noqa: B006
    ) -> str:
        return f"{x} {y}"

Thanks to @​coady for the regression report!

Contributed by San Kilkis via PR #​1985

v0.116.3

Compare Source

This release fixes the following error when trying to use Strawberry
with Apollo Federation:

Error: A valid schema couldn't be composed. The following composition errors were found:
	[burro-api] Unknown type _FieldSet

Contributed by Patrick Arminio via PR #​1988

v0.116.2

Compare Source

Reimplement StrawberryResolver.annotations property after removal in v0.115.

Library authors who previously relied on the public annotations property
can continue to do so after this fix.

Contributed by San Kilkis via PR #​1990

v0.116.1

Compare Source

This release fixes a breaking internal error in mypy plugin for the following case.

  • using positional arguments to pass a resolver for strawberry.field() or strawberry.mutation()
failed: str = strawberry.field(resolver)
successed: str = strawberry.field(resolver=resolver)

now mypy returns an error with "field()" or "mutation()" only takes keyword arguments message
rather than an internal error.

Contributed by cake-monotone via PR #​1987

v0.116.0

Compare Source

This release adds a link from generated GraphQLCore types to the Strawberry type
that generated them.

From a GraphQLCore type you can now access the Strawberry type by doing:

strawberry_type: TypeDefinition = graphql_core_type.extensions[GraphQLCoreConverter.DEFINITION_BACKREF]

Contributed by Paulo Costa via PR #​1766

v0.115.0

Compare Source

This release changes how we declare the info argument in resolvers and the
value argument in directives.

Previously we'd use the name of the argument to determine its value. Now we use
the type annotation of the argument to determine its value.

Here's an example of how the old syntax works:

def some_resolver(info) -> str:
    return info.context.get("some_key", "default")

@&#8203;strawberry.type
class Example:
    a_field: str = strawberry.resolver(some_resolver)

and here's an example of how the new syntax works:

from strawberry.types import Info

def some_resolver(info: Info) -> str:
    return info.context.get("some_key", "default")

@&#8203;strawberry.type
class Example:
    a_field: str = strawberry.resolver(some_resolver)

This means that you can now use a different name for the info argument in your
resolver and the value argument in your directive.

Here's an example that uses a custom name for both the value and the info
parameter in directives:

from strawberry.types import Info
from strawberry.directive import DirectiveLocation, DirectiveValue

@&#8203;strawberry.type
class Cake:
    frosting: Optional[str] = None
    flavor: str = "Chocolate"

@&#8203;strawberry.type
class Query:
    @&#8203;strawberry.field
    def cake(self) -> Cake:
        return Cake()

@&#8203;strawberry.directive(
    locations=[DirectiveLocation.FIELD],
    description="Add frosting with ``value`` to a cake.",
)
def add_frosting(value: str, v: DirectiveValue[Cake], my_info: Info):

### Arbitrary argument name when using `DirectiveValue` is supported!
    assert isinstance(v, Cake)
    if value in my_info.context["allergies"]:  # Info can now be accessed from directives!
        raise AllergyError("You are allergic to this frosting!")
    else:
        v.frosting = value  # Value can now be used as a GraphQL argument name!
    return v

Note: the old way of passing arguments by name is deprecated and will be
removed in future releases of Strawberry.

Contributed by San Kilkis via PR #​1713

v0.114.7

Compare Source

Allow use of implicit Any in strawberry.Private annotated Generic types.

For example the following is now supported:

from __future__ import annotations

from typing import Generic, Sequence, TypeVar

import strawberry

T = TypeVar("T")

@&#8203;strawberry.type
class Foo(Generic[T]):

    private_field: strawberry.Private[Sequence]  # instead of Sequence[Any]

@&#8203;strawberry.type
class Query:
    @&#8203;strawberry.field
    def foo(self) -> Foo[str]:
        return Foo(private_field=[1, 2, 3])

See Issue #​1938
for details.

Contributed by San Kilkis via PR #​1939

v0.114.6

Compare Source

The federation decorator now allows for a list of additional arbitrary schema
directives extending the key/shareable directives used for federation.

Example Python:

import strawberry
from strawberry.schema.config import StrawberryConfig
from strawberry.schema_directive import Location

@&#8203;strawberry.schema_directive(locations=[Location.OBJECT])
class CacheControl:
    max_age: int

@&#8203;strawberry.federation.type(
    keys=["id"], shareable=True, extend=True, directives=[CacheControl(max_age=42)]
)
class FederatedType:
    id: strawberry.ID

schema = strawberry.Schema(
    query=Query, config=StrawberryConfig(auto_camel_case=False)
)

Resulting GQL Schema:

directive @&#8203;CacheControl(max_age: Int!) on OBJECT
directive @&#8203;key(fields: _FieldSet!, resolvable: Boolean) on OBJECT | INTERFACE
directive @&#8203;shareable on FIELD_DEFINITION | OBJECT

extend type FederatedType
  @&#8203;key(fields: "id")
  @&#8203;shareable
  @&#8203;CacheControl(max_age: 42) {
  id: ID!
}

type Query {
  federatedType: FederatedType!
}

Contributed by Jeffrey DeFond via PR #​1945

v0.114.5

Compare Source

This release adds support in Mypy for using strawberry.mutation
while passing a resolver, the following now doesn't make Mypy return
an error:

import strawberry

def set_name(self, name: str) -> None:
    self.name = name

@&#8203;strawberry.type
class Mutation:
    set_name: None = strawberry.mutation(resolver=set_name)

Contributed by Etty via PR #​1966

v0.114.4

Compare Source

This release fixes the type annotation of Response.errors used in the GraphQLTestClient to be a List of GraphQLFormattedError.

Contributed by Etty via PR #​1961

v0.114.3

Compare Source

This release fixes the type annotation of Response.errors used in the GraphQLTestClient to be a List of GraphQLError.

Contributed by Etty via PR #​1959

v0.114.2

Compare Source

This release fixes an issue in the GraphQLTestClient when using both variables and files together.

Contributed by Etty via PR #​1576

v0.114.1

Compare Source

Fix crash in Django's HttpResponse.__repr__ by handling status_code=None in TemporalHttpResponse.__repr__.

Contributed by Daniel Hahler via PR #​1950

v0.114.0

Compare Source

Improve schema directives typing and printing after latest refactor.

  • Support for printing schema directives for non-scalars (e.g. types) and null values.
  • Also print the schema directive itself and any extra types defined in it
  • Fix typing for apis expecting directives (e.g. strawberry.field, strawberry.type, etc)
    to expect an object instead of a StrawberrySchemaDirective, which is now an internal type.

Contributed by Thiago Bellini Ribeiro via PR #​1723

v0.113.0

Compare Source

This release adds support for Starlette 0.18 to 0.20

It also removes upper bound dependencies limit for starlette,
allowing you to install the latest version without having to
wait for a new release of Strawberry

Contributed by Timothy Pansino via PR #​1594

v0.112.0

Compare Source

This release adds a new flask view to allow for aysnc dispatching of requests.

This is especially useful when using dataloaders with flask.

from strawberry.flask.views import AsyncGraphQLView

...

app.add_url_rule("/graphql", view_func=AsyncGraphQLView.as_view("graphql_view", schema=schema, **kwargs))

Contributed by Scott Weitzner via PR #​1907

v0.111.2

Compare Source

This release fixes resolvers using functions with generic type variables raising a MissingTypesForGenericError error.

For example a resolver factory like the below can now be used:

import strawberry
from typing import Type, TypeVar

T = TypeVar("T")  # or TypeVar("T", bound=StrawberryType) etc

def resolver_factory(strawberry_type: Type[T]):
    def resolver(id: strawberry.ID) -> T:

### some actual logic here
        return strawberry_type(...)

    return resolver

Contributed by Tim OSullivan via PR #​1891

v0.111.1

Compare Source

Rename internal variable custom_getter in FastAPI router implementation.

Contributed by Gary Donovan via PR #​1875

v0.111.0

Compare Source

This release adds support for Apollo Federation 2 directives:

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.

import strawberry
from typing import List

@&#8203;strawberry.interface
class SomeInterface:
    id: strawberry.ID

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

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

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

should return:

extend type Product implements SomeInterface @&#8203;key(fields: "upc", resolvable: "True") {
  id: ID!
  upc: String! @&#8203;external @&#8203;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 via PR #​1874

v0.110.0

Compare Source

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

import strawberry

@&#8203;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")

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

should return:

type Query {
    firstName: String! @&#8203;sensitive(as: "GDPR", real_age: "42")
}

Contributed by Patrick Arminio via PR #​1871

v0.109.1

Compare Source

This release adds support for Mypy 0.950

Contributed by dependabot via PR #​1855

v0.109.0

Compare Source

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:

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 via PR #​1813

v0.108.3

Compare Source

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

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

password = NewType("password", str)

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

@&#8203;strawberry.experimental.pydantic.type(User)
class UserType:
   passwords: strawberry.auto

Contributed by James Chua via PR #​1770

v0.108.2

Compare Source

Fixes mypy type inference when using @​strawberry.experimental.pydantic.input
and @​strawberry.experimental.pydantic.interface decorators

Contributed by James Chua via PR #​1832

v0.108.1

Compare Source

Refactoring: Move enum deserialization logic from convert_arguments to CustomGraphQLEnumType

Contributed by Paulo Costa via PR #​1765

v0.108.0

Compare Source

Added support for deprecating Enum values with deprecation_reason while using strawberry.enum_value instead of string definition.

@&#8203;strawberry.enum
class IceCreamFlavour(Enum):
    VANILLA = strawberry.enum_value("vanilla")
    STRAWBERRY = strawberry.enum_value(
        "strawberry", deprecation_reason="We ran out"
    )
    CHOCOLATE = "chocolate"

Contributed by Mateusz Sobas via PR #​1720

v0.107.1

Compare Source

This release fixes an issue in the previous release where requests using query params did not support passing variable values. Variables passed by query params are now parsed from a string to a dictionary.

Contributed by Matt Exact via PR #​1820

v0.107.0

Compare Source

This release adds support in all our integration for queries via GET requests.
This behavior is enabled by default, but you can disable it by passing
allow_queries_via_get=False to the constructor of the integration of your
choice.

For security reason only queries are allowed via GET requests.

Contributed by Matt Exact via PR #​1686

v0.106.3

Compare Source

Correctly parse Decimal scalar types to avoid floating point errors

Contributed by Marco Acierno via PR #​1811

v0.106.2

Compare Source

Allow all data types in Schema(types=[...])

Contributed by Paulo Costa via PR #​1714

v0.106.1

Compare Source

This release fixes a number of problems with single-result-operations over
graphql-transport-ws protocol

  • operation IDs now share the same namespace as streaming operations
    meaning that they cannot be reused while the others are in operation

  • single-result-operations now run as tasks meaning that messages related
    to them can be overlapped with other messages on the websocket.

  • single-result-operations can be cancelled with the complete message.

  • IDs for single result and streaming result operations are now released
    once the operation is done, allowing them to be re-used later, as well as
    freeing up resources related to previous requests.

Contributed by Kristján Valur Jónsson via PR #​1792

v0.106.0

Compare Source

This release adds an implementation of the GraphQLTestClient for the aiohttp integration (in addition to the existing asgi and Django support). It hides the HTTP request's details and verifies that there are no errors in the response (this behavior can be disabled 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

import pytest

from strawberry.aiohttp.test.client import GraphQLTestClient

@&#8203;pytest.fixture
def graphql_client(aiohttp_client, myapp):
    yield GraphQLTestClient(aiohttp_client(myapp))

And use it everywhere in your tests

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

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

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

Contributed by Etty via PR #​1604

v0.105.1

Compare Source

This release fixes a bug in the codegen that marked optional unions
as non optional.

Contributed by Patrick Arminio via PR #​1806

v0.105.0

Compare Source

This release adds support for passing json_encoder and json_dumps_params to Sanic's view.

from strawberry.sanic.views import GraphQLView

from api.schema import Schema

app = Sanic(__name__)

app.add_route(
    GraphQLView.as_view(
        schema=schema,
        graphiql=True,
        json_encoder=CustomEncoder,
        json_dumps_params={},
    ),
    "/graphql",
)

Contributed by Patrick Arminio via PR #​1797

v0.104.4

Compare Source

Allow use of AsyncIterator and AsyncIterable generics to annotate return
type of subscription resolvers.

Contributed by San Kilkis via PR #​1771

v0.104.3

Compare Source

Exeptions from handler functions in graphql_transport_ws are no longer
incorrectly caught and classified as message parsing errors.

Contributed by Kristján Valur Jónsson via PR #​1761

v0.104.2

Compare Source

Drop support for Django < 3.2.

Contributed by Guillaume Andreu Sabater via PR #​1787

v0.104.1

Compare Source

This release adds support for aliased fields when doing codegen.

Contributed by Patrick Arminio via PR #​1772

v0.104.0

Compare Source

Add is_auto utility for checking if a type is strawberry.auto,
considering the possibility of it being a StrawberryAnnotation or
even being used inside Annotated.

Contributed by Thiago Bellini Ribeiro via PR #​1721

v0.103.9

Compare Source

This release moves the console plugin for the codegen command
to be last one, allowing to run code before writing files to
disk.

Contributed by Patrick Arminio via PR #​1760

v0.103.8

Compare Source

This release adds a python_type to the codegen GraphQLEnum class
to allow access to the original python enum when generating code

Contributed by Patrick Arminio via [PR #​1752](https://togithub.com/strawberry


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, click this checkbox.

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/strawberry-graphql-0.x branch from 8f6aa9a to 559b5ae Compare July 1, 2022 23:15
@renovate renovate bot changed the title Update dependency strawberry-graphql to ^0.114.0 Update dependency strawberry-graphql to ^0.115.0 Jul 1, 2022
@renovate renovate bot force-pushed the renovate/strawberry-graphql-0.x branch from 559b5ae to d62c7f3 Compare July 3, 2022 17:10
@renovate renovate bot changed the title Update dependency strawberry-graphql to ^0.115.0 Update dependency strawberry-graphql to ^0.116.0 Jul 3, 2022
@renovate renovate bot force-pushed the renovate/strawberry-graphql-0.x branch from d62c7f3 to ad46599 Compare July 6, 2022 13:17
@renovate renovate bot changed the title Update dependency strawberry-graphql to ^0.116.0 Update dependency strawberry-graphql to ^0.117.0 Jul 6, 2022
@renovate renovate bot force-pushed the renovate/strawberry-graphql-0.x branch from ad46599 to add682a Compare July 13, 2022 17:36
@renovate renovate bot changed the title Update dependency strawberry-graphql to ^0.117.0 Update dependency strawberry-graphql to ^0.118.0 Jul 13, 2022
@renovate renovate bot force-pushed the renovate/strawberry-graphql-0.x branch from add682a to 840c02c Compare July 15, 2022 01:20
@renovate renovate bot changed the title Update dependency strawberry-graphql to ^0.118.0 Update dependency strawberry-graphql to ^0.119.0 Jul 15, 2022
@renovate renovate bot force-pushed the renovate/strawberry-graphql-0.x branch from 840c02c to 96ba196 Compare July 23, 2022 22:28
@renovate renovate bot changed the title Update dependency strawberry-graphql to ^0.119.0 Update dependency strawberry-graphql to ^0.121.0 Jul 23, 2022
@renovate renovate bot force-pushed the renovate/strawberry-graphql-0.x branch from 96ba196 to 4b18c44 Compare July 29, 2022 10:26
@renovate renovate bot changed the title Update dependency strawberry-graphql to ^0.121.0 Update dependency strawberry-graphql to ^0.122.0 Jul 29, 2022
@renovate renovate bot force-pushed the renovate/strawberry-graphql-0.x branch from 4b18c44 to c8f8e48 Compare August 1, 2022 17:44
@renovate renovate bot changed the title Update dependency strawberry-graphql to ^0.122.0 Update dependency strawberry-graphql to ^0.123.0 Aug 1, 2022
@renovate renovate bot force-pushed the renovate/strawberry-graphql-0.x branch from c8f8e48 to b30fa45 Compare September 25, 2022 23:17
@renovate renovate bot changed the title Update dependency strawberry-graphql to ^0.123.0 Update dependency strawberry-graphql to ^0.132.0 Sep 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants