@wizeworks/wize-schema-factory
v1.2.1
Published
CLI to generate GraphQL queries/mutations/subscriptions from Wize APIs.
Downloads
49
Maintainers
Readme
🚀 Usage
You can run the CLI directly using npx:
npx @wizeworks/wize-schema-factory --key YOUR-WIZE-API-KEYNote:
The--keyoption is required. You must provide your Wize API key to authenticate and fetch your GraphQL schema.
Options
| Option | Description |
|:-------|:------------|
| --key <wize-api-key> | (Required) Your Wize API key for authentication. |
| --url <api-url> | (Optional) Override the GraphQL API URL (default: https://api.wize.works/graphql). |
| --output <path> | (Optional) Directory to output generated GraphQL operations (default: ./graphql). |
| -h, --help | Display help information. |
Examples
Generate GraphQL files with default settings:
npx @wizeworks/wize-schema-factory --key YOUR-WIZE-API-KEYGenerate GraphQL files into a custom output folder:
npx @wizeworks/wize-schema-factory --key YOUR-WIZE-API-KEY --output ./generated-graphqlGenerate GraphQL files from a different Wize API endpoint:
npx @wizeworks/wize-schema-factory --key YOUR-WIZE-API-KEY --url https://api.wize.works/other-service/graphqlGenerate GraphQL files locally and run GraphQL Code Generator:
npm run build
npx node ./bin/index.js --key YOUR-WIZE-API-KEY --url https://api.wize.works/other-service/graphql Display help information:
npx @wizeworks/wize-schema-factory --helpor
npx @wizeworks/wize-schema-factory --?💠 Notes
- This tool automatically generates:
- GraphQL queries, mutations, and subscriptions
- A starter
codegen.ymlconfiguration file
- After generation, you can run GraphQL Code Generator to create typed hooks for your app:
npx graphql-codegen