Hi friends,
Im using package cultofcoders:grapher, when I’m trying to link two collections Im getting error -
Error: Could not find a collection with the name: Products [invalid-collection]
at Linker._validateAndClean (packages/cultofcoders:grapher/lib/links/linker.js:159:23)
Below is my code
products/collection.js
import {Mongo} from "meteor/mongo";
import ProductSchema from "./schema"
const Products = new Mongo.Collection("products");
Products.attachSchema(ProductSchema);
Products.attachBehaviour("timestampable");
export default Products;
products/link.js
import Products from "./collection";
import Categories from "../categories/collection";
Products.addLinks({
productsCategory:{
type: "one",
collection: "Categories",
field: "category"
}
});
No error is triggered when attaching schema, but why is there an error when I am trying to add links?
WHat am I missing here?