UNPKG

@iexec/dataprotector

Version:

This product enables users to confidentially store data–such as mail address, documents, personal information ...

33 lines 955 B
import { gql } from 'graphql-request'; import { throwIfMissing } from '../../../utils/validators.js'; export const getRentalsQuery = async ({ graphQLClient = throwIfMissing(), renterAddress, protectedData, includePastRentals = false, }) => { const rentalsQuery = gql ` query ($where: Rental_filter) { rentals(where: $where) { id renter protectedData { id name } creationTimestamp endDate rentalParams { price duration } } } `; const variables = { where: { renter: renterAddress || undefined, protectedData: protectedData || undefined, endDate_gte: includePastRentals ? undefined : Math.floor(new Date().getTime() / 1000), }, }; return graphQLClient.request(rentalsQuery, variables); }; //# sourceMappingURL=getRentalsQuery.js.map