我有一个 angular 12 项目,我想将 graphql 与 apollo-angular 一起使用。我使用以下代码创建了一个 category.js 文件:
import gql from 'graphql-tag';
const CATEGORIES_QUERY = gql`
query Categories {
categories {
id
name
}
}
`;
export default CATEGORIES_QUERY;
在我的 component.ts 中,我想导入这个 js 文件:
import CATEGORIES_QUERY from "../apollo/queries/category/categories";
但我收到以下错误:
Could not find a declaration file for module '../apollo/queries/category/categories'.
'c:/Users/Diba Computer/vscode/blog-
strapi/frontend/src/app/apollo/queries/category/categories.js' implicitly has an 'any' type.
谁能帮忙?