我正在尝试设置一个基本的React Native Relay项目.我花了很多时间尝试调试问题而没有任何运气,我正在创建这个问题.我在控制台上收到此警告,我的本机应用程序无法调用GraphQL服务器.
Warning: RelayNetworkLayer: Call received to injectImplementation(), but a layer was already injected.
Running application "ExampleApp" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
fetchWithRetries(): Still no successful response after 1 retries, giving up.
Run Code Online (Sandbox Code Playgroud)
这是我的代码
index.ios.js
import React, { Component } from 'react';
import Relay from 'react-relay';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import App from './app';
import AppRoute from './route/appRoute';
Relay.injectNetworkLayer(
new Relay.DefaultNetworkLayer("http://localhost:1337/graphy")
);
class ExampleApp extends Component …Run Code Online (Sandbox Code Playgroud)