A GraphQL library for Python that leverages type annotations 🍓
MIT License
Published by botberry about 5 years ago
Typo fix - changed the spelling from 'follwing' to 'following'.
Published by botberry about 5 years ago
Updated docs to provide reference on how to use Django view.
Published by botberry about 5 years ago
Removed custom representation for Strawberry types,
this should make using types much nicer.
Published by botberry about 5 years ago
Switched from graphql-core-next
dependency to graphql-core@^3.0.0a0
.
Published by botberry about 5 years ago
Fixes MYPY plugin
Published by botberry about 5 years ago
Add the flake8-bugbear linting plugin to catch likely bugs
Published by botberry about 5 years ago
Fixed conversion of enum when value was falsy.
Published by botberry about 5 years ago
Fixed issue when trying to convert optional arguments to a type
Published by botberry about 5 years ago
Fix issue with converting arguments with optional fields.
Thanks to @sciyoshi for the fix!
Published by botberry about 5 years ago
Added a Django view that allows you to query the schema and interact with it via GraphQL playground.
Usage:
# Install
$ pip install strawberry-graphql[django]
# settings.py
INSTALLED_APPS = [
...
'strawberry.contrib.django',
]
# urls.py
from strawberry.contrib.django.views import GraphQLView
from your_project.schema import schema
urlpatterns = [
path('graphql/', GraphQLView.as_view(schema=schema)),
]
Published by botberry about 5 years ago
This release doesn't add any feature or fixes, but it fixes an issue with
checking for release files when submitting PRs ✨.
Published by botberry about 5 years ago
Fixes the conversion of Enums in resolvers, arguments and input types.
Published by botberry about 5 years ago
Add a mypy plugin that enables typechecking Strawberry types
Published by botberry about 5 years ago
Fix List types being converted to Optional GraphQL lists.
Published by botberry about 5 years ago
This release doesn't add any feature or fixes, it only introduces a GitHub
Action to let people know how to add a RELEASE.md file when submitting a PR.
Published by botberry about 5 years ago
Added support for defining query directives, example:
import strawberry
from strawberry.directives import DirectiveLocation
@strawberry.type
class Query:
cake: str = "made_in_switzerland"
@strawberry.directive(
locations=[DirectiveLocation.FIELD], description="Make string uppercase"
)
def uppercase(value: str, example: str):
return value.upper()
schema = strawberry.Schema(query=Query, directives=[uppercase])
Published by botberry about 5 years ago
Improve dict_to_type conversion by checking if the field has a different name or case
Published by botberry over 5 years ago
Fix field initialization not allowed when using strawberry.field
in an input
type
@strawberry.input
class Say:
what = strawberry.field(is_input=True)
Published by botberry over 5 years ago
Allow the usage of Union types in the mutations
@strawberry.type
class A:
x: int
@strawberry.type
class B:
y: int
@strawberry.type
class Mutation:
@strawberry.mutation
def hello(self, info) -> Union[A, B]:
return B(y=5)
schema = strawberry.Schema(query=A, mutation=Mutation)
query = """
mutation {
hello {
__typename
... on A {
x
}
... on B {
y
}
}
}
"""
Published by botberry over 5 years ago
Fix missing fields when extending a class, now we can do this:
@strawberry.type
class Parent:
cheese: str = "swiss"
@strawberry.field
def friend(self, info) -> str:
return 'food'
@strawberry.type
class Schema(Parent):
cake: str = "made_in_swiss"