Exemple #1
0
        /// \deprecated Use `QueryRoot.collections` instead.
        /// <summary>
        /// List of the shop’s collections.
        /// </summary>
        /// <param name="first">
        /// Returns up to the first `n` elements from the list.
        /// </param>
        /// <param name="after">
        /// Returns the elements that come after the specified cursor.
        /// </param>
        /// <param name="last">
        /// Returns up to the last `n` elements from the list.
        /// </param>
        /// <param name="before">
        /// Returns the elements that come before the specified cursor.
        /// </param>
        /// <param name="reverse">
        /// Reverse the order of the underlying list.
        /// </param>
        /// <param name="sortKey">
        /// Sort the underlying list by the given key.
        /// </param>
        /// <param name="query">
        /// Supported filter parameters:
        /// - `collection_type`
        /// - `title`
        /// - `updated_at`
        ///
        /// See the detailed [search syntax](https://help.shopify.com/api/getting-started/search-syntax).
        /// </param>
        public ShopQuery collections(CollectionConnectionDelegate buildQuery, long?first = null, string after = null, long?last = null, string before = null, bool?reverse = null, CollectionSortKeys?sortKey = null, string queryValue = null, string alias = null)
        {
            Log.DeprecatedQueryField("Shop", "collections", "Use `QueryRoot.collections` instead.");

            if (alias != null)
            {
                ValidationUtils.ValidateAlias(alias);

                Query.Append("collections___");
                Query.Append(alias);
                Query.Append(":");
            }

            Query.Append("collections ");

            Arguments args = new Arguments();

            if (first != null)
            {
                args.Add("first", first);
            }

            if (after != null)
            {
                args.Add("after", after);
            }

            if (last != null)
            {
                args.Add("last", last);
            }

            if (before != null)
            {
                args.Add("before", before);
            }

            if (reverse != null)
            {
                args.Add("reverse", reverse);
            }

            if (sortKey != null)
            {
                args.Add("sortKey", sortKey);
            }

            if (queryValue != null)
            {
                args.Add("query", queryValue);
            }

            Query.Append(args.ToString());

            Query.Append("{");
            buildQuery(new CollectionConnectionQuery(Query));
            Query.Append("}");

            return(this);
        }
Exemple #2
0
        /// <summary>
        /// List of collections a product belongs to.
        /// </summary>
        /// <param name="first">
        /// Returns up to the first `n` elements from the list.
        /// </param>
        /// <param name="after">
        /// Returns the elements that come after the specified cursor.
        /// </param>
        /// <param name="last">
        /// Returns up to the last `n` elements from the list.
        /// </param>
        /// <param name="before">
        /// Returns the elements that come before the specified cursor.
        /// </param>
        /// <param name="reverse">
        /// Reverse the order of the underlying list.
        /// </param>
        public ProductQuery collections(CollectionConnectionDelegate buildQuery, long?first = null, string after = null, long?last = null, string before = null, bool?reverse = null, string alias = null)
        {
            if (alias != null)
            {
                ValidationUtils.ValidateAlias(alias);

                Query.Append("collections___");
                Query.Append(alias);
                Query.Append(":");
            }

            Query.Append("collections ");

            Arguments args = new Arguments();

            if (first != null)
            {
                args.Add("first", first);
            }

            if (after != null)
            {
                args.Add("after", after);
            }

            if (last != null)
            {
                args.Add("last", last);
            }

            if (before != null)
            {
                args.Add("before", before);
            }

            if (reverse != null)
            {
                args.Add("reverse", reverse);
            }

            Query.Append(args.ToString());

            Query.Append("{");
            buildQuery(new CollectionConnectionQuery(Query));
            Query.Append("}");

            return(this);
        }