generateQuerySpec function

Spec generateQuerySpec(
  1. QueryDefinition definition
)

Implementation

Spec generateQuerySpec(QueryDefinition definition) {
  return Block((b) => b
    ..statements.addAll([
      Code(
          "final ${definition.documentOperationName.constantCase} = '${definition.operationName}';"),
      Code('final ${definition.documentName.constantCase} = '),
      dart.fromNode(definition.document).code,
      Code(';'),
    ]));
}