What feature are you missing?
Returning a scalar value for a resolver function is not supported currently.
How could this feature look like in detail? Tradeoffs?
extend type Query {
add(a: Int! b: Int!): Int!
}
module.exports = function sum(event) {
const data = event.data
const sum = data.a + data.b
return {data: sum}
}
Currently, if you store such a resolver function, you receive this error message:
Schema Extension Error for function 'A': Must provide return type. For example: type MyPayload { someField: Boolean }
I think this is kinda related to generally being able to return any existing type from your schema. Unless that's already working and I've missed it :)
No, it's not. The primitive types are not linked to storage, and using them in resolver functions is something that's a lot different from integrating Resolver Function payload Types with the storage Types.
Looks like a great and natural addition to resolver functions!
Further discuss in #743.
Most helpful comment
Looks like a great and natural addition to resolver functions!