If the automatic type generation inside of the container fails to pick up your changes use these steps to generate them manually:
docker exec -it dams-graphql-1 ash- Go to the app directory:
cd ../ pnpm run generate(this also works in the inuits-dams-graphql-service directory but is only for use inside of the pipelines)
Follow these steps to publish a package to nexus for use in graphql pipeline:
- Bump
package.jsonversion - Commit new
package.jsonand other changes inside the graphql module - The gitlab pipeline should start running where the npm package gets built and published to nexus automatically
Follow these steps to publish a package to nexus for use in graphql pipeline:
- Change the
mainentry underpublishConfiginside of thepackage.jsonto./dist/modules/{moduleDirectoryName}/{moduleFileName}.js(Do not commit) pnpm run generatefrom the inuits-dams-frontend directorypnpm run buildfrom in the directory of the module you want to publish- Bump
package.jsonversion - Commit new
package.jsonand other changes inside the graphql module pnpm publish
To add the gitlab pipeline (example project) where the npm package gets automatically built and published to nexus follow these steps:
- package.json: dependencies + update publishConfig/main
- tsconfig.json: add baseUrl and paths
- add the gitlab-ci.yml & change the graphql image path to the correct customer
- rename graphqlModules => graphql-modules etc.
- the following dependencies are needed to be able to run the graphql types:
"base-graphql": "*", "@graphql-codegen/add": "^3.2.1", "@graphql-codegen/cli": "^2.16.5", "@graphql-codegen/graphql-modules-preset": "^2.5.12", "@graphql-codegen/typed-document-node": "2.3.13", "@graphql-codegen/typescript": "^2.8.8", "@graphql-codegen/typescript-operations": "^2.5.13", "@graphql-codegen/typescript-resolvers": "^2.7.13", "@types/node": "^18.11.14", "typescript": "^4.3.5", "graphql": "^16.6.0"