Added automated test to confirm behavior of relationships with no connections.
To test manually, start on the main branch.
Create a relationship field from one model to another, make sure it is not a "required" field. Add a single post entry for one of the models. Do not add a connection to the other model. Save the post.
Query the model posts in GraphiQL. Tip: If you go to Atlas Content Modeler > Models, click on the dropdown menu on the right side of your model (three dot icon), select Open in GraphiQL. Screenshot:
Run the query. You should see errors on the main branch.
Check out this branch and repeat the same query. You should not see errors.
Return null instead of array of empty nodes and edges.
Closes #663.
Related: See previous fix related to this here: https://github.com/wpengine/atlas-content-modeler/pull/648
Description
Return value has changed from an array of empty nodes/edges to
null
.https://wpengine.atlassian.net/browse/MERL-1192
Checklist
I have:
Testing
Added automated test to confirm behavior of relationships with no connections.
To test manually, start on the
main
branch.Create a relationship field from one model to another, make sure it is not a "required" field. Add a single post entry for one of the models. Do not add a connection to the other model. Save the post.
Query the model posts in GraphiQL. Tip: If you go to Atlas Content Modeler > Models, click on the dropdown menu on the right side of your model (three dot icon), select Open in GraphiQL. Screenshot:
Run the query. You should see errors on the
main
branch.Check out this branch and repeat the same query. You should not see errors.