Skip to content

mohameddev19/gql-extractor-vscode-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

{
  "queriesFolderName": "FOLDER_NAME",
  "typesFolderName": "FOLDER_NAME",
  "apisFolderName": "FOLDER_NAME if you set the apis option",
  "apis": "apollo",
  "fetchPolicy": "no-cache"
}

Enjoy!

About

VS Code extension to extract GraphQL queries from files and generate client-side queries and TypeScript types code for them

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy