Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js Nest Js未知类型“;JSON";。使用graphQL_Node.js_Graphql_Nestjs - Fatal编程技术网

Node.js Nest Js未知类型“;JSON";。使用graphQL

Node.js Nest Js未知类型“;JSON";。使用graphQL,node.js,graphql,nestjs,Node.js,Graphql,Nestjs,嗨,我正在使用nest Js和gql这是我在nest中设置的 GraphQLModule.forRoot({ typePaths: ['./**/types.gql'], definitions: { path: join(process.cwd(), 'src/graphql.ts') }, }) 我将complie.gql文件转换成gql typescript文件,但当我想得到这样的Json参数时 type Query { getData(query: JSON): [Data

嗨,我正在使用nest Js和gql这是我在nest中设置的

GraphQLModule.forRoot({
  typePaths: ['./**/types.gql'],
  definitions: { path: join(process.cwd(), 'src/graphql.ts') },
})
我将complie.gql文件转换成gql typescript文件,但当我想得到这样的Json参数时

type Query {
  getData(query: JSON): [Data]
}

当它编译到ts文件时,会显示错误
(节点:57719)未处理PromisejectionWarning:错误:未知类型“JSON”。

graphql中没有内置JSON类型,可以将其定义为自定义类型,读取文档