Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find a declaration file for module 'graphql' #106

Open
j-d-carmichael opened this issue Jan 6, 2024 · 1 comment
Open

Could not find a declaration file for module 'graphql' #106

j-d-carmichael opened this issue Jan 6, 2024 · 1 comment

Comments

@j-d-carmichael
Copy link

j-d-carmichael commented Jan 6, 2024

Installed version:

"weaviate-ts-client": "^2.0.0",

Build error:

node_modules/@graphql-typed-document-node/core/typings/index.d.ts:1:35 - error TS7016: Could not find a declaration file for module 'graphql'. '...api/node_modules/graphql/index.js' implicitly has an 'any' type.
  If the 'graphql' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'graphql';`

1 import type { DocumentNode } from "graphql";
                                    ~~~~~~~~~
Found 1 error in node_modules/@graphql-typed-document-node/core/typings/index.d.ts:1

The only thing i have done so far is start to create the class that will be used to connect to the weaviate database.

import weaviate, { WeaviateClient } from 'weaviate-ts-client';
import config from '@/config';

class VDBService {
  client!: WeaviateClient;

  setupClient() {
    this.client = weaviate.client({
      scheme: 'https',
      host: config.apis.weviate.host,
      headers: { 'X-OpenAI-Api-Key': config.apis.openai.apikey },
    });
  }
}

export default new VDBService();

The types npm package is deprecated: https://www.npmjs.com/package/@types/graphql

This is the dependency tree for the weaviate installation:

├─┬ weaviate-ts-client@2.0.0
│ ├─┬ graphql-request@5.2.0
│ │ ├─┬ @graphql-typed-document-node/core@3.2.0
│ │ │ └── graphql@0.11.7 deduped
│ │ ├─┬ cross-fetch@3.1.8
│ │ │ └── node-fetch@2.7.0 deduped
│ │ ├── extract-files@9.0.0
│ │ ├─┬ form-data@3.0.1
│ │ │ ├── asynckit@0.4.0 deduped
│ │ │ ├── combined-stream@1.0.8 deduped
│ │ │ └── mime-types@2.1.34 deduped
│ │ └── graphql@16.8.1
│ └── uuid@9.0.1 deduped

@j-d-carmichael
Copy link
Author

This was resolved by manually installing "graphql-request": "^5.2.0",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant