https://github.com/mohameddev19/gql-extractor-vscode-extension
VS Code extension to extract GraphQL queries from files and generate client-side queries and TypeScript types code for them
https://github.com/mohameddev19/gql-extractor-vscode-extension
apollo apollo-client apollo-graphql graphql graphql-api graphql-client typescript typescript-types vscode vscode-extension
Last synced: about 2 months ago
JSON representation
VS Code extension to extract GraphQL queries from files and generate client-side queries and TypeScript types code for them
- Host: GitHub
- URL: https://github.com/mohameddev19/gql-extractor-vscode-extension
- Owner: mohameddev19
- License: mit
- Created: 2023-12-02T05:39:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-28T06:02:31.000Z (10 months ago)
- Last Synced: 2024-10-18T15:34:11.477Z (8 months ago)
- Topics: apollo, apollo-client, apollo-graphql, graphql, graphql-api, graphql-client, typescript, typescript-types, vscode, vscode-extension
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=libanna.gql-extractor
- Size: 5.95 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# GraphQL Extractor
VS Code extension to extract GraphQL queries from files and generate client-side queries and TypeScript types code for them..
## Features
- Generate client queries from gql scheam
- Generate typescript types from gql scheam
- Generate apis function from gql scheam
- User can create `gql-extract.config.json` file to using some futures## Usage
Open your `workspace folder` and follow the steps:
- First step: Type `CTRL+Shift+P`.
- Second step: Type `gql extract` and press `Enter`.
- Third step: Wait while your queries files and types files to be generated.The extension wil create two folders:
1. `queries folder`: for all client queries files.
2. `types folder`: for types files.### config file
You can create `gql-extract.config.json` file in the root of your project to:
- choose where the types must be saved.
- choose where the queries must be saved.
- choose where the apis function must be saved.
- set the apis option `"apollo"` to create apis functions.
- set apollo fetchPolicy `"fetchPolicy"`, the default value is "no-cache".I'll add other apis option soon, inshallah.
Example for config file:
```json
{
"queriesFolderName": "FOLDER_NAME",
"typesFolderName": "FOLDER_NAME",
"apisFolderName": "FOLDER_NAME if you set the apis option",
"apis": "apollo",
"fetchPolicy": "no-cache"
}
```**Enjoy!**