queryFieldListToString function

String queryFieldListToString(
  1. GraphQLObjectType objectType,
  2. GraphQLRootObjectType rootObjectType
)

Implementation

String queryFieldListToString(
  GraphQLObjectType objectType,
  GraphQLRootObjectType rootObjectType,
) {
  final queryInputVariableList = collectVariableInQueryFieldList(objectType);
  return (rootObjectType == GraphQLRootObjectType.mutation
          ? 'mutation'
          : 'query') +
      (queryInputVariableList.isEmpty
          ? ''
          : ' (' +
              queryInputVariableList
                  .map(
                    (variable) =>
                        r'$' + variable.name + ': ' + variable.type.toString(),
                  )
                  .safeJoin(', ') +
              ')') +
      _queryFieldListToStringLoop(objectType, 0) +
      '\n';
}