如何在Android中从GraphQl使用? [英] How can I use from GraphQl in android?

查看:211
本文介绍了如何在Android中从GraphQl使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个简单的示例在android中使用 GraphQl .

I need to a simple example for use GraphQl in android .

如何在android(教程)的 GraphQl 中使用.

How can I use from GraphQl in android (tutorial).

推荐答案

要使用GraphQL(通常),您需要做两件事:

In order to use GraphQL (in general), you need two things:

有几种方法可以解决此问题.当然,您可以简单地自己实现您喜欢的任何服务器端语言.其他(更快)的方法是利用现有工具并使用 graphql-up create-graphql-server 或什至 Graphcool 之类的服务(免责声明:我为他们工作).

There are a few ways how you could go about this. Of course, you could simply go and implement one yourself in any server-side language you like. Other (faster) approaches are to take advantage of existing tooling and generate a GraphQL API using services like graphql-up or create-graphql-server or even services like Graphcool (disclaimer: I work for them).

尽管这不是绝对必要的,并且您还可以通过纯HTTP(在POST请求的正文中发送查询和变异)来与GraphQL服务器进行交互,但是使用进行重复工作的现有工具无疑是有益的例如缓存或UI集成.目前最受欢迎的GraphQL客户端之一是 Apollo ,他们正在积极致力于 Android版也是如此.但是,此消息尚未正式发布.因此,您要么必须使用他们的现有开发版本,否则现在就选择使用纯HTTP的前一种方法.

Though this one isn't strictly necessary and you could also simply interact with the GraphQL server through plain HTTP (sending your queries and mutations in the body of POST requests), it is certainly beneficial to use existing tools that take repetitive work like caching or UI integrations off your shoulders. One of the most popular GraphQL clients right now is Apollo, and they're very actively working on a version for Android as well. However, this hasn't been officially released yet. So, you either have to use their existing development version of chose the former approach using plain HTTP for now.

这篇关于如何在Android中从GraphQl使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