
* tests for updating & deleting collections and categories * add empty spaces * fix create category
26 lines
587 B
JavaScript
26 lines
587 B
JavaScript
import { getValueWithDefault } from "../utils/Utils";
|
|
|
|
export function getCollection({ collectionId, channelSlug, auth = "token" }) {
|
|
const channelLine = getValueWithDefault(
|
|
channelSlug,
|
|
`channel: "${channelSlug}"`
|
|
);
|
|
const query = `query Collection{
|
|
collection(id: "${collectionId}" ${channelLine}) {
|
|
id
|
|
slug
|
|
name
|
|
description
|
|
products(first:100){
|
|
totalCount
|
|
edges{
|
|
node{
|
|
id
|
|
name
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}`;
|
|
return cy.sendRequestWithQuery(query, auth).its("body.data");
|
|
}
|