Releases: strawberry-graphql/strawberry
🍓 0.273.1
🍓 0.273.0
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: intReleases contributed by @scratchmex via #1254
🍓 0.272.1
🍓 0.272.0
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
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
🍓 0.271.0
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
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