aws-amplify / amplify-category-api

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development. This plugin provides functionality for the API category, allowing for the creation and management of GraphQL and REST based backends for your amplify project.
https://docs.amplify.aws/
Apache License 2.0
88 stars 76 forks source link

codegen doesn't include AppSync types #304

Open roballsopp opened 4 years ago

roballsopp commented 4 years ago

I'm using the JS GraphQL plugin for IntelliJ, and I can't get proper code highlighting/completion in my graphql because amplify codegen (and it seems the aws appsync get-introspection-schema command as well) doesn't generate the AWS scalar types in my schema.json file that it needs for the createdAt and updatedAt fields it adds automatically to each model.

image

This seems to totally blow up code assistance for all my types when I use them in my code

image

I'm also using the IntrospectionFragmentMatcher in Apollo, and worried there might be issues with an incomplete schema.

If I do the introspection with something like GraphQL Playground, I see the true full schema with a bunch of directives and the AWSDateTime scalar:

image

It would be really nice if codegen brought the full introspection schema down, or at least the scalars appsync automatically adds.

Is amplify codegen using aws appsync get-introspection-schema under the hood? If so, I'll happily post this in some aws-cli/appsync specific forum.

nikhname commented 4 years ago

@roballsopp which version of the CLI are you using?

roballsopp commented 4 years ago

Sorry, cli version 4.21.0

jorge-riberi commented 4 years ago

Hi! Any news of this?

teggno commented 3 years ago

I found that you can run amplify codegen model to re-generate the index.d.ts and the schema.js. The model option should be added to the docs of the amplify codegen command, I think.