Collection not found

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?

any help here is much appreciated, you can find the complete repo at https://github.com/chidugit/publicapp/tree/master/shoppingcart

I think your issue is how you are creating the links. You need to pass the collection on the link, not the collection name. Like this

import {Mongo} from "meteor/mongo";
import Products from "./collection";
import Categories from "../categories/collection";

Products.addLinks({
    productsCategory:{
        type: "one",
        collection: Categories,
        field: "category"
    }
});

You need to do that in both categories and products links.

Thanks buddy, yes this solved the problem, although I had tried this initially, I had to do the same on inversedBy link and things started working.