# Configuration file

# .sgtsrc.js

Simple-graphql-to-typescript can also be used with a configuration file .sgtsrc.js at the root of your app instead of CLI options


Running sgts init will help you generate a .sgtsrc.js file for you


For the detail of each options, refer to the options page!

// .sgtsrc.js
  endpoint?: string;
  json?: string;
  output?: string;
  codegenMethods?: boolean;
  codegenReactHooks?: boolean;
  codegenVueHooks?: boolean;
  codegenTemplates?: boolean;
  customScalars?: { [x: string]: string };
  header?: string;
  prefix?: string;
  suffix?: string;
  compileToJs?: boolean;
  download?: string;

Then in you can use the command generate

sgts generate <env?>


The generate command will by default always load your .env and your .env.development file so you can use your environnement variables in your configuration file

# Environnement/Stage

The optional param of generate is a string refering to the environnement file you want to use





module.exports = {
  endpoint: process.env.API_URL,
  output: './generated.ts',
sgts generate testing