我正在尝试获取graphql的类型定义。我已经安装了graphql和@types/graphql,在我的文件中也安装了import * as graphql from "graphql"。但是,我无法访问GraphQLSchemaConfig之类的类型。我怎么才能接触到这些?类型定义似乎是正确加载的,因为构造函数要求该类型的参数。
发布于 2017-08-24 23:43:52
GraphQLSchemaConfig在type/schema.d.ts文件中定义和导出。然而,index.d.ts文件只重新导出GraphQLSchema。我们可以通过做.
import { GraphQLSchemaConfig } from "graphql/type/schema";绝对类型的存储库graphql目录。中有详细信息
index.d.ts包含export * from './type';type/index.d.ts包含export { GraphQLSchema } from './schema';type/schema.d.ts包含export interface GraphQLSchemaConfig { /* ... */ )这是我们需要引用的最后一个文件,以便导入GraphQLSchemaConfig。
https://stackoverflow.com/questions/45870184
复制相似问题