When using @lambda directive on a field, the lambda function is not called unless the ID field is queried as well. Is this the expected behaviour? I’m running the latest lambda-server and dgraph/standalone:v20.11.2 locally.
Actually, after additional observations, I see the parent object passed to the lambda function only contains the fields that were queried in graphql. However the docs here says:
The parent receives all immediate fields of that object, whether or not they were actually queried.
The lambda function should get all the scalar fields from the parent object that are stored in dgraph, whether or not they were actually queried.
I think there is something wrong with your setup. We have a test for lambdas which works fine everytime: dgraph/lambda.go at master · dgraph-io/dgraph · GitHub
You can see there that the GraphQL query doesn’t query for dob but the lambda field is still getting the correct dob for the user and replying with that in the bio field.
Could you reproduce the same on Slash/Dgraph Cloud?