%global _empty_manifest_terminate_build 0 Name: python-strawberry-graphql-django Version: 0.9.4 Release: 1 Summary: Strawberry GraphQL Django extension License: MIT URL: https://github.com/strawberry-graphql/strawberry-graphql-django Source0: https://mirrors.nju.edu.cn/pypi/web/packages/84/8d/02584438b57b9d8c0141a779dd091b2f10126fe1f369ea1852d45afa3eec/strawberry_graphql_django-0.9.4.tar.gz BuildArch: noarch Requires: python3-Django Requires: python3-strawberry-graphql Requires: python3-django-debug-toolbar %description # Strawberry GraphQL Django integration [![CI](https://github.com/la4de/strawberry-graphql-django/actions/workflows/main.yml/badge.svg)](https://github.com/la4de/strawberry-graphql-django/actions/workflows/main.yml) [![PyPI](https://img.shields.io/pypi/v/strawberry-graphql-django)](https://pypi.org/project/strawberry-graphql-django/) [![Downloads](https://pepy.tech/badge/strawberry-graphql-django)](https://pepy.tech/project/strawberry-graphql-django) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/strawberry-graphql-django) This package provides powerful tools to generate GraphQL types, queries, mutations and resolvers from Django models. Installing `strawberry-graphql-django` package from the python package repository. ```shell pip install strawberry-graphql-django ``` Full documentation is available under [docs](https://strawberry-graphql.github.io/strawberry-graphql-django/) github folder. * [x] GraphQL type generation from models * [x] Filtering, pagination and ordering * [x] Basic create, retrieve, update and delete (CRUD) types and mutations * [x] Basic Django auth support, current user query, login and logout mutations * [x] Django sync and async views * [x] Unit test integration ## Basic Usage ```python # models.py from django.db import models class Fruit(models.Model): """A tasty treat""" name = models.CharField(max_length=20) color = models.ForeignKey('Color', blank=True, null=True, related_name='fruits', on_delete=models.CASCADE) class Color(models.Model): name = models.CharField( max_length=20, help_text="field description", ) ``` ```python # types.py import strawberry from strawberry import auto from typing import List from . import models @strawberry.django.type(models.Fruit) class Fruit: id: auto name: auto color: 'Color' @strawberry.django.type(models.Color) class Color: id: auto name: auto fruits: List[Fruit] ``` ```python # schema.py import strawberry from typing import List from .types import Fruit @strawberry.type class Query: fruits: List[Fruit] = strawberry.django.field() schema = strawberry.Schema(query=Query) ``` Code above generates following schema. ```schema """ A tasty treat """ type Fruit { id: ID! name: String! color: Color } type Color { id: ID! """ field description """ name: String! fruits: [Fruit!] } type Query { fruits: [Fruit!]! } ``` ```python # urls.py from django.urls import include, path from strawberry.django.views import AsyncGraphQLView from .schema import schema urlpatterns = [ path('graphql', AsyncGraphQLView.as_view(schema=schema)), ] ``` %package -n python3-strawberry-graphql-django Summary: Strawberry GraphQL Django extension Provides: python-strawberry-graphql-django BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-strawberry-graphql-django # Strawberry GraphQL Django integration [![CI](https://github.com/la4de/strawberry-graphql-django/actions/workflows/main.yml/badge.svg)](https://github.com/la4de/strawberry-graphql-django/actions/workflows/main.yml) [![PyPI](https://img.shields.io/pypi/v/strawberry-graphql-django)](https://pypi.org/project/strawberry-graphql-django/) [![Downloads](https://pepy.tech/badge/strawberry-graphql-django)](https://pepy.tech/project/strawberry-graphql-django) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/strawberry-graphql-django) This package provides powerful tools to generate GraphQL types, queries, mutations and resolvers from Django models. Installing `strawberry-graphql-django` package from the python package repository. ```shell pip install strawberry-graphql-django ``` Full documentation is available under [docs](https://strawberry-graphql.github.io/strawberry-graphql-django/) github folder. * [x] GraphQL type generation from models * [x] Filtering, pagination and ordering * [x] Basic create, retrieve, update and delete (CRUD) types and mutations * [x] Basic Django auth support, current user query, login and logout mutations * [x] Django sync and async views * [x] Unit test integration ## Basic Usage ```python # models.py from django.db import models class Fruit(models.Model): """A tasty treat""" name = models.CharField(max_length=20) color = models.ForeignKey('Color', blank=True, null=True, related_name='fruits', on_delete=models.CASCADE) class Color(models.Model): name = models.CharField( max_length=20, help_text="field description", ) ``` ```python # types.py import strawberry from strawberry import auto from typing import List from . import models @strawberry.django.type(models.Fruit) class Fruit: id: auto name: auto color: 'Color' @strawberry.django.type(models.Color) class Color: id: auto name: auto fruits: List[Fruit] ``` ```python # schema.py import strawberry from typing import List from .types import Fruit @strawberry.type class Query: fruits: List[Fruit] = strawberry.django.field() schema = strawberry.Schema(query=Query) ``` Code above generates following schema. ```schema """ A tasty treat """ type Fruit { id: ID! name: String! color: Color } type Color { id: ID! """ field description """ name: String! fruits: [Fruit!] } type Query { fruits: [Fruit!]! } ``` ```python # urls.py from django.urls import include, path from strawberry.django.views import AsyncGraphQLView from .schema import schema urlpatterns = [ path('graphql', AsyncGraphQLView.as_view(schema=schema)), ] ``` %package help Summary: Development documents and examples for strawberry-graphql-django Provides: python3-strawberry-graphql-django-doc %description help # Strawberry GraphQL Django integration [![CI](https://github.com/la4de/strawberry-graphql-django/actions/workflows/main.yml/badge.svg)](https://github.com/la4de/strawberry-graphql-django/actions/workflows/main.yml) [![PyPI](https://img.shields.io/pypi/v/strawberry-graphql-django)](https://pypi.org/project/strawberry-graphql-django/) [![Downloads](https://pepy.tech/badge/strawberry-graphql-django)](https://pepy.tech/project/strawberry-graphql-django) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/strawberry-graphql-django) This package provides powerful tools to generate GraphQL types, queries, mutations and resolvers from Django models. Installing `strawberry-graphql-django` package from the python package repository. ```shell pip install strawberry-graphql-django ``` Full documentation is available under [docs](https://strawberry-graphql.github.io/strawberry-graphql-django/) github folder. * [x] GraphQL type generation from models * [x] Filtering, pagination and ordering * [x] Basic create, retrieve, update and delete (CRUD) types and mutations * [x] Basic Django auth support, current user query, login and logout mutations * [x] Django sync and async views * [x] Unit test integration ## Basic Usage ```python # models.py from django.db import models class Fruit(models.Model): """A tasty treat""" name = models.CharField(max_length=20) color = models.ForeignKey('Color', blank=True, null=True, related_name='fruits', on_delete=models.CASCADE) class Color(models.Model): name = models.CharField( max_length=20, help_text="field description", ) ``` ```python # types.py import strawberry from strawberry import auto from typing import List from . import models @strawberry.django.type(models.Fruit) class Fruit: id: auto name: auto color: 'Color' @strawberry.django.type(models.Color) class Color: id: auto name: auto fruits: List[Fruit] ``` ```python # schema.py import strawberry from typing import List from .types import Fruit @strawberry.type class Query: fruits: List[Fruit] = strawberry.django.field() schema = strawberry.Schema(query=Query) ``` Code above generates following schema. ```schema """ A tasty treat """ type Fruit { id: ID! name: String! color: Color } type Color { id: ID! """ field description """ name: String! fruits: [Fruit!] } type Query { fruits: [Fruit!]! } ``` ```python # urls.py from django.urls import include, path from strawberry.django.views import AsyncGraphQLView from .schema import schema urlpatterns = [ path('graphql', AsyncGraphQLView.as_view(schema=schema)), ] ``` %prep %autosetup -n strawberry-graphql-django-0.9.4 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-strawberry-graphql-django -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Mon May 15 2023 Python_Bot - 0.9.4-1 - Package Spec generated