Skip to content

Commit aded752

Browse files
committed
disable and comment tests for stream ifs
1 parent 12c1e88 commit aded752

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed

v2/pkg/astvalidation/operation_validation_test.go

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4825,39 +4825,44 @@ type Query {
48254825
})
48264826

48274827
// conditionals in streams are not implemented yet, some tests are disabled for now.
4828-
t.Run("with different if conditions", func(t *testing.T) {
4829-
run(t, `
4830-
query { dog { ...dogFragment } }
4831-
fragment dogFragment on Dog {
4832-
extras @stream(label: "same", initialCount: 1, if: true)
4833-
extras @stream(label: "same", initialCount: 1, if: false)
4834-
}`, FieldSelectionMerging(), Invalid,
4835-
withValidationErrors(`found conflicting stream directives on the same field`))
4836-
})
4837-
t.Run("with variable if conditions", func(t *testing.T) {
4838-
run(t, `
4839-
query($cond1: Boolean!, $cond2: Boolean!) {
4840-
dog {
4841-
extras @stream(label: "same", initialCount: 1, if: $cond1)
4842-
extras @stream(label: "same", initialCount: 1, if: $cond2)
4843-
}
4844-
}`, FieldSelectionMerging(), Invalid,
4845-
withValidationErrors(`found conflicting stream directives on the same field`))
4846-
})
4828+
//
4829+
// Streams with "if:false" should be just ignored.
4830+
// t.Run("with different if conditions", func(t *testing.T) {
4831+
// run(t, `
4832+
// query { dog { ...dogFragment } }
4833+
// fragment dogFragment on Dog {
4834+
// extras @stream(label: "same", initialCount: 1, if: true)
4835+
// extras @stream(label: "same", initialCount: 1, if: false)
4836+
// }`, FieldSelectionMerging(), Valid)
4837+
// })
4838+
//
4839+
// Streams with "if" set to variables, should have matching other fields.
4840+
// t.Run("with variable if conditions", func(t *testing.T) {
4841+
// run(t, `
4842+
// query($cond1: Boolean!, $cond2: Boolean!) {
4843+
// dog {
4844+
// extras @stream(label: "same", initialCount: 1, if: $cond1)
4845+
// extras @stream(label: "same", initialCount: 1, if: $cond2)
4846+
// }
4847+
// }`, FieldSelectionMerging(), Valid)
4848+
// })
4849+
//
4850+
// "if: true" in streams can be omitted and merged without it
48474851
// t.Run("with if true vs no if argument", func(t *testing.T) {
48484852
// run(t, `
48494853
// query { dog {
48504854
// extras @stream(label: "same", initialCount: 1, if: true)
48514855
// extras @stream(label: "same", initialCount: 1)
48524856
// } }`, FieldSelectionMerging(), Valid)
48534857
// })
4858+
//
4859+
// streams with "if: false" should be ignored
48544860
// t.Run("with if false vs no stream", func(t *testing.T) {
48554861
// run(t, `
48564862
// query { dog {
48574863
// extras
48584864
// extras @stream(label: "one", if: false)
4859-
// } }`, FieldSelectionMerging(), Invalid,
4860-
// withValidationErrors(`found conflicting stream directives on the same field`))
4865+
// } }`, FieldSelectionMerging(), Valid)
48614866
// })
48624867
})
48634868
})

0 commit comments

Comments
 (0)