Aws-mobile-appsync-sdk-js: Library Unusable for New Typescript Projects

Created on 6 Nov 2019  路  3Comments  路  Source: awslabs/aws-mobile-appsync-sdk-js

Is there a reason the graphql dependency is still at 0.13.0? The latest version is 14.5.8, which seems crazy outdated but the first v14.0 release was cut in August 2018.

The library being so outdated is causing compilation problems for any new typescript project. It is impossible to get a new project up and running by just "npm install" 'ing the aws-appsync library.

If you would like a PR, please me know and I would be happy to put one together!

Note: Here are some of the compilation errors you will see in logs:

@project/library: node_modules/aws-appsync/node_modules/apollo-client/core/ObservableQuery.d.ts(1,30): error TS7016: Could not find a declaration file for module 'graphql'. 'node_modules/aws-appsync/node_modules/graphql/index.js' implicitly has an 'any' type.
@project/library:   Try `npm install @types/graphql` if it exists or add a new declaration (.d.ts) file containing `declare module 'graphql';`

I'll also add that you can get around this issue by including the following in your tsconfig.json:

  "compilerOptions": {
    "skipLibCheck": true
    ...
question dependencies appsync-core

Most helpful comment

Linking #482
In addition to looking at the graphql version, I also think for ease of typescript use it would help to make sure that all the needed base-types are also exported, in particularly NormalizedCacheObject

All 3 comments

I'd also note that the typescript support was released in August: https://github.com/graphql/graphql-js/releases/tag/v14.5.0

So it isn't completely egregious that aws-appsync isn't including the latest, but it is still a problem and I'm happy to help fix

Linking #482
In addition to looking at the graphql version, I also think for ease of typescript use it would help to make sure that all the needed base-types are also exported, in particularly NormalizedCacheObject

this seems to be still an issue with aws-appsync, had to go with "skipLibCheck": true option in the meantime. Hope it gets fixed soon.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

e-yoshi picture e-yoshi  路  3Comments

asadowns picture asadowns  路  3Comments

manueliglesias picture manueliglesias  路  3Comments

lklepner picture lklepner  路  4Comments

peterservisbot picture peterservisbot  路  3Comments