strawberry-graphql / strawberry

A GraphQL library for Python that leverages type annotations 🍓
https://strawberry.rocks
MIT License
3.92k stars 516 forks source link

graphql_ide self hosting #3573

Open RenameMe1 opened 1 month ago

RenameMe1 commented 1 month ago

Hello, Tell me please, is it possible to self-host post the documentation the way it is done in FASTAPI (https://fastapi.tiangolo.com/how-to/custom-docs-ui-assets/?h=) ?

I can also give an example of replacing “make_graphiql_handler from starlette_graphene3” with “HTMLResponse(_CUSTOM_GRAPHIQL_HTML)”, where all URLs on the path to the files are changed to StaticFiles (https://fastapi.tiangolo.com/reference/staticfiles/?h=stat)

Our development environment is isolated, so access to "https://unpkg.com/*" is impossible.

Upvote & Fund

Fund with Polar

patrick91 commented 1 month ago

@RenameMe1 you can do this already, but we don't provide anything for that unfortunately, the implementation would depend on the framework you use.

I think we could add this if we had a nice way to integrate it with all frameworks

RenameMe1 commented 1 month ago

@patrick91 At the moment there is one way to self-host - change the URLs in https://github.com/strawberry-graphql/strawberry/blob/main/strawberry/static/graphiql.html?

patrick91 commented 1 month ago

@RenameMe1 yes, or implement a view that returns the html in your framework of choice 😊

maybe a middleground would be us writing some guides on how to do it 😊

RenameMe1 commented 1 month ago

@patrick91 Thanks for the help. I will try