deno_graphql
deno_graphql copied to clipboard
None of the examples in the readme work
Recently I was trying to add a graphql middleware for an application I was working on and gave this module a shot. However I couldn't get any of the example in the readme to work. Ended up just coming up with my own implementation but figured I should probably create an issue.
Repro Steps
- Copy any example from readme
- Run the code
oak error
C:\_Playground\denoGraphQL> deno run --allow-net .\oak.ts
Compile file:///C:/_Playground/denoGraphQL/oak.ts
error: TS2345 [ERROR]: Argument of type 'import("https://deno.land/x/[email protected]/router").RouterMiddleware<Record<string | number, string | undefined>, Record<string, any>>' is not assignable to parameter of type 'import("https://deno.land/x/oak/router").RouterMiddleware<Record<string | number, string | undefined>, Record<string, any>>'.
Types of parameters 'context' and 'context' are incompatible.
Type 'import("https://deno.land/x/oak/router").RouterContext<Record<string | number, string | undefined>, Record<string, any>>' is not assignable to type 'import("https://deno.land/x/[email protected]/router").RouterContext<Record<string | number, string | undefined>, Record<string, any>>'.
Types of property 'router' are incompatible.
Type 'import("https://deno.land/x/oak/router").Router' is not assignable to type 'import("https://deno.land/x/[email protected]/router").Router'.
Property '#methods' in type 'Router' refers to a different member that cannot be accessed from within type 'Router'.
router.post("/graphql", graphqlHttp({ schema, context }));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///C:/_Playground/denoGraphQL/oak.ts:29:25
abc error
C:\_Playground\denoGraphQL> deno run --allow-net .\abc.ts
Compile file:///C:/_Playground/denoGraphQL/abc.ts
error: TS2345 [ERROR]: Argument of type 'import("https://deno.land/x/[email protected]/types").HandlerFunc' is not assignable to parameter of type
'import("https://deno.land/x/abc/types").HandlerFunc'.
Types of parameters 'c' and 'c' are incompatible.
Type 'import("https://deno.land/x/abc/context").Context' is not assignable to type 'import("https://deno.land/x/[email protected]/context").Context'.
Property '#writeContentType' in type 'Context' refers to a different member that cannot be accessed from within type 'Context'.
app.post("/graphql", graphqlHttp({ schema, context }));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
at file:///C:/_Playground/denoGraphQL/abc.ts:28:22
attain error
C:\_Playground\denoGraphQL> deno run --allow-net .\attain.ts
Compile file:///C:/_Playground/denoGraphQL/attain.ts
error: TS2305 [ERROR]: Module '"../../attain/mod"' has no exported member 'CallBackType'.
CallBackType,
~~~~~~~~~~~~
at https://deno.land/x/deno_graphql/src/attain_graphql.ts:4:3
👏^^^
None of them worked for me either...
Same here.