每次在同一行上都出现EOF错误,多次更改代码,甚至降级到以前的版本,graphql但没有任何积极结果。我的代码是:
const graphql = require('graphql')
const _ = require('lodash')
const {
GraphQLObjectType,
GraphQLString,
GraphQLInt,
GraphQLSchema
} = graphql
const users = [
{id: '1', firstName: 'Ansh', age: 20},
{id: '2', firstName: 'Ram', age: 21},
{id: '3', firstName: 'Sham', age: 20}
]
const UserType = new GraphQLObjectType({
name: 'User',
fields: {
id: {type: GraphQLString},
firstName: {type: GraphQLString},
age: {type: GraphQLInt}
}
})
const RootQuery = new GraphQLObjectType({
name: 'RootQueryType',
fields: {
user: {
type: UserType,
args: {id: {type: GraphQLString}}, …Run Code Online (Sandbox Code Playgroud) 我试图在我的反应原生项目中初始化firebase.
App.js我初始化它的代码是
import React, {Component} from 'react';
import {View, Text} from 'react-native';
import {Provider} from 'react-redux';
import {createStore} from 'redux';
import reducers from './reducers';
import firebase from 'firebase';
class App extends Component {
componentWillMount () {
const config = {
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
messagingSenderId: ""
};
firebase.initializeApp(config);
}
render() {
return (
<Provider store={createStore(reducers)}>
<View>
<Text>Hello! </Text>
</View>
</Provider>
);
}
}
export default App;
Run Code Online (Sandbox Code Playgroud)
当我只包含import firebase from 'firebase';并且不初始化时,我甚至面临同样的错误 …