Lint all the things
This commit is contained in:
@@ -2,8 +2,6 @@ import { gql } from "@apollo/client";
|
||||
import { Kind, parse, print, visit } from "graphql";
|
||||
import client from "./GraphQLClient";
|
||||
|
||||
/* eslint-disable no-loop-func */
|
||||
|
||||
/**
|
||||
* The available operators for filtering (string)
|
||||
* @type {[{label: string, value: string},{label: string, value: string},{label: string, value: string},{label: string, value: string},{label: string, value: string},null,null,null]}
|
||||
@@ -117,7 +115,12 @@ export function printQuery(query) {
|
||||
* @param shopSpecificTemplate
|
||||
* @returns {Promise<{contextData: {}, useShopSpecificTemplate, shopSpecificTemplate}>}
|
||||
*/
|
||||
export async function generateTemplate(templateQueryToExecute, templateObject, useShopSpecificTemplate, shopSpecificFolder) {
|
||||
export async function generateTemplate(
|
||||
templateQueryToExecute,
|
||||
templateObject,
|
||||
useShopSpecificTemplate,
|
||||
shopSpecificFolder
|
||||
) {
|
||||
// Advanced Filtering and Sorting modifications start here
|
||||
|
||||
// Parse the query and apply the filters and sorters
|
||||
@@ -242,7 +245,7 @@ function applyTopLevelSub(node, fieldPath, filterField) {
|
||||
if (fieldPath.length > 2) {
|
||||
// More than one level deep
|
||||
let currentField = whereArg.value;
|
||||
fieldPath.slice(1, -1).forEach((path, index) => {
|
||||
fieldPath.slice(1, -1).forEach((path) => {
|
||||
let existingField = currentField.fields.find((f) => f.name.value === path);
|
||||
if (!existingField) {
|
||||
existingField = {
|
||||
@@ -382,7 +385,7 @@ function applyTopLevelFilter(node, fieldPath, filterField) {
|
||||
if (fieldPath.length > 2) {
|
||||
// More than one level deep
|
||||
let currentField = whereArg.value;
|
||||
fieldPath.slice(1, -1).forEach((path, index) => {
|
||||
fieldPath.slice(1, -1).forEach((path) => {
|
||||
let existingField = currentField.fields.find((f) => f.name.value === path);
|
||||
if (!existingField) {
|
||||
existingField = {
|
||||
@@ -468,5 +471,3 @@ function getGraphQLKind(value) {
|
||||
return Kind.STRING; // GraphQL does not have a Date type, so we return it as a string
|
||||
}
|
||||
}
|
||||
|
||||
/* eslint-enable no-loop-func */
|
||||
|
||||
Reference in New Issue
Block a user