Currently, DataFetchingEnvironment has no way to fetch only the required fields if the query uses fragments.
DataFetchingEnvironment#getFields currently has populated SelectionSet only for Field and InlineFragment, while it is always blank for Fragment. Additionally, fragment definitions are inaccessible as they're only kept in ExecutionContext.
Currently,
DataFetchingEnvironmenthas no way to fetch only the required fields if the query uses fragments.DataFetchingEnvironment#getFieldscurrently has populatedSelectionSetonly forFieldandInlineFragment, while it is always blank forFragment. Additionally, fragment definitions are inaccessible as they're only kept inExecutionContext.