dotansimha / dotansimha/graphql-code-generator-community
Missing dependency: @graphql-tools/apollo-engine-loader
- Dominant language
- TypeScript
- Stars
- 137
- Forks
- 195
- Avg merge
- 6h 20m
- Merged PRs (30d)
- 16
Description
### Describe the bug
Package `@graphql-codegen/plugin-helpers` has a dependency on `@graphql-tools/apollo-engine-loader`.
File:
https://github.com/dotansimha/graphql-code-generator/blob/master/packages/utils/plugins-helpers/src/types.ts
Line 4:
import type { ApolloEngineOptions } from '@graphql-tools/apollo-engine-loader';
It is declared in package.json as a devDependency. But it does not get installed when I check out and install my plugin project (https://github.com/klaudhaus/graphqlex-codegen). So I have to install it directly as a dependency in my project before I can run `tsc`, even though I have no direct dependency on it.
Tested with both `npm` and `pnpm` clients.
Dev dependency would seem reasonable for something only used as a type import, but at least in this case it breaks the plugin project's compilation, as well as any downstream project that uses it. I've come across similar in some of my own projects and had to declare as both `devDependency` and `peerDependency`. Although in this case, as multiple versions of this lib won't cause issues (it's not loaded at runtime) moving it to dependencies could be a pragmatic option.
### Your Example Website or App
https://github.com/klaudhaus/graphqlex-codegen
### Steps to Reproduce the Bug or Issue
git clone https://github.com/klaudhaus/graphqlex-codegen
then either:
npm install
or
pnpm install
### Expected behavior
Install package, reference in my project and compile.
### Screenshots or Videos
_No response_
### Platform
- OS: macOS
- NodeJS: 18.12.0
- `graphql` version: Not in this project
- `@graphql-codegen/*` version(s):
plugin-helpers: 2.7.1
visitor-plugin-common: 2.13.0
### Codegen Config File
_No response_
### Additional context
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.