From feb43f8349ddc2ffd3c1dcec9bc756a9a1c8ce21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Gandecki?= <4002543+lgandecki@users.noreply.github.com> Date: Sun, 31 Jan 2021 17:28:34 +0100 Subject: [PATCH] fix: use correct graphql version, fix for joining modulePaths, dont create context.ts twice (#733) --- scaffold/package.json | 2 +- src/commands/init.ts | 4 +++- src/generate/generate-module.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scaffold/package.json b/scaffold/package.json index e08d3e15..c8075a34 100644 --- a/scaffold/package.json +++ b/scaffold/package.json @@ -29,7 +29,7 @@ "apollo-server-express": "2.16.1", "cookie-parser": "1.4.5", "express": "4.17.1", - "graphql": "15.3.0", + "graphql": "15.5.0", "graphql-tag": "2.11.0", "lodash": "4.17.19", "portable-fetch": "3.0.0", diff --git a/src/commands/init.ts b/src/commands/init.ts index 21ec02c7..d5463e36 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -88,6 +88,8 @@ const addProjectDependencies = async (projectMainPath: string, modulesPath: stri // TODO shelljs? ? addDependenciesWithMatchingVersions(['@apollo/federation', 'lodash', 'graphql-tag', 'tsconfig-paths']); + packageJsonFile.dependencies.graphql = scaffoldPackageJsonFile.dependencies.graphql; + debug('saving package.json changes'); await fs.promises.writeFile(packageJsonPath, JSON.stringify(packageJsonFile, null, 2)); // TODO prettify the file @@ -207,7 +209,7 @@ export default class Init extends Command { newTask('Configure tsconfig.json', async () => configureTsconfig(projectMainPath)), newTask('Configure jest', async () => configureJest(projectMainPath)), newTask('Add empty GraphQL context file', async () => addContext(projectMainPath)), - newTask('Install packages', async () => addContext(projectMainPath)), + // newTask('Install packages', async () => addContext(projectMainPath)), ], { renderer: ListrRenderer }, ); diff --git a/src/generate/generate-module.ts b/src/generate/generate-module.ts index a15c38a6..346c5cf0 100755 --- a/src/generate/generate-module.ts +++ b/src/generate/generate-module.ts @@ -85,7 +85,7 @@ export const executeGeneration = async (appPrefix = '~app', generatedPrefix = '~ debug('createGetCodegenConfig'); createGetCodegenConfig(); const modulesResolvedPath = path.join(projectMainPath, modulesPath); - const graphqlPaths = shelljs.ls(`${modulesResolvedPath}**/*.graphql`); + const graphqlPaths = shelljs.ls(path.join(modulesResolvedPath, '**/*.graphql')); const moduleNames = getModuleNames(graphqlPaths, projectMainPath); const modules = getModuleInfos(moduleNames);