Skip to content

Commit

Permalink
fix: use correct graphql version, fix for joining modulePaths, dont c…
Browse files Browse the repository at this point in the history
…reate context.ts twice (#733)
  • Loading branch information
lgandecki authored Jan 31, 2021
1 parent 2aa1d21 commit feb43f8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scaffold/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 },
);
Expand Down
2 changes: 1 addition & 1 deletion src/generate/generate-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit feb43f8

Please sign in to comment.