# Graphql Vercajk

> Collection of graphql tools

## Installation

```bash
npm install @coex/graphql-vercajk
```

## Usage

Create config file in your root directory:

`graphql-vercajk.config.mjs`

```js
export default {
  apiUrl: 'https://api.example.com/graphql',
  headers: {
    'X-My-Header': 'my-header-value', // Can be use for specific headers if needed
  },
  operations: {
    outDir: 'src/generated/operations',
    constraintsDirectiveName: 'permissionsConstraints',
    // mutationPrefix: 'mutation',
    // queryPrefix: 'query',
  },
  inputs: {
    outDir: 'src/generated/inputs',
    fileNamePrefix: 'input',
    constraintsDirectiveName: 'fieldConstraints',
  },
  enums: {
    outDir: 'src/generated/enums',
    fileNamePrefix: 'enum',
    typesPath: '../types',
    // postfix: '',
    // isTranslatable: true,
  },
};
```

Add script to your `package.json`:

```json
{
  "scripts": {
    "generate": "graphql-vercajk"
  }
}
```

Run script:

```bash
npm run generate
```

## Development (this repository)

Create `graphql-vercajk.config.mjs` based on _graphql-vercajk.config.sample.mjs_

And run demo:

```bash
yarn demo
```
