Skip to main content

Graphene prisma

Brings prisma playground to graphene and more

Install

To install graphene_prisma, you need to specify one of the supported frameworks

pip install graphene_prisma[framework]

or

pip install graphene_prisma
pip install framework

Supported frameworks :

e.g. starlette

pip install graphene_prisma[starlette]

Usage

To use graphene_prisma

from graphene_prisma.[framework] import [GraphQLHandler]
  • [framework] : name of the framework (responder, starlette,...)
  • [GraphQLHandler]: name of the graphql view in your framework (GraphQLView for responder and GraphQLApp for starlette )

Here is a list of the graphql classes for each framework

framework GraphQL view
responder GraphQLView
starlette GraphQLApp

Starlette

from starlette.applications import Starlette
from graphene_prisma.starlette import GraphQLApp

class Query(graphene.ObjectType):
    hello = graphene.String(name=graphene.String(default_value="stranger"))

    def resolve_hello(self, info, name):
        return f"Hello {name}"

app = Starlette()
app.add_route('/', GraphQLApp(schema=graphene.Schema(query=Query)))

Responder

import responder
from graphene_prisma.responder import GraphQLView

api = responder.API()

class Query(graphene.ObjectType):
    hello = graphene.String(name=graphene.String(default_value="stranger"))

    def resolve_hello(self, info, name):
        return f"Hello {name}"

schema = graphene.Schema(query=Query)
view = GraphQLView(api=api, schema=schema)

api.add_route("/graph", view)
api.run()

TODO

  • Support other frameworks (django, flask,...)
  • Tests
  • Upload

Metadata

Release files for graphene-prisma 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphene-prisma 0.1.0
File Size Uploaded Provenance Actions
graphene-prisma-0.1.0.tar.gz 3.5 kB Without provenance Details for graphene-prisma-0.1.0.tar.gz

Release files / graphene-prisma-0.1.0.tar.gz

Download URL graphene-prisma-0.1.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5a2227a6c7a16b68318439f03596c0f0f3b4b28ddee597d645e79b69971f2b46
BLAKE2b-256 checksum
How to use checksums
d6cbd1fbc2ff789aa66e2afa1059d59b53921bb6b5fda488931e6f21e4e99164
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.7

Security for graphene-prisma 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page