【问题标题】:Is GraphQL supported in flutter webFlutter Web 是否支持 GraphQL
【发布时间】:2020-08-06 21:13:50
【问题描述】:

我开始使用 Flutter web 和 graphql 开发网络应用 (https://pub.dev/packages/graphql_flutter)

尝试初始化 graphql 时出现此错误:

Uncaught (in promise) Error: Expected a value of type 'String', but got one of type '_Future<String>'
    at Object.throw_ [as throw] (errors.dart:195)
    at Object.castError (errors.dart:44)
    at Object.cast [as as] (operations.dart:406)

【问题讨论】:

  • 可以发一下初始化代码吗?

标签: flutter web graphql


【解决方案1】:

我刚刚尝试过,使用来自 https://github.com/CoderJava/flutter-graphql-sample 的简单 graphql 代码使用颤振。 到目前为止,它适用于 Flutter web (Flutter 1.24.0-10.2.pre • channel beta & graphql: ^3.1.0):

【讨论】:

  • 不错,会试试
  • 嗨@kira,到目前为止您的体验如何?我正在考虑将 GQ 集成到我的 Flutter 应用中,我也需要网络支持。
  • 在我当前使用flutter web的项目中,我们使用rest API进行更新,使用graphql检索数据。到目前为止没有问题。
【解决方案2】:

我不认为它与 Flutter web 兼容。

软件包声明它支持 Android 和 iOS。

【讨论】:

  • 所以我猜网络不支持库
猜你喜欢
  • 2021-08-06
  • 2020-03-16
  • 2019-05-17
  • 2022-01-15
  • 1970-01-01
  • 1970-01-01
  • 2018-09-21
  • 1970-01-01
  • 2020-02-23
相关资源
最近更新 更多