Closed laststylebender14 closed 5 days ago
use following test case to reproduce the issue.
schema @server @upstream(baseURL: "http://jsonplaceholder.typicode.com") {
query: Query
}
union SearchResult = User | Post
type Query {
foo: [Foo]! @http(path: "/foos")
fooInner: [Foo!] @http(path: "/foos-inner")
}
type Foo {
id: Int
}
- request:
method: GET
url: http://jsonplaceholder.typicode.com/foos
response:
status: 200
body: null
- request:
method: GET
url: http://jsonplaceholder.typicode.com/foos-inner
response:
status: 200
body: [null, null]
- method: POST
url: http://localhost:8080/graphql
body:
query: >
query {
foo {
id
}
}
- method: POST
url: http://localhost:8080/graphql
body:
query: >
query {
fooInner {
id
}
}
Action required: Issue inactive for 30 days. Status update or closure in 7 days.
Issue closed after 7 days of inactivity.
Current Behaviour:
The [Int]! validation works as expected, ensuring the list is non-null and allowing nullable items within it. The [Int!] validation does not enforce the non-null constraint on the elements within the list, allowing null values.
Expected behaviour:
Validation should enforce that:
For [Int]!, the list must be non-null, and its elements can be nullable. For [Int!], the list can be null but list is present then all elements within the list must be non-null.