MergedField single field support by bbakerman · Pull Request #4056 · graphql-java/graphql-java

MergedField allows us to represent on or more fields in one structure BUT 90% of the time there is only a single field. So we are allocating memory for a list of one field all the time

This changes it so that if there is only a single field, no list of allocated

It also changes a few things do they dont call mergedField.getFields() which will materialised the list. Rather there are new methods to test its size without materialising the list and so on. Also a .forEach() method thats aware of the state of the internal list or not