[relay-compiler 13] Invalid use of @stream on scalar field
Author: artolaCreated Jan 16, 2022Updated Jun 25, 2026
With v13 (even on @main) I get error when using @stream on a List of scalars, while it works for objects.
Is this defined somewhere in the spec? It is not clear to me (spec for @stream) , just the field must be List type. The data in payload could be any scalar too.
type Query {
alphabet: [String!]
}alphabet: {
type: new GraphQLList(new GraphQLNonNull(GraphQLString)),
resolve: async function* () {
for (let letter = 65; letter <= 90; letter += await bumpy(1)) {
yield String.fromCharCode(letter);
}
},
},query demo3Query {
alphabet @stream(initial_count: 3) // <== [ERROR] ✖︎ Invalid use of @stream on scalar field 'alphabet'
}Note: the test is correct for such case, but it does not cover the above mentioned case but it is pretty much similar, just a different query field.
The above example works for this kind of query:
query demo3Query {
alphabet @stream(initial_count: 3) {
char
}
}Source: facebook/relay