@iexec/dataprotector
Version:
This product enables users to confidentially store data–such as mail address, documents, personal information ...
49 lines • 1.23 kB
JavaScript
import { gql } from 'graphql-request';
import { throwIfMissing } from '../../../utils/validators.js';
export async function getCollectionsByOwnerQuery({ graphQLClient = throwIfMissing(), owner, includeHiddenProtectedDatas, }) {
const collections = gql `
query {
collections(
where: {
owner: "${owner}",
}
orderBy: creationTimestamp
orderDirection: asc
) {
id
owner {
id
}
creationTimestamp
protectedDatas(
orderBy: creationTimestamp
orderDirection: desc
${!includeHiddenProtectedDatas
? 'where: {or: [{ isForSale: true }{ isRentable: true }{ isIncludedInSubscription: true }]}'
: ''}
) {
id
name
creationTimestamp
isForSale
isRentable
isIncludedInSubscription
saleParams {
id
price
}
rentalParams {
price
duration
}
rentals {
renter
endDate
}
}
}
}
`;
return graphQLClient.request(collections);
}
//# sourceMappingURL=getCollectionsByOwnerQuery.js.map