Starlette: GraphQL support should be a third party application.

Created on 27 Aug 2019  ·  7Comments  ·  Source: encode/starlette

I'd like our graphql support to move out into being a third party package.

We should then document:

  • The third party package it's been moved to.
  • Links to ASGI implementations with ariadne, tartiflette, strawberry.

Questions:

  • Which of Ariadne, Tartiflette & Strawberry currently have provide an ASGI application, that Starlette can mount?
  • Are there any other GraphQL implementations I've missed here?
  • Anyone keen to take on the GraphQL implementation as a third party package?
graphql

Most helpful comment

strawberry asgi app:

​@​strawberry​.​field forever : 💗 !

Dead Link

Updated link is here: https://strawberry.rocks/docs/integrations/asgi ☺️

All 7 comments

strawberry asgi app:

​@​strawberry​.​field forever : 💗 !

Just commenting to add some updated links to libraries that can provide GraphQL support to Starlette applications. These will be in the Starlette documentation as well:

strawberry asgi app:

​@​strawberry​.​field forever : 💗 !

Dead Link

strawberry asgi app:

​@​strawberry​.​field forever : 💗 !

Dead Link

Updated link is here: https://strawberry.rocks/docs/integrations/asgi ☺️

How easy would it be to replace the existing solution with any of the suggested alternatives? It looks like the current solution is quite strongly coupled to graphene, or am I wrong?

The idea would be to output the schema as plain text or json to a third party library?

I would gladly see even over-simplified example to appear in the documentation because its not clear to me how everything is interacting. For example I can see in strawberry's case that:

The GraphQL app accepts two options at the moment:

  • schema: mandatory, the schema created by strawberry.Schema.

Seems like a problem since most people using starlette probably used graphene to generate their schema. I'm personally "stuck" with graphene as I used graphene-sqlalchemy, but maybe I missed a better option to interface my SQLAlchemy models with GraphQL.

I found an example in Ariadne's documentation: Starlette integration where they use the string version of the schema (aka type_defs). There is a discussion about this here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomchristie picture tomchristie  ·  3Comments

PeriGK picture PeriGK  ·  5Comments

tomchristie picture tomchristie  ·  5Comments

hyperknot picture hyperknot  ·  6Comments

jordic picture jordic  ·  4Comments