message: Only load task logs if a query requests the logs field
diff: // @flow
  const R = require('ramda');
  +const getFieldNames = require('graphql-list-fields');
  const { sendToLagoonLogs } = require('@lagoon/commons/src/logs');
  const { createTaskTask } = require('@lagoon/commons/src/tasks');
  const { pubSub, createEnvironmentFilteredSubscriber } = require('../../clients/pubSub');
  @@ -44,6 +45,7 @@ const getTasksByEnvironmentId = async (
  permissions: { customers, projects },
  },
  },
  + info,
  ) => {
  const prep = prepare(
  sqlClient,
  @@ -61,10 +63,20 @@ const getTasksByEnvironmentId = async (
  );
  const rows = await query(sqlClient, prep({ eid }));
  -
  const newestFirst = R.sort(R.descend(R.prop('created')), rows);
  - return newestFirst.map(row => Helpers.injectLogs(row));
  + const requestedFields = getFieldNames(info);
  +
  + return newestFirst.map(row => {
  + if (R.contains('logs', requestedFields)) {
  + return Helpers.injectLogs(row);
  + }
  +
  + return {
  + ...row,
  + logs: null,
  + };
  + });
  };
  const getTaskByRemoteId = async (
  