fetchAllDatasets.ts
316 Bytes
import { Context } from "../";
import Dataset from "entity/Dataset";
export default async (root: {}, { id }, context: Context) => {
const { connection } = context;
const datasetRepo = connection.getRepository(Dataset);
const datasets = await datasetRepo.find();
console.log(datasets);
return datasets;
};