Skip to content

Releases: strawberry-graphql/strawberry

🍓 0.273.1

15 Jun 00:26

Choose a tag to compare

This release fixes that the Chalice HTTP view integration did not set
appropriate content-type headers for responses, as it's recommended by the
GraphQL over HTTP specification.

Releases contributed by @DoctorJohn via #3904

🍓 0.273.0

10 Jun 14:32

Choose a tag to compare

Starting with this release, Strawberry will throw an error if one of your input
types tries to inherit from one or more interfaces. This new error enforces the
GraphQL specification that input types cannot implement interfaces.

The following code, for example, will now throw an error:

import strawberry


@strawberry.interface
class SomeInterface:
    some_field: str


@strawberry.input
class SomeInput(SomeInterface):
    another_field: int

Releases contributed by @scratchmex via #1254

🍓 0.272.1

10 Jun 08:58

Choose a tag to compare

This release modifies export-schema cli to include an EOF newline if --output option is provided. This allows better review in github.com for the generated schema files.

Releases contributed by @yunkaiz via #3896

🍓 0.272.0

10 Jun 08:53

Choose a tag to compare

This release features a dedicated extension to disable introspection queries.
Disabling introspection queries was already possible using the
AddValidationRules extension. However, using this new extension requires fewer
steps and makes the feature more discoverable.

Usage example:

import strawberry
from strawberry.extensions import DisableIntrospection


@strawberry.type
class Query:
    @strawberry.field
    def hello(self) -> str:
        return "Hello, world!"


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

Releases contributed by @DoctorJohn via #3895

🍓 0.271.2

09 Jun 20:23

Choose a tag to compare

This release fixes an AttributeError that occurred when a fragment and an OperationDefinitionNode shared the same name, and the fragment appeared first in the document.

The following example will now work as expected:

fragment UserAgent on UserAgentType {
  id
}

query UserAgent {
  userAgent {
    ...UserAgent
  }
}

Releases contributed by @pre-commit-ci[bot] via #3893

🍓 0.271.1

07 Jun 10:48

Choose a tag to compare

This Release contains fix of enum value was not working in generic container in lazy union.

Releases contributed by @benzolium via #3883

🍓 0.271.0

04 Jun 21:20

Choose a tag to compare

Added a new configuration option _unsafe_disable_same_type_validation that allows disabling the same type validation check in the schema converter. This is useful in cases where you need to have multiple type definitions with the same name in your schema.

Example:

@strawberry.type(name="DuplicatedType")
class A:
    a: int


@strawberry.type(name="DuplicatedType")
class B:
    b: int


schema = strawberry.Schema(
    query=Query,
    types=[A, B],
    config=strawberry.StrawberryConfig(_unsafe_disable_same_type_validation=True),
)

Note: This is an unsafe option and should be used with caution as it bypasses a safety check in the schema converter.

Releases contributed by @narmatov-asylbek via #3887

🍓 0.270.6

04 Jun 17:40

Choose a tag to compare

This release fixes that the create_type tool asked users to pass a name for
fields without resolvers even when a name was already provided.

The following code now works as expected:

import strawberry
from strawberry.tools import create_type

first_name = strawberry.field(name="firstName")
Query = create_type(f"Query", [first_name])

Releases contributed by @DoctorJohn via #3885

🍓 0.270.5

01 Jun 23:41

Choose a tag to compare

In this release, we improved some GraphQL over WS error messages. More precise
error messages are now returned if Strawberry fails to find an operation in the
query document.

Releases contributed by @DoctorJohn via #3869

🍓 0.270.4

29 May 10:40

Choose a tag to compare

This release fixes that the Strawberry debug server no longer supported
WebSockets out of the box.

Releases contributed by @DoctorJohn via #3872