eugenekr
eugenekr

Reputation: 6602

How to generate graphql statements from aws schema.graphql using amplify

So I created schema.graphql using amplify add api command, but I said No when it offered me to generate queries, mutations and subscriptions.

Now I am wondering, how can I generate them after the fact? Or do I have to go through whole amplify add api process again?

Upvotes: 1

Views: 3995

Answers (1)

mwarger
mwarger

Reputation: 857

There is an additional command that you can use to initiate the code generation.

You can run amplify configure codegen to configure it (accepting the defaults is probably fine). Anytime after you have made schema changes, you can then run amplify codegen types to re-generate your types (make sure to run an amplify push before you do so).

More info here: https://aws-amplify.github.io/docs/cli/codegen

Upvotes: 8

Related Questions