Skip to content

Commit

Permalink
Remove :unknown from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
captbaritone committed Aug 11, 2024
1 parent 5853543 commit dcfad60
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @gqlType */
export class SomeType {
/** @gqlField */
greeting(args: unknown, ctx: never): string {
greeting(ctx: never): string {
return ctx.greeting;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-----------------
INPUT
-----------------
/** @gqlType */
export class SomeType {
/** @gqlField */
greeting(ctx: never): string {
return ctx.greeting;
}
}

-----------------
OUTPUT
-----------------
src/tests/fixtures/resolver_context/ContextValueTypedAsNever.invalid.ts:4:17 - error: Unexpected `never` type for resolver argument. If a resolver argument is not needed by the resolver, it may be omitted.

4 greeting(ctx: never): string {
~~~~~

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @gqlType */
export class SomeType {
/** @gqlField */
greeting(args: unknown, ctx: string): string {
greeting(ctx: string): string {
return ctx;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ INPUT
/** @gqlType */
export class SomeType {
/** @gqlField */
greeting(args: unknown, ctx: string): string {
greeting(ctx: string): string {
return ctx;
}
}

-----------------
OUTPUT
-----------------
src/tests/fixtures/resolver_context/ContextValueTypedAsString.invalid.ts:4:18 - error: Unexpected `unknown` type for resolver argument. If a resolver argument is not needed by the resolver, it may be omitted.
src/tests/fixtures/resolver_context/ContextValueTypedAsString.invalid.ts:4:17 - error: Unexpected type for resolver argument. Resolver arguments must be typed with either an object literal (`{}`) or a reference to a named type.

4 greeting(args: unknown, ctx: string): string {
~~~~~~~
4 greeting(ctx: string): string {
~~~~~~

0 comments on commit dcfad60

Please sign in to comment.