Hello,
I’m wondering if what i came across is a normal behaviour or a bug. Let’s say I have the following schema:
interface EntityInBoxInterface {
id: ID!
name: String! @search(by: [term])
}
type Object implements EntityInBoxInterface {
data: String
}
type Face implements EntityInBoxInterface {
data: String
nose: Int! @search # nose position or something like that
}
union EntityInBox = Object | Face
type Box
{
id: ID!
entity: EntityInBox!
x0: Float! @search
y0: Float! @search
x1: Float! @search
y1: Float! @search
}
Field ‘nose’ is non nullable in type ‘Face’. However, the below mutation (without ‘nose’) works:
curl --request POST \
--url http://localhost:8080/graphql \
--header 'Content-Type: application/json' \
--data '{"query":"mutation {\n addBox ( input: {\n x0: 1.0, x1: 2.0, y0: 3.0, y1: 4.0, entity: { faceRef: { name: \"someface\"} }\n })\n {numUids}\n}"}'
and I end up with the ‘Face’ node without ‘nose’. Then the below query
curl --request POST
--url localhost:8080/graphql
--header 'Content-Type: application/json'
--data '{"query":"query {\n queryFace(first:10)\n {\n id\n nose\n }\n}"}' | python3 -m json.tool
returns the error message - “Non-nullable field ‘nose’ (type Int!) was not present in result from Dgraph. GraphQL error propagation triggered.”
Is it meant to work like this?
i’m running dgraph locally in a docker using the following command:
sudo docker run -it -d -p 8080:8080 dgraph/standalone:master
Regards