readGraphQlFiles method

Future<List<DocumentNode>> readGraphQlFiles(
  1. BuildStep buildStep,
  2. String schema
)

read asset files

Implementation

Future<List<DocumentNode>> readGraphQlFiles(
  BuildStep buildStep,
  String schema,
) async {
  final schemaAssetStream = buildStep.findAssets(Glob(schema));

  return await schemaAssetStream
      .asyncMap(
        (asset) async => parseString(
          await buildStep.readAsString(asset),
          url: asset.path,
        ),
      )
      .toList();
}