2017-07-22 16 views
0

私のプロジェクトでは、GraphQLフロータイプを使用しようとしています。GraphQLフロータイプの使用方法

たとえば、私はインスタンスを コンストラクタパラメータとして期待するクラスを持っています。すなわち:しかし

4: import type { GraphQLSchema } from 'graphql'; 
             ^^^^^^^^^ 
    graphql. Required module not found 

フォルダnode_modules/graphql/を見たとき、私はそこにあるすべての.flowのファイルを見ることができます:

import type { GraphQLSchema } from 'graphql'; 

type MyGraphQLConfig = { 
    schemaFiles: string, 
    resolvers: Object, 
    mocks: Object, 
    enableMocks: boolean 
} 

class GraphQL { 
    graphQLSchema: GraphQLSchema; 
    configs: MyGraphQLConfig; 

    constructor(configs: MyGraphQLConfig, graphQLSchema: GraphQLSchema) { 
    this.graphQLSchema = null; 
    this.configs = configs; 
    } 

    getSchema() : GraphQLSchema { 
    return this.graphQLSchema; 
    } 
} 

私は、このファイルにflow checkコマンドを実行すると、私は次のエラーを取得します。

紛失しているものがありますか?

答えて

1

あなたは/ node_modules/*を無視しているかどうかを確認するために.flowconfigをチェックしましたか?

私は無視して問題を解決することができます。私は、しかし、私は実行している他の問題があります。

+0

'.flowconfig'から' node_modules'をアンコメントしました! – Fabrizio

関連する問題