@shopify/graphql-testing
Advanced tools
Comparing version 0.0.0-snapshot-20230126034856 to 0.0.0-snapshot-20230126040830
@@ -42,3 +42,9 @@ 'use strict'; | ||
function variablesMatch(operationVariables, providedVariables) { | ||
return !Object.entries(providedVariables).some(([key, val]) => operationVariables[key] !== val); | ||
return Object.entries(providedVariables).every(([key, val]) => { | ||
if (val && typeof val === 'object') { | ||
return variablesMatch(operationVariables[key], val); | ||
} | ||
return operationVariables[key] === val; | ||
}); | ||
} | ||
@@ -45,0 +51,0 @@ |
@@ -10,5 +10,3 @@ import { DocumentNode } from 'graphql'; | ||
mutation?: DocumentNode; | ||
variables?: { | ||
[key: string]: string | number; | ||
}; | ||
variables?: Record<string, any>; | ||
/** | ||
@@ -15,0 +13,0 @@ * @deprecated Please use `query` or `mutation` instead. |
@@ -14,3 +14,3 @@ import { DocumentNode } from 'graphql'; | ||
}): import("graphql").OperationTypeNode; | ||
export declare function variablesMatch(operationVariables: Record<string, any>, providedVariables: NonNullable<FindOptions['variables']>): boolean; | ||
export declare function variablesMatch(operationVariables: Record<string, any>, providedVariables: NonNullable<FindOptions['variables']>): any; | ||
//# sourceMappingURL=utilities.d.ts.map |
{ | ||
"name": "@shopify/graphql-testing", | ||
"version": "0.0.0-snapshot-20230126034856", | ||
"version": "0.0.0-snapshot-20230126040830", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Utilities to create mock GraphQL factories", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66576
915