Skip to content

Commit 182d1a1

Browse files
xperiandriclaude
andcommitted
Give the remote Swapi provider tests their own operation names
SwapiLocalProviderTests and SwapiRemoteProviderTests both instantiate `GraphQLProvider<"introspection.json">` and both declare inline operations named `Q` and `M`. With the F# compiler from SDK 10.0.3xx, which CI is pinned to, a clean build of the integration tests then fails with FS0193 ("type ...Operations.Q.OperationResult is not compatible with type ...Operations.Q.OperationResult"). SDK 10.0.401 compiles it, and reverting FSharp.TypeProviders.SDK to 8.1.0 does not help, so this is a compiler issue rather than a change in this repository. It went unnoticed because CI stopped building the integration tests. Rename the remote operations to `RemoteQ` and `RemoteM`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent f8e432c commit 182d1a1

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎tests/FSharp.Data.GraphQL.IntegrationTests/SwapiRemoteProviderTests.fs‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ open Helpers
55
open FSharp.Data.GraphQL
66
open System.Threading.Tasks
77

8+
// SwapiLocalProviderTests instantiates the same provider with the same static arguments.
9+
// The F# compiler in SDK 10.0.3xx fails with FS0193 ("type X is not compatible with type X") when both files
10+
// declare inline operations with the same name, so the operations here are named differently.
811
type Provider = GraphQLProvider<"introspection.json">
912

1013
let connection = TestHosts.createStarWarsConnection ()
@@ -15,7 +18,7 @@ type Episode = Provider.Types.Episode
1518

1619
module SimpleOperation =
1720
let operation =
18-
Provider.Operation<"""query Q {
21+
Provider.Operation<"""query RemoteQ {
1922
hero (id: "1000") {
2023
name
2124
appearsIn
@@ -43,7 +46,7 @@ hero (id: "1000") {
4346
}
4447
}"""> ()
4548

46-
type Operation = Provider.Operations.Q
49+
type Operation = Provider.Operations.RemoteQ
4750

4851
let validateResult (result : Operation.OperationResult) =
4952
result.CustomData.ContainsKey ("documentId") |> equals true
@@ -162,15 +165,15 @@ let ``Should be able to use pattern matching methods on an union type`` () =
162165

163166
module MutationOperation =
164167
let operation =
165-
Provider.Operation<"""mutation M {
168+
Provider.Operation<"""mutation RemoteM {
166169
setMoon (id: "1", isMoon: true) {
167170
id
168171
name
169172
isMoon
170173
}
171174
}"""> ()
172175

173-
type Operation = Provider.Operations.M
176+
type Operation = Provider.Operations.RemoteM
174177

175178
let validateResult (result : Operation.OperationResult) =
176179
result.CustomData.ContainsKey ("documentId") |> equals true

0 commit comments

Comments
 (0)