与Django一起使用REST API的GraphQL包装器

发布于 2025-02-05 17:58:49 字数 305 浏览 5 评论 0原文

尝试使用Django GraphQl实现现有REST API的包装器。

在JS中发现了类似的,但在Django中没有发现。 https://graphql.org/blog/rest-api-api-graphql-wrapper/ < /a> 任何人都可以建议是否有GraphQl Django包装器进行休息电话。也没有在文档中找到

Trying to implement wrapper for existing REST APIS using Django graphQL.

Found similar one in JS but not in Django.
https://graphql.org/blog/rest-api-graphql-wrapper/
Could anyone please suggest if there is a GraphQL Django wrapper for REST calls. Haven't found in documentation either

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

墨落成白 2025-02-12 17:58:49

您是在谈论使用DRF的REST API吗?我建议您查看 graphene-django-cud 可帮助您进行突变。对于此而言,需要石墨烯 - django,并将有助于您的查询。不幸的是,这不是将所有DRF代码转换为GraphQL的包装器,但是您应该可以基本上复制串行序列化/视图中的大量内容。

Are you talking about a rest API using DRF? I'd suggest you look at graphene-django-cud to help you with mutations. Graphene-django is required for this, and will help with your queries. Unfortunately it's not a wrapper that will convert all your DRF code into graphql, however you should be able to basically copy paste a lot of the content in your serializers/views.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文