Skip to content

Commit a5e102d

Browse files
author
Viktor Tochonov
committed
PR fixes
1 parent b8e06e7 commit a5e102d

File tree

9 files changed

+20
-23
lines changed

9 files changed

+20
-23
lines changed

build/Program.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ let ctx = Context.forceFakeContext ()
3232
let embedAll = ctx.Arguments |> List.exists (fun arg -> arg = BuildArguments.EmbedAll)
3333

3434
module DotNetCli =
35-
let setVersion (o : DotNet.Options) = { o with Version = Some "9.0.200" }
35+
let setVersion (o : DotNet.Options) = { o with Version = Some "9.0.304" }
3636
let setRestoreOptions (o : DotNet.RestoreOptions) = o.WithCommon setVersion
3737

3838
let configurationString = Environment.environVarOrDefault "CONFIGURATION" "Release"

src/FSharp.Data.GraphQL.Client/Upload.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type Upload
3838
| _ -> MediaTypeNames.Application.Octet
3939
| ct -> ct
4040

41-
/// Gets the name used to uniquily identify upload throuout multiple uploads
41+
/// Gets the name used to uniquely identify upload throughout multiple uploads
4242
/// and within a request.
4343
member val Name =
4444
name

src/FSharp.Data.GraphQL.Server.AspNetCore/RequestExecutionContext.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type HttpContextRequestExecutionContext (httpContext : HttpContext) =
1818
let memoryStream = new MemoryStream ()
1919
use fileStream = file.OpenReadStream ()
2020
fileStream.CopyTo (memoryStream)
21-
memoryStream.Position <- 0L
21+
memoryStream.Seek (0L, SeekOrigin.Begin) |> ignore
2222
Ok {
2323
FileName = file.FileName
2424
Stream = memoryStream

tests/FSharp.Data.GraphQL.IntegrationTests.Server/FSharp.Data.GraphQL.IntegrationTests.Server.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>$(DotNetVersion)</TargetFramework>
5-
<UserSecretsId>2cdd2058-1c78-4088-b2a9-3848706cf422</UserSecretsId>
5+
<UserSecretsId>FSharp.Data.GraphQL.IntegrationTests.Server</UserSecretsId>
66
</PropertyGroup>
77

88
<ItemGroup>

tests/FSharp.Data.GraphQL.IntegrationTests.Server/Schema.fs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,12 @@ module Schema =
198198
description = "Upload several files in different forms.",
199199
args = [ Define.Input("request", UploadRequestType, description = "The request for uploading several files in different forms.") ],
200200
resolve = fun ctx _ -> mapUploadRequestToOutput (ctx.Arg("request")))
201-
Define.Field ("uploadFileComplex", StringType, "", [ Define.Input ("input", InputFileObject) ],
202-
(fun ctx _ -> getFileContent ctx "input"))
201+
Define.Field (
202+
name = "uploadFileComplex",
203+
typedef = StringType,
204+
description = "",
205+
args = [ Define.Input ("input", InputFileObject) ],
206+
resolve = fun ctx _ -> getFileContent ctx "input")
203207
])
204208

205209
let schema : ISchema<Root> = upcast Schema(QueryType, MutationType)

tests/FSharp.Data.GraphQL.IntegrationTests/FSharp.Data.GraphQL.IntegrationTests.fsproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@
2424
<Compile Include="Helpers.fs" />
2525
<Compile Include="LocalProviderTests.fs" />
2626
<Compile Include="LocalProviderWithOptionalParametersOnlyTests.fs" />
27-
<None Include="SwapiLocalProviderTests.fs" />
28-
<None Include="SwapiRemoteProviderTests.fs" />
27+
<Compile Include="SwapiLocalProviderTests.fs" />
28+
<Compile Include="SwapiRemoteProviderTests.fs" />
2929
</ItemGroup>
3030

3131
<ItemGroup>
3232
<Reference Include="FSharp.Data.GraphQL.Client">
3333
<HintPath Condition="Exists('..\..\src\FSharp.Data.GraphQL.Client\bin\Debug\netstandard2.0\FSharp.Data.GraphQL.Client.dll')">..\..\src\FSharp.Data.GraphQL.Client\bin\Debug\netstandard2.0\FSharp.Data.GraphQL.Client.dll</HintPath>
34-
<!--<HintPath Condition="Exists('..\..\src\FSharp.Data.GraphQL.Client\bin\Release\netstandard2.0\FSharp.Data.GraphQL.Client.dll')">..\..\src\FSharp.Data.GraphQL.Client\bin\Release\netstandard2.0\FSharp.Data.GraphQL.Client.dll</HintPath>-->
34+
<HintPath Condition="Exists('..\..\src\FSharp.Data.GraphQL.Client\bin\Release\netstandard2.0\FSharp.Data.GraphQL.Client.dll')">..\..\src\FSharp.Data.GraphQL.Client\bin\Release\netstandard2.0\FSharp.Data.GraphQL.Client.dll</HintPath>
3535
<HintPath Condition="Exists('..\..\bin\FSharp.Data.GraphQL.Client\netstandard2.0\FSharp.Data.GraphQL.Client.dll')">..\..\bin\FSharp.Data.GraphQL.Client\netstandard2.0\FSharp.Data.GraphQL.Client.dll</HintPath>
3636
</Reference>
3737
<Reference Include="FSharp.Data.GraphQL.Shared">
3838
<HintPath Condition="Exists('..\..\src\FSharp.Data.GraphQL.Client\bin\Debug\netstandard2.0\FSharp.Data.GraphQL.Shared.dll')">..\..\src\FSharp.Data.GraphQL.Client\bin\Debug\netstandard2.0\FSharp.Data.GraphQL.Shared.dll</HintPath>
39-
<!--<HintPath Condition="Exists('..\..\src\FSharp.Data.GraphQL.Client\bin\Release\netstandard2.0\FSharp.Data.GraphQL.Shared.dll')">..\..\src\FSharp.Data.GraphQL.Client\bin\Release\netstandard2.0\FSharp.Data.GraphQL.Shared.dll</HintPath>-->
39+
<HintPath Condition="Exists('..\..\src\FSharp.Data.GraphQL.Client\bin\Release\netstandard2.0\FSharp.Data.GraphQL.Shared.dll')">..\..\src\FSharp.Data.GraphQL.Client\bin\Release\netstandard2.0\FSharp.Data.GraphQL.Shared.dll</HintPath>
4040
<HintPath Condition="Exists('..\..\bin\FSharp.Data.GraphQL.Client\netstandard2.0\FSharp.Data.GraphQL.Shared.dll')">..\..\bin\FSharp.Data.GraphQL.Client\netstandard2.0\FSharp.Data.GraphQL.Shared.dll</HintPath>
4141
</Reference>
4242
</ItemGroup>

