小编Ans*_*ral的帖子

使用graphql时出现意外的<EOF>

每次在同一行上都出现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)

graphql-js express-graphql

7
推荐指数
1
解决办法
4172
查看次数

对象无效作为反应子(react-native)

我试图在我的反应原生项目中初始化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';并且不初始化时,我甚至面临同样的错误 …

firebase reactjs react-native firebase-authentication

2
推荐指数
1
解决办法
1761
查看次数