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:

├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ @graphql-typed-document-node/[email protected]
│ │ │ └── [email protected] deduped
│ │ ├─┬ [email protected]
│ │ │ └── [email protected] deduped
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected] deduped
│ │ │ ├── [email protected] deduped
│ │ │ └── [email protected] deduped
│ │ └── [email protected]
│ └── [email protected] 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