tests/FSharp.Data.GraphQL.IntegrationTests/Helpers.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ module FSharp.Data.GraphQL.IntegrationTests.Helpers
33
open Xunit
44
open System.Text
55
open System.Collections.Generic
6-
open FSharp.Data.GraphQL
76
open System.Runtime.InteropServices
7+
open FSharp.Data.GraphQL
88

99
let normalize (x : string) =
1010
x.Replace("\r\n", "\n").Split ([| '\n' |])

tests/FSharp.Data.GraphQL.IntegrationTests/LocalProviderTests.fs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ module SingleRequiredUploadOperation =
221221
[<Fact>]
222222
let ``Should be able to execute a single required upload``() =
223223
let file = { Name = "file.txt"; ContentType = "text/plain"; Content = "Sample text file contents" }
224-
//let upload : Upload =
225224
SingleRequiredUploadOperation.operation.Run(file.MakeUpload())
226225
|> SingleRequiredUploadOperation.validateResult file
227226

@@ -254,12 +253,6 @@ module SingleOptionalUploadOperation =
254253
result.Data.Value.NullableSingleUpload.Value.ContentType |> equals file.ContentType)
255254

256255

257-
[<Fact>]
258-
let ``Should be able to execute a upload by passing a file with new approach``() =
259-
let file = { Name = "file.txt"; ContentType = "text/plain"; Content = "Sample text file contents" }
260-
SingleOptionalUploadOperation.operation.Run(file.MakeUpload())
261-
|> SingleOptionalUploadOperation.validateResult (Some file)
262-
263256
[<Fact>]
264257
let ``Should be able to execute a single optional upload by passing a file``() =
265258
let file = { Name = "file.txt"; ContentType = "text/plain"; Content = "Sample text file contents" }
@@ -278,7 +271,7 @@ let ``Should be able to execute a single optional upload by not passing a file``
278271
SingleOptionalUploadOperation.operation.Run()
279272
|> SingleOptionalUploadOperation.validateResult None
280273

281-
//[<Fact>]
274+
[<Fact>]
282275
let ``Should be able to execute a single optional upload by not passing a file asynchronously``() : Task = task {
283276
let! result = SingleOptionalUploadOperation.operation.AsyncRun()
284277
result |> SingleOptionalUploadOperation.validateResult None
@@ -487,7 +480,7 @@ let ``Should be able to upload files inside another input type``() : Task = task
487480
Some [| Some { Name = "multiple4.txt"; ContentType = "text/plain"; Content = "Multiple files fourth file content" }; None |] }
488481
let input =
489482
let makeUpload (x : File) = x.MakeUpload()
490-
UploadRequestOperation.Request(makeUpload request.Single,
483+
UploadRequestOperation.Request(single = makeUpload request.Single,
491484
multiple = Array.map makeUpload request.Multiple,
492485
nullableMultiple = Array.map makeUpload request.NullableMultiple.Value,
493486
nullableMultipleNullable = Array.map (Option.map makeUpload) request.NullableMultipleNullable.Value)

tests/FSharp.Data.GraphQL.IntegrationTests/LocalProviderWithOptionalParametersOnlyTests.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ let ``Should be able to execute a single required upload``() =
226226
[<Fact>]
227227
let ``Should be able to execute a single required upload asynchronously``() : Task = task {
228228
let file = { Name = "file.txt"; ContentType = "text/plain"; Content = "Sample text file contents" }
229-
let! result = SingleRequiredUploadOperation.operation.AsyncRun(file.MakeUpload("test"))
229+
let! result = SingleRequiredUploadOperation.operation.AsyncRun(file.MakeUpload())
230230
result |> SingleRequiredUploadOperation.validateResult file
231231
}
232232

@@ -335,8 +335,8 @@ module OptionalMultipleUploadOperation =
335335
[<Fact>]
336336
let ``Should be able to execute a multiple upload``() =
337337
let files =
338-
[| { Name = "file1.txt"; ContentType = "text/plain"; Content = "Sample text file contents 1" }
339-
{ Name = "file2.txt"; ContentType = "text/plain"; Content = "Sample text file contents 2" } |]
338+
[| { Name = "file1.txt"; ContentType = "text/plain"; Content = "Sample text file contents 1" }
339+
{ Name = "file2.txt"; ContentType = "text/plain"; Content = "Sample text file contents 2" } |]
340340
OptionalMultipleUploadOperation.operation.Run(files |> Array.map (fun f -> f.MakeUpload()) |> Some)
341341
|> OptionalMultipleUploadOperation.validateResult (Some files)
342342

0 commit comments

Comments
 (0)