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
Hi! I would say this is the expected behaviour. In your mutation you only pass the field name in your field entity which is of union typeEntityInBox. Since nose is missing your typename resolves to type Object instead of Face.
I’m not sure about this. I think it creates both, the Object AND the Face node since there is a union type. Try to query Box and resolve for __typename, I’d be curious what that would be?
So I guess the problem is that the mutation with faceRef should have failed in the first place since the field nose is mandatory. I guess the input type for the mutation addBox (and especially faceRef) does say otherwise?
correct. The mutation should fail as some mandatory fields are not being provided. But it all seems to work i.e. nodes get created. Not sure what you mean by ‘input type for the mutation’ ? How do you want me to modify the above queries to see that ?
You cannot alter the schema which gets generated by Dgraph but you could check the input type which gets created by Dgraph. Just use the explorer tab in the GraphQL area on Dgraph Cloud and look for the Query Name. Then I guess you input type is called something like AddBoxInput. Click on it and check the fields.
It seems like @pshaddel has encountered a similar problem and it seems like a bug! Maybe you should consider submitting a ticket to the support team for that!