A GraphQL library for Python that leverages type annotations 🍓
MIT License
Published by botberry over 4 years ago
Update version of graphql-core to 3.1.0b2
Published by botberry over 4 years ago
Added a Flask view that allows you to query the schema and interact with it via GraphQL playground.
Usage:
# app.py
from strawberry.flask.views import GraphQLView
from your_project.schema import schema
app = Flask(__name__)
app.add_url_rule(
"/graphql", view_func=GraphQLView.as_view("graphql_view", schema=schema)
)
if __name__ == "__main__":
app.run(debug=True)
Published by botberry over 4 years ago
Improve datetime, date and time types conversion. Removes aniso dependency
and also adds support for python types, so now we can do use python datetime's types
instead of our custom scalar types.
Published by botberry almost 5 years ago
This version adds support for Django 3.0
Published by botberry almost 5 years ago
Fix directives bugs:
Fix autogenerated return
argument bug
Fix include and skip failure bug
Published by botberry almost 5 years ago
This release improves support for permissions (it is a breaking change).
Now you will receive the source and the arguments in the has_permission
method,
so you can run more complex permission checks. It also allows to use permissions
on simple fields, here's an example:
import strawberry
from strawberry.permission import BasePermission
class IsAdmin(BasePermission):
message = "You are not authorized"
def has_permission(self, source, info):
return source.name.lower() == "Patrick" or _is_admin(info)
@strawberry.type
class User:
name: str
email: str = strawberry.field(permission_classes=[IsAdmin])
@strawberry.type
class Query:
@strawberry.field(permission_classes=[IsAdmin])
def user(self, info) -> str:
return User(name="Patrick", email="[email protected]")
Published by botberry almost 5 years ago
This releases removes support for async resolver in django
as they causes issues when accessing the databases.
Published by botberry almost 5 years ago
This release improves support for django and asgi integration.
It allows to use async resolvers when using django. It also changes the status
code from 400 to 200 even if there are errors this makes it possible to still
use other fields even if one raised an error.
We also moved strawberry.contrib.django to strawberry.django, so if you're using
the django view make sure you update the paths.
Published by botberry almost 5 years ago
Fix missing support for booleans when converting arguments
Published by botberry almost 5 years ago
This releases fixes an issue when converting complex input types,
now it should support lists of complex types properly.
Published by botberry almost 5 years ago
Set is_type_of
only when the type implements an interface,
this allows to return different (but compatibile) types in simple cases.
Published by botberry almost 5 years ago
Refactored CLI folder structure, importing click commands from a subfolder. Follows click's complex example.
Published by botberry almost 5 years ago
Add support for custom GraphQL scalars.
Published by botberry almost 5 years ago
Tests are now run on GitHub actions on both python 3.7 and python3.8 🐍
Published by botberry almost 5 years ago
Fixed some typos in contributing.md .
Published by botberry almost 5 years ago
Fixed some typos in readme.md and contributing.md.
Published by botberry almost 5 years ago
Minimal support for registering types without fields and abstract interface querying.
Published by botberry almost 5 years ago
Grammar fixes - changed 'corresponding tests, if tests' to 'corresponding tests. If tests' and removed extraneous period from 'Provide specific examples to demonstrate the steps..'. Also made 'Enhancement' lowercase to stay consistent with its usage in documentation and changed 'on the Strawberry' to 'to Strawberry'.
Published by botberry about 5 years ago
Added issue template files (bug_report.md, feature_request.md, other_issues.md) and a pull request template file.
Published by botberry about 5 years ago
Fix execution of async resolvers.