generated from wayfair-incubator/oss-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from wayfair-incubator/mfaga-support-nested-va…
…riables
- Loading branch information
Showing
7 changed files
with
58 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,6 +238,7 @@ export default class SeedManager { | |
{ | ||
apolloServerManager, | ||
query, | ||
variables, | ||
operationName, | ||
} | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,13 +48,15 @@ function buildShorthandOverridesMap(object, metaPropertyPrefix) { | |
* @param {string} graphqlContext.operationName - GraphQL operation name | ||
* @param {ApolloServerManager} graphqlContext.apolloServerManager - ApolloServerManager instance | ||
* @param {object} options - Merge options | ||
* @param graphqlContext.variables | ||
Check warning on line 51 in src/utilities/deepMerge.ts
|
||
* @returns {object} A merged object and a list of warnings | ||
*/ | ||
async function deepMerge( | ||
source: Record<string, unknown>, | ||
seed: Record<string, unknown>, | ||
graphqlContext: { | ||
query: string; | ||
variables: Record<string, unknown>; | ||
operationName: string; | ||
apolloServerManager: ApolloServerManager; | ||
}, | ||
|
@@ -63,7 +65,7 @@ async function deepMerge( | |
data: Record<string, unknown>; | ||
warnings: string[]; | ||
}> { | ||
const {query, operationName, apolloServerManager} = graphqlContext; | ||
const {query, operationName, apolloServerManager, variables} = graphqlContext; | ||
const warnings = new Set<string>(); | ||
/** | ||
* Returns the result of merging target into source | ||
|
@@ -87,6 +89,7 @@ async function deepMerge( | |
) { | ||
source = await apolloServerManager.getNewMock({ | ||
query, | ||
variables, | ||
typeName: target.__typename, | ||
operationName, | ||
rollingKey, | ||
|
@@ -107,6 +110,7 @@ async function deepMerge( | |
// this should happen regardless of overrides | ||
const newSourceItemData = await apolloServerManager.getNewMock({ | ||
query, | ||
variables, | ||
typeName: sourceItem.__typename, | ||
operationName, | ||
rollingKey: newRollingKey, | ||
|
@@ -145,6 +149,7 @@ async function deepMerge( | |
// this should happen regardless of overrides | ||
const newSourceItemData = await apolloServerManager.getNewMock({ | ||
query, | ||
variables, | ||
typeName: sourceItem.__typename, | ||
operationName, | ||
rollingKey: newRollingKey, | ||
|