我开始学习graphql-js源代码,但发现很难确定源代码是用vanilla js还是用typescript编写的
例如,主条目文件src/graphql.js具有以下代码:
import type { GraphQLSchema } from './type/schema';
import type { ExecutionResult } from './execution/execute';我不认为导入类型是标准的js语法。谁能帮我解释一下它是用来干嘛的?
另外,下面的代码看起来像TypeScript,但是文件扩展名是js,而不是ts
function graphql(
schema: GraphQLSchema,
requestString: string,
rootValue?: mixed,
contextValue?: mixed,
variableValues?: ?{[key: string]: mixed},
operationName?: ?string):: Promise<ExecutionResult> {}https://stackoverflow.com/questions/43249706
复制相似问题