在Android上使用Apollo查询域时,网络请求失败

时间:2019-07-07 04:35:27

标签: react-native react-native-android react-apollo apollo-client

我在React Native Android中测试了具有自定义域的apollo客户端文档中的查询,似乎给了我“网络请求失败”的响应

import React from 'react';
import {
  Text,
} from 'react-native';

import ApolloClient from "apollo-boost";
import { gql } from "apollo-boost";

const client = new ApolloClient({
  uri: "https://48p1r2roz4.sse.codesandbox.io"
});

client
  .query({
    query: gql`
      {
        rates(currency: "USD") {
          currency
        }
      }
    `
  })
  .then(result => console.log(result));

const App = () => {
  return (
    <Text>Done</Text>
  );
};

export default App;

这是远程JS调试器的结果。 enter image description here

如果任何人都可以帮助,那就太好了。

0 个答案:

没有答案
相关问题