n1ru4l / envelop

Envelop is a lightweight library allowing developers to easily develop, share, collaborate and extend their GraphQL execution layer. Envelop is the missing GraphQL plugin system.
https://envelop.dev
MIT License
785 stars 127 forks source link

Type errors when running examples #2254

Open rosman21 opened 3 months ago

rosman21 commented 3 months ago

Issue workflow progress

Progress of the issue based on the Contributor Workflow


Describe the bug

after doing a pnpm install & pnpm run build

I navigate to the examples directory and I am getting a type error

npm run start

> @envelop-examples/graphql-ws@1.0.0 start
> ts-node index.ts

/Users/reneosman/Desktop/projects/envelop/node_modules/.pnpm/ts-node@10.9.2_@types+node@20.11.30_typescript@5.1.3/node_modules/ts-node/src/index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
index.ts:34:3 - error TS2345: Argument of type '{ parse: (source: string | Source, options?: ParseOptions) => DocumentNode; validate: (schema: GraphQLSchema, documentAST: DocumentNode, rules?: readonly ValidationRule[], options?: { ...; }, typeInfo?: TypeInfo) => readonly GraphQLError[]; execute: (args: ExecutionArgs) => PromiseOrValue<...>; subscribe: (args: Exe...' is not assignable to parameter of type '{ plugins: Plugin<{}>[]; enableInternalTracing?: boolean; }'.
  Object literal may only specify known properties, and 'parse' does not exist in type '{ plugins: Plugin<{}>[]; enableInternalTracing?: boolean; }'.

34   parse,
     ~~~~~

    at createTSError (/xxxx/envelop/node_modules/.pnpm/ts-node@10.9.2_@types+node@20.11.30_typescript@5.1.3/node_modules/ts-node/src/index.ts:859:12)
    at reportTSError (/xxxxx/envelop/node_modules/.pnpm/ts-node@10.9.2_@types+node@20.11.30_typescript@5.1.3/node_modules/ts-node/src/index.ts:863:19)
    at getOutput (/xxxxx/envelop/node_modules/.pnpm/ts-node@10.9.2_@types+node@20.11.30_typescript@5.1.3/node_modules/ts-node/src/index.ts:1077:36)
    at Object.compile (/xxxxx/envelop/node_modules/.pnpm/ts-node@10.9.2_@types+node@20.11.30_typescript@5.1.3/node_modules/ts-node/src/index.ts:1433:41)
    at Module.m._compile (/xxxxxx/envelop/node_modules/.pnpm/ts-node@10.9.2_@types+node@20.11.30_typescript@5.1.3/node_modules/ts-node/src/index.ts:1617:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Object.require.extensions.<computed> [as .ts] (/xxxxx/envelop/node_modules/.pnpm/ts-node@10.9.2_@types+node@20.11.30_typescript@5.1.3/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Function.Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  diagnosticCodes: [ 2345 ]
}

Screenshot 2024-06-14 at 2 23 45 PM

To Reproduce Steps to reproduce the behavior:

clone repo pnpm install pnpm run build cd examples pnpm run start

Expected behavior

it should run the project

Environment:

Additional context

Is there something I am missing here?