简体   繁体   English

为什么在graphene-django中中继?

[英]Why relay in graphene-django?

I would like to know why Relay spec is in graphene-django?我想知道为什么 Relay 规范在 graphene-django 中? I understand that using relay in graphene-django we get pagination and filters by default.我知道在 graphene-django 中使用中继我们默认获得分页和过滤器。

My requirement is to call graphql apis from React (for Web) and use Apollo client for Android and iOS.我的要求是从 React(用于 Web)调用 graphql apis 并使用适用于 Android 和 iOS 的 Apollo 客户端。

  1. Will there be a problem for clients to consume graphql apis written using graphene-django with Relay compliant especially pagination (and cursors) feature?客户端使用具有 Relay 兼容特别是分页(和光标)功能的 graphene-django 编写的 graphql api 会不会有问题?

  2. How to support subscriptions using graphene-django?如何使用graphene-django支持订阅?

Any help would be highly appreciated.任何帮助将不胜感激。

  1. There isn't any problem with consuming Relay-compliant graphene-django API.使用符合 Relay 的 graphene-django API 没有任何问题。 My team at work is currently using react-query library , and it works fabulously!我的工作团队目前正在使用react-query library ,并且效果非常好!

  2. As mentioned in this graphene-django Github issue , GraphQL subscription is currently not supported out of the box.正如在这个 graphene-django Github issue 中提到的,GraphQL 订阅目前不支持开箱即用。

Relay is the client-side middleware between React and any GraphQL server. Relay 是 React 和任何 GraphQL 服务器之间的客户端中间件。 Relay Specs provided by graphene-django just make it easier to use relay with graphene-django. graphene-django 提供的 Relay Specs 只是让 graphene-django 更容易使用中继。 They are not strictly necessary它们不是绝对必要的

  1. There should not be a problem for clients to consume graphql apis written using graphene-django客户端使用使用graphene-django编写的graphql api应该没有问题

  2. Subscriptions are handled by a separate package - graphene-django-subscriptions订阅由单独的包处理 - graphene-django-subscriptions

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM