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

Issue #3678 support value type extended scalars in Strawberry Shake #4595

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,44 @@ public void Nullable_List_Input()
"input Baz { qux: String }",
"extend schema @key(fields: \"id\")");
}

[Fact]
public void Nullable_ValueType_Input()
{
AssertResult(
@"query GetSomething($bar: Bar){ foo(bar: $bar)}",
"type Query { foo(bar: Bar ): String }",
"scalar IntPtr",
"input Bar { nullablePtr: IntPtr }",
@"extend scalar IntPtr
@serializationType(name: ""global::System.String"")
@runtimeType(name: ""global::System.IntPtr"", valueType: true)");
}

[Fact]
public void NonNullable_ValueType_Input()
{
AssertResult(
@"query GetSomething($bar: Bar){ foo(bar: $bar)}",
"type Query { foo(bar: Bar ): String }",
"scalar IntPtr",
"input Bar { nonNullablePtr: IntPtr! }",
@"extend scalar IntPtr
@serializationType(name: ""global::System.String"")
@runtimeType(name: ""global::System.IntPtr"", valueType: true)");
}

[Fact]
public void NonNullableValueType_WithoutGlobal_Input()
{
AssertResult(
@"query GetSomething($bar: Bar){ foo(bar: $bar)}",
"type Query { foo(bar: Bar ): String }",
"scalar IntPtr",
"input Bar { nonNullablePtr: IntPtr! }",
@"extend scalar IntPtr
@serializationType(name: ""global::System.String"")
@runtimeType(name: ""System.IntPtr"", valueType: true)");
}
}
}
Loading