--- title: app function schema description: >- Generates the latest [GraphQL schema](/docs/apps/functions/input-output#graphql-schema) for a function in your app. Run this command from the function directory. This command uses the API type and version of your function, as defined in your extension TOML file, to generate the latest GraphQL schema. The schema is written to the `schema.graphql` file. api_name: shopify-cli source_url: html: 'https://shopify.dev/docs/api/shopify-cli/app/app-function-schema' md: 'https://shopify.dev/docs/api/shopify-cli/app/app-function-schema.md' --- # app function schema Generates the latest [GraphQL schema](https://shopify.dev/docs/apps/functions/input-output#graphql-schema) for a function in your app. Run this command from the function directory. This command uses the API type and version of your function, as defined in your extension TOML file, to generate the latest GraphQL schema. The schema is written to the `schema.graphql` file. ## Flags The following flags are available for the `app function schema` command: * **--client-id \** **string** **env: SHOPIFY\_FLAG\_CLIENT\_ID** The Client ID of your app. * **--no-color** **env: SHOPIFY\_FLAG\_NO\_COLOR** Disable color output. * **--path \** **string** **env: SHOPIFY\_FLAG\_PATH** The path to your function directory. * **--reset** **env: SHOPIFY\_FLAG\_RESET** Reset all your settings. * **--stdout** **env: SHOPIFY\_FLAG\_STDOUT** Output the schema to stdout instead of writing to a file. * **--verbose** **env: SHOPIFY\_FLAG\_VERBOSE** Increase the verbosity of the output. * **-c, --config \** **string** **env: SHOPIFY\_FLAG\_APP\_CONFIG** The name of the app configuration. Examples ### Examples * #### app function schema ##### app function schema ```bash shopify app function schema [flags] ```