0

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:

enter image description here

Steps to Replicate (in terminal of course):

  1. ng new angular-apollo --routing true --style scss
  2. cd angular-apollo
  3. ng add apollo-angular // follow the wizard, up to here installs the angular apollo
  4. npm install graphql
  5. npm install -D typescript
  6. npm install -D @graphql-codegen/cli
  7. npx graphql-code-generator init // follow the wizard using default values
  8. npm install
  9. 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?

Aeseir
  • 7,754
  • 10
  • 58
  • 107

0 Answers0