Skip to content

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

Open
@j-d-carmichael

Description

@j-d-carmichael

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions