hi, i am trying to add this graphql query in a graphql node in n8n but i am ending up with a syntax error:
Invalid Syntax : There are more tokens in the query that have not been consumed offending token ‘$’ at line 1 column 1495
query GetDashBoardData(
$source: SourceEnum!
$twoWeeksFilter: OrderDataFilter
$oneDayFilter: OrderDataFilter
$oneMonthFilter: OrderDataFilter
$oneWeekFilter: OrderDataFilter
$startDate: String!
$endDate: String!
) {
ordersForPastTwoWeeks: allOrders(source: $source, filter: $twoWeeksFilter) {
…OrderShort_part
}
ordersForPastMonth: allOrders(source: $source, filter: $oneMonthFilter) {
…OrderShort_part
customer {
…CustomerInitials_part
}
}
ordersForPastWeek: allOrders(source: $source, filter: $oneWeekFilter) {
…OrderShort_part
customer {
…CustomerInitials_part
}
}
orderStatisticsForPastMonth: orderStatistics(
source: $source
startDate: $startDate
endDate: $endDate
) {
date
totalSales
}
monthlySales: orderStatisticsByMonth(source: $source) {
date
ordersNumber
}
ordersForDay: allOrders(source: $source, filter: $oneDayFilter) {
…OrderShort_part
customer {
…CustomerInitials_part
}
}
ordersToShip: allOrders(source: $source, filter: { orderState: { sign: EQ, value: 1 } }) {
orderDataId
}
bestSellers: top10OrderedProductsForMarketplace(source: $source) {
code
title
}
auctionReports: getBidAuctionsReport {
…BidAuctionReport_part
}
recentOrders: orders(source: $source, beginIndex: 0, maxResult: 10) {
customer {
firstName
lastName
email
}
createTime
}
inventoriesWithNoStock: getInventoriesTotal(filter: { inStock: { sign: EQ, value: 0 } })
}
${OrderShortFragment}
${CustomerInitialsFragment}
${BidAuctionReportFragment}
OrderShortFragment =
fragment OrderShort_part on OrderData {
orderDataId
orderId
vendorId
createTime
updateTime
total
orderStateValue
orderState
payTotal
commission
}
CustomerInitialsFragment =
fragment CustomerInitials_part on Customer {
id
firstName
lastName
email
}
BidAuctionReportFragment =
fragment BidAuctionReport_part on BidAuctionReport {
paidPercent
unpaid
raised
products
bidAuction {
auctionCode
}
}
i am pretty sure our query is correct but it seems the node cannot render a proper json output for this