only method

void only(
  1. List<String> fieldUid
)

////////////////////////////////////////////// ////////////////////////////////////////////// Specifies an array of only keys in BASE object that would be included in the response. fieldUid Array of the only reference keys to be included in response. Query object, so you can chain this call.

Example:

final stack = contentstack.Stack('apiKey','deliveryToken','environment');
final query = stack.contentType("contentTypeUid").entry().query();
fieldUid is String type of List
query.only(fieldUid);

Implementation

//-------------[Entry Queryable]---------------//
/////////////////////////////////////////////////

/// Specifies an array of only keys in BASE object
/// that would be included in the response.
/// [fieldUid] Array of the only reference keys to be included in response.
/// [Query] object, so you can chain this call.
///
/// Example:
///
/// ```dart
/// final stack = contentstack.Stack('apiKey','deliveryToken','environment');
/// final query = stack.contentType("contentTypeUid").entry().query();
/// fieldUid is String type of List
/// query.only(fieldUid);
/// ```
///
void only(List<String> fieldUid) {
  if (fieldUid != null && fieldUid.isNotEmpty) {
    final List<String> referenceArray = [];
    for (final item in fieldUid) {
      referenceArray.add(item);
    }
    queryParameter['only[BASE][]'] = referenceArray.toString();
  }
}