I've build a test angular app that I want to try Apollo graph with, particularly apollo graph codegen feature.
I've followed instructions to the tee on the Apollo site: Apollo Angular - https://www.the-guild.dev/graphql/apollo-angular/docs/get-started Apollo Angular Codegen - https://the-guild.dev/graphql/codegen/docs/getting-started/installation
and it results in error:
Steps to Replicate (in terminal of course):
- ng new angular-apollo --routing true --style scss
- cd angular-apollo
- ng add apollo-angular // follow the wizard, up to here installs the angular apollo
- npm install graphql
- npm install -D typescript
- npm install -D @graphql-codegen/cli
- npx graphql-code-generator init // follow the wizard using default values
- npm install
- npm run codegen
Final codegen.ts
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
overwrite: true,
schema: "https://localhost:49001/api/graphql",
documents: "src/**/*.ts",
generates: {
"src/generated/graphql.ts": {
plugins: ["typescript-apollo-angular"]
}
}
};
export default config;
End up with error above. Honestly not sure what i am doing wrong here.
Am I missing something?