#How to compile graphql schema without amplify init or pulling from API?

3 messages · Page 1 of 1 (latest)

trim drift
#

I want to compile the schema into one without the directives via amplify api gql-compile but this requires passing in the apiId which I want to avoid. The purpose of this is to then be able to run amplify codegen statements/types

lilac palm
#

You can generate the types and models if needed with one of these commands:

amplify api gql-compile
amplify codegen
amplify codegen models
#

I have them all chained in a script called "gql" in my package.json file for quick rebuilding when I add something to my schema and want to code towards to straight away, hope it helps:

"scripts: {
    "gql": "amplify api gql-compile && amplify codegen && amplify codegen models",
}