Catalog/NoMeteorQueries

Catalog/NoMeteorQueries

Source:

Query functions that do not import or use any Meteor packages or globals. These can be used both by Meteor methods or publications, and by GraphQL resolvers.

Methods

(static) catalogItemProduct(context, params) → {Object}

query the Catalog for a single Product by id or slug id takes priority if both are provided, throws meteor error if neither

Source:
Parameters:
Name Type Attributes Description
context Object

an object containing the per-request state

params Object

request parameters

Properties
Name Type Attributes Description
_id String <optional>

Product id to include

param.slug String <optional>

Product slug (handle)

Returns:
  • A Product from the Catalog
Type
Object

(static) catalogItems(context, params) → {Promise.<MongoCursor>}

query the Catalog by shop ID and/or tag ID

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

params Object

request parameters

Properties
Name Type Attributes Description
shopIds Array.<String> <optional>

Shop IDs to include (OR)

tags Array.<String> <optional>

Tag IDs to include (OR)

Returns:
  • A MongoDB cursor for the proper query
Type
Promise.<MongoCursor>

(static) tag(context, slugOrId) → {Object}

query the Tags collection and return a tag by tag ID or slug

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

slugOrId String

ID or slug of tag to query

Returns:
  • A Tag document if one was found
Type
Object

(static) tags(context, shopId, paramsopt) → {Promise.<MongoCursor>}

query the Tags collection by shop ID and optionally by isTopLevel

Source:
Parameters:
Name Type Attributes Description
context Object

an object containing the per-request state

shopId String

ID of shop to query

params Object <optional>

Additional options for the query

Properties
Name Type Attributes Description
isTopLevel Boolean <optional>

If set, look for isTopLevel matching this value

shouldIncludeDeleted Boolean <optional>

Whether or not to include isDeleted=true tags. Default is false

Returns:
  • A MongoDB cursor for the proper query
Type
Promise.<MongoCursor>

(static) tagsByIds(context, tagIds, paramsopt) → {Promise.<MongoCursor>}

query the Tags collection by a list of IDs

Source:
Parameters:
Name Type Attributes Description
context Object

an object containing the per-request state

tagIds Array.<String>

tag IDs to get

params Object <optional>

Additional options for the query

Properties
Name Type Attributes Description
shouldIncludeDeleted Boolean <optional>

Whether or not to include isDeleted=true tags. Default is false

Returns:
  • A MongoDB cursor for the proper query
Type
Promise.<MongoCursor>