[
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\n\n---\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n**Screenshots**\nIf applicable, add screenshots to help explain your problem.\n\n**Versions (please complete the following information):**\n - OS: [e.g. `Windows 10`, `OS X High Sierra`, `Ubuntu 16.04`] \n - `graphql-cli`: [e.g. `2.16.5`]\n - other packages if applicable\n\n**Additional context**\nAdd any other context about the problem here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\n\n---\n\n**Is your feature request related to a problem? Please describe.**\nA clear and concise description of what the problem is. Ex. I'm always frustrated when [...]\n\n**Describe the solution you'd like**\nA clear and concise description of what you want to happen.\n\n**Describe alternatives you've considered**\nA clear and concise description of any alternative solutions or features you've considered.\n\n**Additional context**\nAdd any other context or screenshots about the feature request here.\n"
  },
  {
    "path": ".github/workflows/algolia-integrity.yml",
    "content": "name: Algolia Integrity\non:\n  pull_request:\n    paths:\n      - 'website/**'\njobs:\n  algolia-records-check:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout\n        uses: actions/checkout@v3\n        with:\n          fetch-depth: 0\n      - name: Use Node 18\n        uses: actions/setup-node@v3\n        with:\n          node-version: 16\n          cache: 'yarn'\n      - name: Install Dependencies\n        run: yarn --ignore-engines\n        working-directory: ./website\n\n      - name: Build Packages\n        run: yarn build\n        working-directory: ./website\n\n      - name: Algolia generate\n        run: yarn algolia-sync\n        working-directory: ./website\n        env:\n          ALGOLIA_DRY_RUN: true\n          SITE_URL: https://www.graphql-cli.com/\n\n      - name: Yarn build at root\n        run: yarn\n\n      - name: Prettier\n        run: yarn prettier -w website/algolia-lockfile.json\n\n      - name: Compare\n        run: git diff origin/${{ github.base_ref }}.. -- website/algolia-lockfile.json\n\n      - name: Diff to file\n        if: always()\n        id: diff_result\n        run: |\n          OUTPUT=$(git diff origin/${{ github.base_ref }}.. -- website/algolia-lockfile.json)\n          OUTPUT=\"${OUTPUT//'%'/'%25'}\"\n          OUTPUT=\"${OUTPUT//$'\\n'/'%0A'}\"\n          OUTPUT=\"${OUTPUT//$'\\r'/'%0D'}\"\n          echo \"::set-output name=result::$OUTPUT\"\n\n      - name: Publish a message\n        if: always() && contains(steps.diff_result.outputs.result, 'diff')\n        uses: marocchino/sticky-pull-request-comment@v2\n        with:\n          message: |\n            ```diff\n            ${{ steps.diff_result.outputs.result }}\n            ```\n"
  },
  {
    "path": ".github/workflows/algolia-publish.yml",
    "content": "name: Algolia Publish\n\non:\n  push:\n    branches:\n      - master\n\njobs:\n  algolia-push-records:\n    name: Push new records if changes\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Repo\n        uses: actions/checkout@v3\n\n      - name: Use Node\n        uses: actions/setup-node@v3\n        with:\n          node-version: 16\n          cache: 'yarn'\n\n      - name: Install Dependencies\n        run: yarn\n        working-directory: ./website\n\n      - name: Build Packages\n        run: yarn build\n        working-directory: ./website\n\n      - name: Algolia push\n        run: yarn algolia-sync\n        working-directory: ./website\n        env:\n          ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}\n          ALGOLIA_ADMIN_API_KEY: ${{ secrets.ALGOLIA_ADMIN_API_KEY }}\n          ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME }}\n          SITE_URL: https://www.graphql-cli.com/\n\n      - name: Yarn build at root\n        run: yarn\n\n      - name: Prettier\n        run: yarn prettier -w website/algolia-lockfile.json\n\n      - name: Compare\n        run: git diff website/algolia-lockfile.json\n\n      - name: Diff to file\n        if: always()\n        id: diff_result\n        run: |\n          OUTPUT=$(git diff website/algolia-lockfile.json)\n          OUTPUT=\"${OUTPUT//'%'/'%25'}\"\n          OUTPUT=\"${OUTPUT//$'\\n'/'%0A'}\"\n          OUTPUT=\"${OUTPUT//$'\\r'/'%0D'}\"\n          echo \"::set-output name=result::$OUTPUT\"\n\n      - name: Commit algolia-lockfile.json\n        if: always() && contains(steps.diff_result.outputs.result, 'diff')\n        uses: EndBug/add-and-commit@v9\n        with:\n          commit: website/algolia-lockfile.json\n          message: Update algolia-lockfile.json\n          default_author: github_actions\n"
  },
  {
    "path": ".github/workflows/main.yml",
    "content": "name: CI\n\non:\n  push:\n    branches:\n      - master\n  pull_request:\n    branches:\n      - master\n  release:\n    types: [released, prereleased]\n\njobs:\n  test:\n    name: Testing on ${{matrix.os}} and Node ${{matrix.node_version}}\n    runs-on: ${{matrix.os}}\n    strategy:\n      matrix:\n        os: [ubuntu-latest, windows-latest]\n        node_version: [12, 14, 16]\n    steps:\n      - name: Checkout Master\n        uses: actions/checkout@v2\n      - name: Use Node ${{matrix.node_version}}\n        uses: actions/setup-node@master\n        with:\n          version: ${{ matrix.node_version }}\n      - name: Install Dependencies using Yarn\n        run: yarn --ignore-engines\n      - name: Build\n        run: yarn build\n      - name: Test\n        run: yarn test\n\n  publish-canary:\n    name: Publish Canary\n    runs-on: ubuntu-latest\n    if: ${{ github.event_name != 'release' }}\n    steps:\n      - name: Checkout Master\n        uses: actions/checkout@v2\n      - name: Use Node\n        uses: actions/setup-node@v2\n        with:\n          node-version: 14\n      - name: Install Dependencies using Yarn\n        run: yarn --ignore-engines\n      - name: Build\n        run: yarn build\n      - name: Release Canary\n        run: |\n          echo \"Fork PR: ${{github.repository}}\"\n          if [ \"${{github.repository}}\" == \"Urigo/graphql-cli\" ] && [ \"${{ secrets.NODE_AUTH_TOKEN }}\" != \"\" ]\n          then\n              echo \"//registry.npmjs.org/:_authToken=${{ secrets.NODE_AUTH_TOKEN }}\" > .npmrc\n              npm run release:canary\n          else    \n              echo \"Skipping canary publish due to a fork/PR...\"\n          fi\n\n  publish:\n    # publish to npm only when doing the release\n    if: ${{ github.event_name == 'release' }}\n    name: Publish Release\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Master\n        uses: actions/checkout@v2\n      - name: Use Node\n        uses: actions/setup-node@v2\n        with:\n          node-version: 14\n      - name: Install Dependencies using Yarn\n        run: yarn --ignore-engines\n      - name: Build\n        run: yarn build\n      - name: Release\n        run: echo \"//registry.npmjs.org/:_authToken=${{secrets.NODE_AUTH_TOKEN}}\" > ~/.npmrc && TAG=${GITHUB_REF#\"refs/tags/\"} npm run release\n"
  },
  {
    "path": ".github/workflows/website.yml",
    "content": "name: Website Deployment\non:\n  push:\n    branches:\n      - master\n\njobs:\n  deploy-website:\n    name: Deploy Website\n    timeout-minutes: 60\n    runs-on: ubuntu-latest\n    if: contains(github.event.head_commit.message, '[deploy_website]') || contains(github.ref, 'refs/tags/')\n    steps:\n      - name: Checkout Master\n        uses: actions/checkout@v2\n      - name: Configure Git Credientials\n        run: |\n          git config --global user.email \"${{github.actor}}@users.noreply.github.com\"\n          git config --global user.name \"${{github.actor}}\"\n          echo \"machine github.com login ${{github.actor}} password ${{secrets.GITHUB_TOKEN}}\" > ~/.netrc\n      - name: Add origin remote and refetch master\n        run: |\n          git remote rm origin\n          git remote add origin \"https://github.com/${{github.repository}}\"\n          git fetch\n          git checkout master\n          git reset --hard\n      - name: Use Node\n        uses: actions/setup-node@v2\n        with:\n          node-version: '14.x'\n      - name: Install Dependencies using Yarn\n        run: yarn install --ignore-engines --frozen-lockfile\n      - name: Deploy 🚀\n        run: yarn deploy:website\n        env:\n          GIT_USER: ${{github.actor}}\n          NEXT_PUBLIC_ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}\n          NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY: a5522203ca95675199cc21edf09e6d75\n          NEXT_PUBLIC_ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME }}\n"
  },
  {
    "path": ".gitignore",
    "content": "# Logs\nlogs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n\n# Runtime data\npids\n*.pid\n*.seed\n*.pid.lock\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# Bower dependency directory (https://bower.io/)\nbower_components\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (https://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\nnode_modules/\njspm_packages/\n\n# TypeScript v1 declaration files\ntypings/\n\n# Optional npm cache directory\n.npm\n\n# Optional eslint cache\n.eslintcache\n\n# Optional REPL history\n.node_repl_history\n\n# Output of 'npm pack'\n*.tgz\n\n# Yarn Integrity file\n.yarn-integrity\n\n# dotenv environment variables file\n.env\n\n# next.js build output\n.next\n\npackage-lock.json\n"
  },
  {
    "path": ".npmrc",
    "content": "save-exact=true"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing guide\n\nWe are using Yarn workspaces, so make sure you have the latest version of Yarn installed.\n\n## Building project\n\nTo build the entire monorepo, start by installing the dependencies by running `yarn` in the root directory, and then:\n\n```sh\nyarn build\n```\n\n## Using command line tool from source\n\n```sh\ncd packages/cli\nnpm link .\n```\n\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2019 Dotan Simha\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# GraphQL CLI\n\n![image](https://user-images.githubusercontent.com/20847995/67651234-85bf1500-f916-11e9-90e5-cb3bd0e6a338.png)\n\n![CI](https://github.com/Urigo/graphql-cli/workflows/CI/badge.svg)\n[![npm version](http://img.shields.io/npm/v/graphql-cli.svg?style=flat)](https://npmjs.org/package/graphql-cli \"View this project on npm\") [![Discord Chat](https://img.shields.io/discord/625400653321076807)](https://the-guild.dev/discord)\n\nHelp us to improve new GraphQL CLI. Check out the new structure and commands below!\nFeel free to contact us in Discord channel. We would love to hear your feedback.\n\n## Features\n\n- Helpful commands to improve your workflows\n- Compatible with editors and IDEs based on [`graphql-config`](https://github.com/kamilkisiela/graphql-config)\n- Powerful plugin system to extend `graphql-cli` with custom commands\n\n## Install\n\nYou can install the CLI using `yarn` by running the following command. This will add the `graphql` binary to your path.\n\n```sh\nyarn global add graphql-cli\n```\n\nThe equivalent npm global install will also work.\n\n## Migration from 3.x.x to 4.x.x\n\n**Important: many aspects of GraphQL CLI syntax and structure have changed in 4.x.x.** Please check out the [Migration Guide](./docs/MIGRATION.md) to learn more.\n\n## Usage / Initialization\n\nAt the heart of a project created using GraphQL CLI is the GraphQL Config configuration file. For starters, this configuration lets the cd CLI tools know where all of the GraphQL documents and operations are. For more information about GraphQL Config, [you can click here to learn more](https://graphql-config.com/docs/introduction).\n\nThe most straightforward way to launch a GraphQL CLI-capable project with a working GraphQL Config setup is to use the `init` command from your desired workspace:\n\n```sh\nnpx graphql-cli init\n```\n\nAfter a series of questions from the command-prompt, the system will use the inputs and selected project templates to generate a working project complete with a GraphQL Config setup. The GraphQL Config file is generated referencing the necessary files and ecosystem plugins.\n\nYou can also get started with GraphQL CLI by creating your own GraphQL Config file using an editor of your choice. Starting with a filename `.graphqlrc.yml`, for instance, we could add:\n\n```yml\nschema: \"server/src/schema/**/*.graphql\"\ndocuments: \"client/src/documents/**/*.graphql\"\n```\n\nThis is now a valid YAML-syntax GraphQL Config file. Using `init` from the GraphQL CLI will generate a project based on the instructions in your YAML.\n\nFinally, one of the options with `graphql init` is to access schema using an OpenAPI or Swagger endpoint. Choose this option at the start of the Init question tree, and then follow the instructions to navigate to the URL of your choice.\n\n## Plugin System\n\nEach command in GraphQL CLI is a seperate package, so you can have your own plugins or use the ones we maintain. You can have those commands by installing them like `@graphql-cli/[COMMAND-NAME]`.\n\nTo configure a command/plugin, you need to update the `extensions` field in your GraphQL Config file (`.graphqlrc.yml`). See `extensions:` in the example below.\n\n```yml\nschema: \n  ./server/src/schema/**/*.ts:\n    require: ts-node/register\ndocuments: ./client/src/graphql/**/*.ts\nextensions:\n  codegen:\n    generates:\n      ./server/src/generated-types.d.ts:\n        plugins:\n          - typescript\n          - typescript-resolvers\n      ./client/src/generated-types.tsx:\n        plugins:\n          - typescript\n          - typescript-operations\n          - typescript-react-apollo\n      config:\n        withHooks: true\n  graphback:\n    model: './model/*.graphql'\n    plugins:\n      graphback-schema:\n        outputPath: './src/schema/schema.graphql'\n      ...\n```\n  \n [For a detailed example check out a template file here.](https://github.com/Urigo/graphql-cli/blob/master/templates/fullstack/.graphqlrc.yml)\n\nSome of the available Plugins are:\n\n- [`init`](https://github.com/Urigo/graphql-cli/tree/focs/packages/commands/init) - Creates a GraphQL project using a template or GraphQL Config file for your existing project.\n- [`codegen`](https://github.com/dotansimha/graphql-code-generator/tree/master/packages/graphql-cli-codegen-plugin) - GraphQL Code Generator's GraphQL CLI plugin. GraphQL Code Generator is a tool that generates code from your GraphQL schema and documents for your backend or frontend with flexible support for custom plugins and templates. [Learn More](https://graphql-code-generator.com)\n- [`generate`](https://github.com/Urigo/graphql-cli/tree/master/packages/commands/generate) - Generate schema and client-side documents for your GraphQL project by using [Graphback](https://graphback.dev).\n- [`coverage`](https://github.com/kamilkisiela/graphql-inspector/tree/master/packages/graphql-cli/coverage) - Schema coverage based on documents. Find out how many times types and fields are used in your application using [GraphQL Inspector](https://graphql-inspector.com/docs/essentials/coverage).\n- [`diff`](https://github.com/kamilkisiela/graphql-inspector/tree/master/packages/graphql-cli/diff) - Compares schemas and finds breaking or dangerous changes using [GraphQL Inspector](https://graphql-inspector.com/docs/essentials/diff).\n    - You can also compare your current schema against a base schema using URL, Git link and local file. You can give this pointer in the command line after `graphql diff` or in GraphQL Config file:\n\n```yml\n# ...\nextensions:\n  diff:\n    baseSchema: git:origin/master:schema.graphql\n```\n\n- [`similar`]((https://github.com/kamilkisiela/graphql-inspector/tree/master/packages/graphql-cli/similar)) - Get a list of similar types in order to find duplicates using [GraphQL Inspector](https://graphql-inspector.com/docs/essentials/similar).\n- [`validate`]((https://github.com/kamilkisiela/graphql-inspector/tree/master/packages/graphql-cli/validate)) - Validates documents against a schema and looks for deprecated usage using [GraphQL Inspector](https://graphql-inspector.com/docs/essentials/validate).\n- [`serve`](https://github.com/Urigo/graphql-cli/tree/master/packages/commands/serve) - Serves a GraphQL server, using an in memory database and a defined GraphQL schema. Please read through [serve documentation](./website/docs/command-serve.md) to learn more about this command.\n\nMore plugins are definitely welcome! Please check the existing ones to see how to use GraphQL Config and GraphQL CLI API.\n\n## Contributing\n\nPlease read through the [contributing guidelines](./CONTRIBUTING.md)\n\n## Writing your own plugin\n\nGraphQL CLI supports custom plugins, [you can find a tutorial and example here](./docs/CUSTOM_EXTENSION.md)\n\n## Help & Community [![Discord Chat](https://img.shields.io/discord/625400653321076807)](https://the-guild.dev/discord)\n\nJoin our [Discord chat](https://the-guild.dev/discord) if you run into issues or have questions. We're excited to welcome you to the community!\n"
  },
  {
    "path": "docs/CUSTOM_EXTENSION.md",
    "content": "## Writing your own GraphQL-CLI Extension\n\n`graphql-cli` allow you to write your own plugin/extenion, and intergrate external tools and configuration, and run it from a single CLI.\n\nThe current implementation of `graphql-cli` is using [Yargs](https://yargs.js.org/) to manage it's CLI commands.\n\nPlugins and extension are treated as NodeJS module by the `graphql-cli`, so it means you can use JavaScript/TypeScript/Any other super-set of JavaScript to write your extension. It means that you plugin will be loaded by it's name under `node_modules` - for example `graphql-cli my-custom-plugin ...`.\n\n`graphql-cli` also supports `graphql-config`, so it can help you easily load your GraphQL schema, operations and configuration from a unified config file.\n\n> If you are wrapping an existing tool that has it's own CLI already, consider to expose a programatic API so it will be easier to consume.\n\n### TL;DR\n\nWe have a ready-to-use boilerplate for that purpose, [you can find it here](https://github.com/dotansimha/graphql-cli-plugin-example).\n\nAlso, inside this repo, under `packages/commands` you can find a set of plugins implementation you can use as reference.\n\n### Getting Started\n\nStart by creating a simple JavaScript/TypeScript project, according to your preference. Install `@graphql-cli/common` package and use `defineCommand` utility in your entry point (usually `index` file):\n\n```ts\nimport { defineCommand } from '@graphql-cli/common';\n\nexport default defineCommand((api) => {\n  return {};\n});\n```\n\nTo register your CLI command, give it a name first. Use the `command` property:\n\n```ts\nexport default defineCommand((api) => {\n  return {\n    command: 'my-plugin',\n    async handler() {\n      // code here\n    },\n  };\n});\n```\n\nNow, your plugin will be avaiable to use with the following command: `graphql my-plugin`.\n\nYou can also add custom validations, flags, default values and much more with Yargs. [You can read the documentation here](https://yargs.js.org/docs/#api-commandcmd-desc-module).\n\n## Testing your plugin locally\n\nTo test your plugin locally, install `graphql-cli` in your project as a `devDependency`, and run the following command:\n\n```\ngraphql ./src/index.js\n```\n\nIf you registerd sub-commands, you should be able to run those this way:\n\n```\ngraphql ./src/index.js do-something\n```\n\n> The path should point to the entry point of your script, and if you are using TypeScript - point to the compile file.\n\n## Loading GraphQL Schema\n\nTo easily load GraphQL schema, you can use `graphql-config`:\n\n```ts\nimport { defineCommand } from '@graphql-cli/common';\n\nexport default defineCommand((api) => {\n  return {\n    command: 'my-plugin',\n    builder(build) {\n      return build.options({\n        project: {\n          type: 'string',\n          describe: 'Name of your project',\n        },\n      });\n    },\n    async handler(args) {\n      // use graphql-config and find configuration\n      const config = await api.useConfig();\n      // pick project\n      const project = args.project ? config.getProject(args.project) : config.getDefault();\n      // get schema\n      const schema = await config.getSchema();\n    },\n  };\n});\n```\n\nIf you are using `graphql-config` to define your configuration, and you wish to load your extenion config from it, do:\n\n```ts\ntype MyConfig = { ... };\n\nconst extensionConfig = await config.extension<MyConfig>('my-plugin');\n```\n\n## Error Handling\n\nIf you wish to fail the execution of your plugin and report it back to GraphQL CLI host, simply throw an error:\n\n```ts\nimport { defineCommand } from '@graphql-cli/common';\n\nexport default defineCommand(() => {\n  return {\n    command: 'check-if-missing',\n    handler() {\n      if (somethingIsMissing) {\n        throw new Error(`Ooops, something is missing`);\n      }\n    },\n  };\n});\n```\n"
  },
  {
    "path": "docs/MIGRATION.md",
    "content": "# Migration from GraphQL CLI 3.x or older\n\nStarting with GraphQL CLI 4.0 and higher, the way projects are set up is significantly restructured.\n\n## Install the new version\nTo get started, install the new version:\n```sh\nyarn global add graphql-cli\n```\nYou can also globally install using npm.\n\n> NOTE: If you have previous version of the GraphQL-CLI installed make sure to uninstall it first\n\n```bash\nnpm uninstall graphql-cli\n```\n\n## Update your configuration file\nIf you are working from an existing project, the GraphQL Config file that is used by GraphQL CLI is now called `.graphqlrc.yml` (by default) instead of `.graphqlconfig`. [Other options exist](https://graphql-config.com/usage) for naming the config files supported by GraphQL CLI, but this guide will assume you're using YAML syntax.\n\nTo migrate, you will first need to update your GraphQL Configuration file to match GraphQL Config's updated syntax and structure.\n\nYou can [check here](https://graphql-config.com/usage) for more information about the new structure.\n\n###Specifying schema(s):\n\n```yml\nschema: ./src/schema/**/*.graphql #You can have URL endpoint, Git URL and local files using globs here.\n```\n\n`schemaPath` is replaced by `schema`, which is now more flexible then the previous approach. This field is used by all commands and plugins of GraphQL CLI.\n\n## Comparison of old commands\n\n### `get-schema` is no longer available\nIn previous versions, you were able to download the schema to the given path in `schemaPath` from the URL given inside `endpoint`. In the new version, `schema` refers to the endpoint of the schema.\n\nIf you use Prisma or any other tool that provides your schema under URL endpoint, you must specify it using the following syntax in your configuration YAML:\n\n```yaml\nschema: http://localhost:4000/graphql #This is the schema path\n```\n\nIf you want to download the schema from this URL to your local file system, you will also need to install `codegen` plugin and its `schema-ast` plugin using the following command or its npm equivalent:\n\n```bash\nyarn add @graphql-cli/codegen @graphql-codegen/schema-ast --dev\n```\n\nAfter that, you can specify the output path of the local schema file:\n\n```yaml\nschema: http://localhost:4000/graphql\nextensions:\n  codegen:\n    generates:\n      ./schema.graphql:\n        plugins:\n          - schema-ast\n```\n\nBy running `graphql codegen`, the `schema.graphql` file is generated in the root path of your project.\n\n#### For JSON Output\nIf you want to download the schema as a `json` introspection file, you will need to install `@graphql-codegen/introspection` instead, and add `introspection` instead of `schema-ast`.\n\n```yaml\nschema: http://localhost:4000/graphql\nextensions:\n  codegen:\n    generates:\n      ./schema.json:\n        plugins:\n          - introspection\n```\n\n### `create` is no longer available: it is replaced by the `init` command.\nIf you want to create a GraphQL Config file on an existing project or create a project using a template from scratch, you can use `graphql init` command.\nThis command will ask some questions about your new or existing project to update your dependencies and create a new configuration file for GraphQL CLI.\n\n### `diff` has been changed\nIf you want to see the differences between your schema and another schema, use the `diff` command as follows:\n```yaml\ngraphql diff git:origin/master:schema.graphql\n```\nFor example, `diff` will show the differences between the version in `schema` field of GraphQL Configuration file and the `schema.graphql` file in the remote master branch.\n\nAlternatively, you can compare `schema` with a URL endpoint:\n```yaml\ngraphql diff http://my-dev-instance.com/graphql\n```\n\n### `add-endpoint`, `add-project`, `schema-status`, `ping`, `query`, `prepare`, `lint` and `playground` commands are no longer available.\nGraphQL CLI (as well as GraphQL Config) no longer separates `endpoints` and `schemaPath`. The new `schema` field refers to the single endpoint of your GraphQL schema, so it can be a URL endpoint or a local file. If your project uses a remote schema, you can directly define this URL in `schema` path without downloading it or defining it as an extra `endpoint` etc.\n\nInstead of using these legacy commands, you can create a faked server to test your schema using the `yarn serve` command.\n\n### `codegen` now uses GraphQL Code Generator\nGraphQL CLI now uses GraphQL Code Generator which has a lot of plugins and templates for various environments, platforms and use cases. You can generate resolver signatures, TypeScript representations of your GraphQL Schema and more. [Check it out](https://graphql-code-generator.com/)\n\nThe usage is slightly different from the old one:\n```yaml\nschema: src/schema/**/*.graphql\nextensions:\n    codegen:\n        src/generated-types.ts: # Output file name\n            - typescript # Plugin names to be used\n            - typescript-resolvers\n```\n\nFor instance, consider a hypothetical case where you need to generate TypeScript resolvers signatures for your GraphQL project. To do this, you would install the `codegen` plugin and the additional plugins and templates for GraphQL Code Generator. For this case, you would need `typescript` and `typescript-resolvers` plugins:\n\n```bash\nyarn add @graphql-cli/codegen @graphql-codegen/typescript @graphql-codegen/typescript-resolvers --dev\n```\n\nNow, using a single command, you can run GraphQL Code Generator using GraphQL CLI:\n```bash\ngraphql codegen\n```\n\n## Special Notes for Prisma users\nPrisma users will need to download a schema from a URL endpoint. For example, here is a *legacy GraphQL Config file* doing this:\n\n`.graphqlconfig`\n```yaml\nprojects:\n  app:\n    schemaPath: src/schema.graphql\n    extensions:\n      endpoints:\n        default: http://localhost:4000\n  database:\n    schemaPath: src/generated/prisma-client/prisma.graphql\n    extensions:\n      prisma: prisma/prisma.yml\n```\n\n**To update the configuration for the new GraphQL CLI** you need to rename the file to `.graphqlrc.yml`, and then update the file as follows:\n\n`.graphqlrc.yml`\n```yaml\nprojects:\n  app:\n    schema: src/schema.graphql\n  database:\n    schema: prisma/prisma.yml\n    extensions:\n      codegen:\n        generates:\n          ./src/generated/prisma-client/prisma.graphql:\n            plugins:\n              - schema-ast\n```\n\nYou can directly point to your `prisma.yml` file instead of the URL endpoint.\n\nBefore running the GraphQL CLI command to use this new configuration, make sure you have installed the `@graphql-cli/codegen` and `@graphql-codegen/schema-ast` plugins using:\n```sh\nyarn add @graphql-cli/codegen @graphql-codegen/schema-ast --dev\n```\n\nNow you can run `graphql codegen --project database` for generating your `prisma.graphql` file.\n\nYou will also need to update your `prisma.yml` file if you're using `graphql get-schema` with Prisma:\n```yaml\n...\n# Ensures Prisma client is re-generated after a datamodel change.\nhooks:\n  post-deploy:\n    - graphql codegen --project database # instead of graphql get-schema\n    - prisma generate\n```\n"
  },
  {
    "path": "integration/package.json",
    "content": "{\n  \"name\": \"graphql-cli-integration-test\",\n  \"version\": \"4.1.0\",\n  \"license\": \"MIT\",\n  \"private\": true,\n  \"main\": \"dist/index.js\",\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"test\": \"ava\"\n  },\n  \"dependencies\": {\n    \"log-symbols\": \"4.1.0\",\n    \"tslib\": \"2.3.1\"\n  },\n  \"devDependencies\": {\n    \"ava\": \"3.15.0\",\n    \"execa\": \"5.1.1\"\n  },\n  \"ava\": {\n    \"files\": [\n      \"tests/**/*\"\n    ],\n    \"extensions\": [\n      \"ts\"\n    ],\n    \"require\": [\n      \"ts-node/register\"\n    ]\n  }\n}"
  },
  {
    "path": "integration/test-project/.dockerignore",
    "content": "node_modules\nnpm-debug.log"
  },
  {
    "path": "integration/test-project/.gitignore",
    "content": "node_modules\ndist\ntypes\nyarn.lock\nyarn-error.log\n"
  },
  {
    "path": "integration/test-project/.graphqlrc.yml",
    "content": "schema: schema/schema.graphql\nextensions:\n  codegen:\n    generates:\n      ./src/generated-types.ts:\n        config:\n          mappers:\n            Comment: './generated-db-types#comment'\n            Note: './generated-db-types#note'\n          useIndexSignature: true\n          skipDocumentsValidation: true\n        plugins:\n          - add: '/* tslint:disable */'\n          - typescript\n          - typescript-resolvers\n"
  },
  {
    "path": "integration/test-project/package.json",
    "content": "{\n  \"private\": true,\n  \"name\": \"test-project\",\n  \"version\": \"4.1.0\",\n  \"dependencies\": {\n    \"@graphql-tools/load-files\": \"6.5.2\",\n    \"@types/node\": \"13.13.45\",\n    \"graphql\": \"15.7.2\",\n    \"graphql-config\": \"3.4.1\",\n    \"graphql-tag\": \"2.12.6\"\n  },\n  \"devDependencies\": {\n    \"@graphql-codegen/add\": \"2.0.2\",\n    \"@graphql-codegen/typescript\": \"1.23.0\",\n    \"@graphql-codegen/typescript-operations\": \"1.18.4\",\n    \"@graphql-codegen/typescript-react-apollo\": \"2.3.1\",\n    \"@graphql-codegen/typescript-resolvers\": \"1.20.0\",\n    \"@graphql-cli/codegen\": \"1.17.27\",\n    \"@graphql-cli/coverage\": \"2.1.0\",\n    \"@graphql-cli/diff\": \"2.1.0\",\n    \"@graphql-cli/generate\": \"4.1.0\",\n    \"@graphql-cli/serve\": \"4.1.0\",\n    \"@graphql-cli/similar\": \"2.1.0\",\n    \"@graphql-cli/validate\": \"2.1.0\",\n    \"graphql\": \"15.7.2\",\n    \"graphql-cli\": \"4.1.0\",\n    \"tslint\": \"6.1.3\",\n    \"typescript\": \"4.4.4\"\n  },\n  \"license\": \"MIT\"\n}\n"
  },
  {
    "path": "integration/test-project/renovate.json",
    "content": "{\n  \"extends\": [\n    \"config:base\"\n  ],\n  \"automerge\": true,\n  \"major\": {\n    \"automerge\": false\n  }\n}\n"
  },
  {
    "path": "integration/test-project/schema/schema.graphql",
    "content": "## NOTE: This schema was generated by Graphback and should not be changed manually\n\n\"\"\"Exposes a URL that specifies the behaviour of this scalar.\"\"\"\ndirective @specifiedBy(\n  \"\"\"The URL that specifies the behaviour of this scalar.\"\"\"\n  url: String!\n) on SCALAR\n\n\"\"\" @model \"\"\"\ntype Comment {\n  id: ID!\n  text: String\n  description: String\n\n  \"\"\"@manyToOne(field: 'comments', key: 'noteId')\"\"\"\n  note: Note\n}\n\ninput CommentFilter {\n  id: IDInput\n  text: StringInput\n  description: StringInput\n  noteId: IDInput\n  and: [CommentFilter!]\n  or: [CommentFilter!]\n  not: CommentFilter\n}\n\ntype CommentResultList {\n  items: [Comment]!\n  offset: Int\n  limit: Int\n  count: Int\n}\n\ninput CommentSubscriptionFilter {\n  id: ID\n  text: String\n  description: String\n}\n\ninput CreateCommentInput {\n  id: ID\n  text: String\n  description: String\n  noteId: ID\n}\n\ninput CreateNoteInput {\n  id: ID\n  title: String!\n  description: String\n}\n\ninput IDInput {\n  ne: ID\n  eq: ID\n  le: ID\n  lt: ID\n  ge: ID\n  gt: ID\n  in: [ID!]\n}\n\ninput MutateCommentInput {\n  id: ID!\n  text: String\n  description: String\n  noteId: ID\n}\n\ninput MutateNoteInput {\n  id: ID!\n  title: String\n  description: String\n}\n\ntype Mutation {\n  createNote(input: CreateNoteInput!): Note\n  updateNote(input: MutateNoteInput!): Note\n  deleteNote(input: MutateNoteInput!): Note\n  createComment(input: CreateCommentInput!): Comment\n  updateComment(input: MutateCommentInput!): Comment\n  deleteComment(input: MutateCommentInput!): Comment\n}\n\n\"\"\" @model \"\"\"\ntype Note {\n  id: ID!\n  title: String!\n  description: String\n\n  \"\"\"@oneToMany(field: 'note', key: 'noteId')\"\"\"\n  comments(filter: CommentFilter): [Comment]!\n}\n\ninput NoteFilter {\n  id: IDInput\n  title: StringInput\n  description: StringInput\n  and: [NoteFilter!]\n  or: [NoteFilter!]\n  not: NoteFilter\n}\n\ntype NoteResultList {\n  items: [Note]!\n  offset: Int\n  limit: Int\n  count: Int\n}\n\ninput NoteSubscriptionFilter {\n  id: ID\n  title: String\n  description: String\n}\n\ninput OrderByInput {\n  field: String!\n  order: SortDirectionEnum = ASC\n}\n\ninput PageRequest {\n  limit: Int\n  offset: Int\n}\n\ntype Query {\n  getNote(id: ID!): Note\n  findNotes(filter: NoteFilter, page: PageRequest, orderBy: OrderByInput): NoteResultList!\n  getComment(id: ID!): Comment\n  findComments(filter: CommentFilter, page: PageRequest, orderBy: OrderByInput): CommentResultList!\n}\n\nenum SortDirectionEnum {\n  DESC\n  ASC\n}\n\ninput StringInput {\n  ne: String\n  eq: String\n  le: String\n  lt: String\n  ge: String\n  gt: String\n  in: [String!]\n  contains: String\n  startsWith: String\n  endsWith: String\n}\n\ntype Subscription {\n  newNote(filter: NoteSubscriptionFilter): Note!\n  updatedNote(filter: NoteSubscriptionFilter): Note!\n  deletedNote(filter: NoteSubscriptionFilter): Note!\n  newComment(filter: CommentSubscriptionFilter): Comment!\n  updatedComment(filter: CommentSubscriptionFilter): Comment!\n  deletedComment(filter: CommentSubscriptionFilter): Comment!\n}"
  },
  {
    "path": "integration/test-project/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"outDir\": \"./dist/\",\n    \"declarationDir\": \"./types\",\n    \"lib\": [\n      \"esnext\",\n      \"dom\"\n    ],\n    \"resolveJsonModule\": true,\n    \"noImplicitAny\": false,\n    \"preserveConstEnums\": true,\n    \"strict\": false,\n    \"strictNullChecks\": true,\n    \"esModuleInterop\": true,\n    \"target\": \"esnext\",\n    \"module\": \"commonjs\",\n    \"moduleResolution\": \"node\",\n    \"allowSyntheticDefaultImports\": true,\n    \"importHelpers\": true,\n    \"alwaysStrict\": false,\n    \"sourceMap\": true,\n    \"declaration\": true,\n    \"noImplicitReturns\": true,\n    \"noUnusedLocals\": false,\n    \"noUnusedParameters\": false,\n    \"noImplicitThis\": false\n  },\n}"
  },
  {
    "path": "integration/test-project/tslint.json",
    "content": "{\n  \"extends\": \"tslint:recommended\",\n  \"rules\": {\n      \"max-line-length\": {\n          \"options\": [120]\n      },\n      \"semicolon\": false,\n      \"quotemark\": false,\n      \"new-parens\": true,\n      \"no-arg\": true,\n      \"no-bitwise\": true,\n      \"no-conditional-assignment\": false,\n      \"no-consecutive-blank-lines\": false,\n      \"object-literal-sort-keys\": false,\n      \"trailing-comma\": false,\n      \"object-literal-shorthand\": false,\n      \"no-console\": false,\n      \"interface-name\": false\n  },\n  \"jsRules\": {\n      \"max-line-length\": {\n          \"options\": [120]\n      }\n  }\n}\n"
  },
  {
    "path": "integration/tests/workflow.ts",
    "content": "// tslint:disable-next-line: match-default-export-name no-implicit-dependencies\nimport ava, { ExecutionContext } from 'ava';\nimport { resolve } from 'path';\nimport { execSync } from 'child_process';\n\nava('Test cli workflow', (t: ExecutionContext) => {\n  const basePath = resolve(`${__dirname}/../test-project`);\n  process.chdir(basePath);\n  // Workaround for github actions symlinking issue\n  const graphQLCmd = 'node ../../packages/cli/dist/index.js';\n  console.log(`Running commands in ${basePath}`);\n  try {\n    let generate = execSync(`${graphQLCmd} generate --backend`, { encoding: 'utf8', cwd: basePath });\n    const codegen = execSync(`${graphQLCmd} codegen`, { encoding: 'utf8', cwd: basePath });\n\n    console.log(`\n    Generate: ${generate}\\n\n    Codegen: ${codegen}\\n\n   `);\n    t.true(codegen.indexOf('error') === -1);\n    t.true(generate.indexOf('failed') === -1);\n  } catch (error) {\n    t.fail(`build failed with ${error}`);\n  }\n});\n"
  },
  {
    "path": "integration/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n      \"skipLibCheck\": true,\n      \"esModuleInterop\": true,\n      \"importHelpers\": true,\n      \"experimentalDecorators\": true,\n      \"module\": \"commonjs\",\n      \"target\": \"es2018\",\n      \"lib\": [\"es6\", \"esnext\", \"es2015\", \"dom\"],\n      \"moduleResolution\": \"node\",\n      \"emitDecoratorMetadata\": true,\n      \"sourceMap\": true,\n      \"declaration\": true,\n      \"outDir\": \"./dist\",\n      \"rootDir\": \"./tests\",\n      \"noImplicitAny\": true,\n      \"noImplicitThis\": true,\n      \"alwaysStrict\": true,\n      \"noImplicitReturns\": true,\n      \"noUnusedLocals\": true,\n      \"noUnusedParameters\": false\n    },\n    \"files\": [\"src/index.ts\"],\n    \"exclude\": [\"node_modules\"]\n  }\n  "
  },
  {
    "path": "lerna.json",
    "content": "{\n  \"version\": \"4.1.0\",\n  \"npmClient\": \"yarn\",\n  \"useWorkspaces\": true\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"graphql-cli-monorepo\",\n  \"version\": \"4.1.0\",\n  \"private\": true,\n  \"author\": \"dotansimha <dotansimha@gmail.com>\",\n  \"license\": \"MIT\",\n  \"workspaces\": {\n    \"packages\": [\n      \"packages/*\",\n      \"packages/commands/*\",\n      \"website\",\n      \"integration\"\n    ]\n  },\n  \"scripts\": {\n    \"release\": \"node scripts/release.js\",\n    \"release:next\": \"node scripts/release.js --tag=next\",\n    \"release:canary\": \"node scripts/release.js --canary\",\n    \"test\": \"lerna run test\",\n    \"build\": \"lerna run build\",\n    \"format\": \"prettier --write \\\"**/*.{ts,tsx}\\\"\",\n    \"deploy:website\": \"cd website && yarn deploy\"\n  },\n  \"devDependencies\": {\n    \"@graphql-tools/load\": \"6.2.8\",\n    \"@types/express\": \"4.17.13\",\n    \"@types/fs-extra\": \"9.0.13\",\n    \"@types/fullname\": \"2.1.29\",\n    \"@types/inquirer\": \"7.3.3\",\n    \"@types/js-yaml\": \"3.12.7\",\n    \"@types/node\": \"14.17.33\",\n    \"@types/rimraf\": \"3.0.2\",\n    \"@types/tmp\": \"0.2.2\",\n    \"graphql\": \"15.7.2\",\n    \"husky\": \"4.3.8\",\n    \"lerna\": \"3.22.1\",\n    \"lint-staged\": \"10.5.4\",\n    \"prettier\": \"2.4.1\",\n    \"rimraf\": \"3.0.2\",\n    \"ts-node\": \"9.1.1\",\n    \"typescript\": \"4.4.4\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"lint-staged\": {\n    \"*.{ts,tsx}\": [\n      \"tslint --fix\",\n      \"prettier --write\",\n      \"git add\"\n    ]\n  },\n  \"prettier\": {\n    \"printWidth\": 120,\n    \"singleQuote\": true\n  },\n  \"resolutions\": {\n    \"graphql\": \"15.7.2\"\n  },\n  \"dependencies\": {\n    \"@types/yargs\": \"15.0.14\"\n  }\n}\n"
  },
  {
    "path": "packages/cli/.gitignore",
    "content": "node_modules\nnpm-debug.log\ndist\ntemp\nyarn-error.log\ntests/coverage/"
  },
  {
    "path": "packages/cli/.npmignore",
    "content": "src/"
  },
  {
    "path": "packages/cli/CONTRIBUTING.md",
    "content": "# Contributing guide\n\nPlease see the project root at https://github.com/Urigo/graphql-cli/CONTRIBUTING.md for more information about contributing to GraphQL CLI and the greater GraphQL ecosystem.\n"
  },
  {
    "path": "packages/cli/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2019 Dotan Simha\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "packages/cli/README.md",
    "content": "# GraphQL CLI\n\n![image](https://user-images.githubusercontent.com/20847995/67651234-85bf1500-f916-11e9-90e5-cb3bd0e6a338.png)\n\nRepo and documentation at: https://github.com/Urigo/graphql-cli\n"
  },
  {
    "path": "packages/cli/package.json",
    "content": "{\n  \"name\": \"graphql-cli\",\n  \"description\": \"Command line tool for common GraphQL development workflows\",\n  \"keywords\": [\n    \"graphql\",\n    \"graphql-cli\",\n    \"cli\"\n  ],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/Urigo/graphql-cli\"\n  },\n  \"author\": {\n    \"name\": \"Uri Goldshtein\",\n    \"email\": \"uri.goldshtein@gmail.com\",\n    \"url\": \"https://github.com/Urigo\"\n  },\n  \"version\": \"5.0.0\",\n  \"license\": \"MIT\",\n  \"main\": \"dist/index.js\",\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"bin\": {\n    \"graphql\": \"dist/bin.js\"\n  },\n  \"scripts\": {\n    \"start\": \"ts-node src/bin.ts\",\n    \"build\": \"tsc\"\n  },\n  \"dependencies\": {\n    \"@graphql-cli/common\": \"^5.0.0\",\n    \"@graphql-cli/init\": \"^5.0.0\",\n    \"globby\": \"^11.0.2\",\n    \"graphql-config\": \"^3.2.0\",\n    \"open\": \"^7.4.2\",\n    \"yargs\": \"^16.2.0\"\n  }\n}\n"
  },
  {
    "path": "packages/cli/src/bin.ts",
    "content": "#!/usr/bin/env node\n\nimport { cli } from './index';\n\ncli();\n"
  },
  {
    "path": "packages/cli/src/discover.ts",
    "content": "import { defineCommand } from '@graphql-cli/common';\nimport open from 'open';\n\nexport default defineCommand(() => {\n  return {\n    command: 'discover',\n    describe: 'Opens a list of all GraphQL CLI Plugins',\n    handler() {\n      return open('https://www.npmjs.com/search?q=keywords:graphql-cli-plugin');\n    },\n  };\n});\n"
  },
  {
    "path": "packages/cli/src/index.ts",
    "content": "import yargs from 'yargs';\nimport globby from 'globby';\nimport { join } from 'path';\nimport { CommandFactory, useConfig, useLoaders } from '@graphql-cli/common';\nimport discover from './discover';\n\nexport async function cli(): Promise<void> {\n  const program = yargs\n    .scriptName('graphql')\n    .detectLocale(false)\n    .epilog('Visit https://github.com/Urigo/graphql-cli for more information')\n    .version();\n\n  const commandPackageNames = await discoverCommands();\n  const commandFactories = await Promise.all(commandPackageNames.map(loadCommand));\n\n  [discover, ...commandFactories].forEach((cmd) => {\n    program.command(\n      cmd({\n        useConfig,\n        useLoaders,\n      })\n    );\n  });\n\n  program.demandCommand().recommendCommands().help().showHelpOnFail(false).argv;\n}\n\nasync function discoverCommands() {\n  const commandNames: string[] = [];\n  const paths = require.resolve.paths('graphql-cli');\n\n  await Promise.all(paths.map(findInDirectory));\n\n  async function findInDirectory(directory: string) {\n    const results = await globby('*', {\n      cwd: join(directory, '@graphql-cli'),\n      onlyDirectories: true,\n      deep: 1,\n      ignore: ['common', 'loaders'],\n    });\n\n    if (results.length) {\n      commandNames.push(...results);\n    }\n  }\n\n  // unique names\n  return commandNames.filter((val, i, list) => list.indexOf(val) === i);\n}\n\nfunction loadCommand(name: string): CommandFactory {\n  const mod = require(`@graphql-cli/${name}`);\n\n  return mod.default || mod;\n}\n"
  },
  {
    "path": "packages/cli/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"skipLibCheck\": true,\n    \"esModuleInterop\": true,\n    \"importHelpers\": true,\n    \"experimentalDecorators\": true,\n    \"module\": \"commonjs\",\n    \"target\": \"es2018\",\n    \"lib\": [\"es6\", \"esnext\", \"es2015\", \"dom\"],\n    \"moduleResolution\": \"node\",\n    \"emitDecoratorMetadata\": true,\n    \"sourceMap\": true,\n    \"declaration\": true,\n    \"outDir\": \"./dist\",\n    \"rootDir\": \"./src\",\n    \"noImplicitAny\": true,\n    \"noImplicitThis\": true,\n    \"alwaysStrict\": true,\n    \"noImplicitReturns\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": false\n  },\n  \"include\": [\"src\"],\n  \"exclude\": [\"node_modules\"]\n}\n"
  },
  {
    "path": "packages/commands/generate/.gitignore",
    "content": "node_modules\nnpm-debug.log\ndist\ntemp\nyarn-error.log\ntests/coverage/"
  },
  {
    "path": "packages/commands/generate/README.md",
    "content": "## GraphQL CLI Generate command\n\nThis package is part of the GraphQL CLI ecosystem and it is not designed to be consumed separately.\nGo to: https://github.com/Urigo/graphql-cli for more information\n"
  },
  {
    "path": "packages/commands/generate/package.json",
    "content": "{\n  \"name\": \"@graphql-cli/generate\",\n  \"description\": \"Generate schema and client-side documents for your GraphQL project by using Graphback.\",\n  \"version\": \"5.0.0\",\n  \"license\": \"MIT\",\n  \"main\": \"dist/index.js\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/Urigo/graphql-cli\",\n    \"directory\": \"packages/commands/generate\"\n  },\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"keywords\": [\n    \"graphql-cli\",\n    \"graphql-cli-plugin\"\n  ],\n  \"scripts\": {\n    \"build\": \"tsc\"\n  },\n  \"peerDependencies\": {\n    \"graphql\": \"15.7.2\"\n  },\n  \"dependencies\": {\n    \"@graphql-cli/common\": \"^5.0.0\",\n    \"graphback-cli\": \"1.1.2\",\n    \"tslib\": \"2.3.1\"\n  }\n}\n"
  },
  {
    "path": "packages/commands/generate/src/index.ts",
    "content": "import { defineCommand } from '@graphql-cli/common';\nimport { command, builder as builderConfig, handler } from 'graphback-cli';\n\nexport default defineCommand(() => {\n  return {\n    command,\n    builder(builder: any) {\n      return builder.options(builderConfig);\n    },\n    handler,\n  };\n});\n"
  },
  {
    "path": "packages/commands/generate/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"skipLibCheck\": true,\n    \"esModuleInterop\": true,\n    \"importHelpers\": true,\n    \"experimentalDecorators\": true,\n    \"module\": \"commonjs\",\n    \"target\": \"es2018\",\n    \"lib\": [\"es6\", \"esnext\", \"es2015\", \"dom\"],\n    \"moduleResolution\": \"node\",\n    \"emitDecoratorMetadata\": true,\n    \"sourceMap\": true,\n    \"declaration\": true,\n    \"outDir\": \"./dist\",\n    \"rootDir\": \"./src\",\n    \"noImplicitAny\": true,\n    \"noImplicitThis\": true,\n    \"alwaysStrict\": true,\n    \"noImplicitReturns\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": false\n  },\n  \"files\": [\"src/index.ts\"],\n  \"exclude\": [\"node_modules\"]\n}\n"
  },
  {
    "path": "packages/commands/init/.gitignore",
    "content": "node_modules\nnpm-debug.log\ndist\ntemp\nyarn-error.log\ntests/coverage/"
  },
  {
    "path": "packages/commands/init/.npmignore",
    "content": "src/"
  },
  {
    "path": "packages/commands/init/README.md",
    "content": "## GraphQL CLI Init command\n\nThis package is part of the GraphQL CLI ecosystem and it is not designed to be consumed separately.\nGo to: https://github.com/Urigo/graphql-cli for more information\n"
  },
  {
    "path": "packages/commands/init/package.json",
    "content": "{\n  \"name\": \"@graphql-cli/init\",\n  \"description\": \"Creates a GraphQL project using a template or GraphQL Config file for your existing project.\",\n  \"version\": \"5.0.0\",\n  \"license\": \"MIT\",\n  \"main\": \"dist/index.js\",\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/Urigo/graphql-cli\",\n    \"directory\": \"packages/commands/init\"\n  },\n  \"keywords\": [\n    \"graphql-cli\",\n    \"graphql-cli-plugin\"\n  ],\n  \"scripts\": {\n    \"build\": \"tsc\"\n  },\n  \"dependencies\": {\n    \"@graphql-cli/common\": \"^5.0.0\",\n    \"chalk\": \"^4.1.0\",\n    \"cosmiconfig\": \"^7.0.0\",\n    \"create-graphback\": \"^1.1.2\",\n    \"cross-fetch\": \"^3.0.6\",\n    \"fs-extra\": \"^9.1.0\",\n    \"fullname\": \"^4.0.1\",\n    \"graphql\": \"^15.5.0\",\n    \"inquirer\": \"7.3.3\",\n    \"js-yaml\": \"^3.14.1\",\n    \"latest-version\": \"^5.1.0\",\n    \"openapi-to-graphql\": \"^2.2.6\",\n    \"ora\": \"^5.3.0\",\n    \"rimraf\": \"^3.0.2\",\n    \"simple-git\": \"^2.36.1\",\n    \"string-env-interpolation\": \"^1.0.1\",\n    \"tmp\": \"^0.2.1\",\n    \"tslib\": \"~2.3.0\"\n  }\n}\n"
  },
  {
    "path": "packages/commands/init/src/common.ts",
    "content": "import { join } from 'path';\nimport { ensureFile, writeFileSync } from 'fs-extra';\nimport { prompt } from 'inquirer';\nimport fullName from 'fullname';\nimport latestVersion from 'latest-version';\n\ntype StandardEnum<T> = {\n  [id: string]: T | string;\n  [nu: number]: string;\n};\n\nexport async function askForEnum<T, Enum extends StandardEnum<T>>(options: {\n  enum: Enum;\n  message: string;\n  defaultValue?: T;\n  ignoreList?: (T | string)[];\n}): Promise<T> {\n  let choices: (T | string)[];\n  const enumValues = Object.values(options.enum);\n  if (options.ignoreList) {\n    choices = enumValues.filter((enumValue) => !options.ignoreList.includes(enumValue));\n  } else {\n    choices = enumValues;\n  }\n\n  const { answer } = await prompt<{ answer: T }>([\n    {\n      type: 'list',\n      name: 'answer',\n      message: options.message,\n      choices,\n      default: options.defaultValue,\n    },\n  ]);\n  return answer;\n}\n\nexport interface Context {\n  name: string;\n  path: string;\n  type?: ProjectType;\n  graphqlConfig: any;\n}\n\nexport enum InitializationType {\n  FromScratch = 'I want to create a new project from a GraphQL CLI Project Template.',\n  ExistingOpenAPI = 'I have an existing project using OpenAPI/Swagger Schema Definition.',\n  ExistingGraphQL = 'I have an existing project using GraphQL and want to add GraphQL CLI (run from project root).',\n}\n\nexport enum ProjectType {\n  FullStack = 'Full Stack',\n  FrontendOnly = 'Frontend only',\n  BackendOnly = 'Backend only',\n}\n\nexport enum FrontendType {\n  TSReactApollo = 'TypeScript React Apollo',\n  ApolloAngular = 'Apollo Angular',\n  StencilApollo = 'Stencil Apollo',\n  TSUrql = 'TypeScript Urql',\n  GraphQLRequest = 'GraphQL Request',\n  ApolloAndroid = 'Apollo Android',\n  Other = 'Other',\n}\n\nexport enum BackendType {\n  TS = 'TypeScript',\n  Java = 'Java',\n  Kotlin = 'Kotlin',\n  Other = 'Other',\n}\n\nexport type PackageManifest = ReturnType<typeof managePackageManifest>;\nexport function managePackageManifest() {\n  const packages = new Set<string>();\n  const scripts = new Map<string, string>();\n\n  return {\n    addDependency(name: string) {\n      packages.add(name);\n    },\n    addScript(name: string, script: string) {\n      scripts.set(name, script);\n    },\n    async writePackage({\n      path,\n      name,\n      initializationType,\n    }: {\n      path: string;\n      name: string;\n      initializationType: InitializationType;\n    }) {\n      let packageJson: any = {};\n      const packageJsonPath = join(path, 'package.json');\n\n      // Try to load existing package.json\n      try {\n        const importedPackageJson = require(packageJsonPath);\n\n        packageJson = importedPackageJson || {};\n      } catch (err) {}\n\n      if (initializationType === InitializationType.FromScratch) {\n        packageJson.private = true;\n        packageJson.name = name;\n\n        const author = await fullName();\n        if (author) {\n          packageJson.author = {\n            name: author,\n          };\n        }\n      }\n\n      for (const [scriptName, scriptValue] of scripts) {\n        if (!packageJson.scripts) {\n          packageJson.scripts = {};\n        }\n\n        if (!packageJson.scripts[scriptName]) {\n          packageJson.scripts[scriptName] = scriptValue;\n        }\n      }\n\n      // Add dev dependencies\n      packageJson.devDependencies = packageJson.devDependencies || {};\n\n      for await (const npmDependency of packages) {\n        if (!(npmDependency in packageJson.devDependencies)) {\n          packageJson.devDependencies[npmDependency] = await latestVersion(npmDependency);\n        }\n      }\n\n      await ensureFile(packageJsonPath);\n      writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));\n    },\n  };\n}\n"
  },
  {
    "path": "packages/commands/init/src/features/codegen.ts",
    "content": "import { prompt } from 'inquirer';\nimport { Context, PackageManifest, ProjectType, FrontendType, BackendType, askForEnum } from '../common';\n\nexport async function askForCodegen({ context, project }: { context: Context; project: PackageManifest }) {\n  if (!context.graphqlConfig.extensions.codegen) {\n    const { isCodegenAsked } = await prompt([\n      {\n        type: 'confirm',\n        name: 'isCodegenAsked',\n        message: 'Do you want to use GraphQL Code Generator?',\n        default: true,\n      },\n    ]);\n    if (isCodegenAsked) {\n      project.addDependency('@graphql-cli/codegen');\n      project.addScript('graphql:codegen', 'graphql codegen');\n\n      context.graphqlConfig.extensions.codegen = {\n        generates: {},\n      };\n      let codegenPlugins = new Set<string>();\n      if (context.type === ProjectType.FullStack || context.type === ProjectType.BackendOnly) {\n        const backendType = await askForEnum({\n          enum: BackendType,\n          message: 'What type of backend do you use?',\n          defaultValue: BackendType.TS,\n        });\n\n        switch (backendType) {\n          case BackendType.TS:\n            codegenPlugins.add('typescript');\n            codegenPlugins.add('typescript-resolvers');\n            break;\n          case BackendType.Java:\n            codegenPlugins.add('java');\n            codegenPlugins.add('java-resolvers');\n            break;\n          case BackendType.Kotlin:\n            codegenPlugins.add('java');\n            codegenPlugins.add('java-kotlin');\n            break;\n        }\n\n        const { backendGeneratedFile } = await prompt([\n          {\n            type: 'input',\n            name: 'backendGeneratedFile',\n            message: 'Where do you want to have generated backend code?',\n            default: './generated-backend.ts',\n          },\n        ]);\n\n        context.graphqlConfig.extensions.codegen.generates[backendGeneratedFile] = {\n          plugins: [...codegenPlugins],\n        };\n      }\n\n      if (context.type === ProjectType.FullStack || context.type === ProjectType.FrontendOnly) {\n        const frontendType = await askForEnum({\n          enum: FrontendType,\n          message: 'What type of frontend do you use?',\n          defaultValue: FrontendType.TSReactApollo,\n        });\n\n        switch (frontendType) {\n          case FrontendType.TSReactApollo:\n            codegenPlugins.add('typescript');\n            codegenPlugins.add('typescript-react-apollo');\n            break;\n          case FrontendType.ApolloAngular:\n            codegenPlugins.add('typescript');\n            codegenPlugins.add('typescript-apollo-angular');\n            break;\n          case FrontendType.StencilApollo:\n            codegenPlugins.add('typescript');\n            codegenPlugins.add('typescript-stencil-apollo');\n            break;\n          case FrontendType.TSUrql:\n            codegenPlugins.add('typescript');\n            codegenPlugins.add('typescript-urql');\n            break;\n          case FrontendType.GraphQLRequest:\n            codegenPlugins.add('typescript');\n            codegenPlugins.add('typescript-graphql-request');\n            break;\n          case FrontendType.ApolloAndroid:\n            codegenPlugins.add('java-apollo-android');\n            break;\n        }\n\n        const { frontendGeneratedFile } = await prompt([\n          {\n            type: 'input',\n            name: 'frontendGeneratedFile',\n            message: 'Where do you want to have generated frontend code?',\n            default: './generated-frontend.ts',\n          },\n        ]);\n\n        context.graphqlConfig.extensions.codegen.generates[frontendGeneratedFile] = {\n          plugins: [...codegenPlugins],\n        };\n      }\n      for (const codegenPlugin of codegenPlugins) {\n        project.addDependency('@graphql-codegen/' + codegenPlugin);\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "packages/commands/init/src/features/inspector.ts",
    "content": "import { prompt } from 'inquirer';\nimport { Context, PackageManifest, ProjectType } from '../common';\n\nexport async function askForInspector({ context, project }: { context: Context; project: PackageManifest }) {\n  if (context.type === ProjectType.FullStack || context.type === ProjectType.FrontendOnly) {\n    const { isFrontendInspectorAsked } = await prompt([\n      {\n        type: 'confirm',\n        name: 'isFrontendInspectorAsked',\n        message: 'Do you want to have GraphQL Inspector tools for your frontend?',\n        default: true,\n      },\n    ]);\n\n    if (isFrontendInspectorAsked) {\n      project.addDependency('@graphql-cli/coverage');\n      project.addDependency('@graphql-cli/validate');\n\n      project.addScript('graphql:coverage', 'graphql coverage');\n      project.addScript('graphql:validate', 'graphql validate');\n    }\n  }\n\n  if (context.type === ProjectType.FullStack || context.type === ProjectType.BackendOnly) {\n    const { isBackendInspectorAsked } = await prompt([\n      {\n        type: 'confirm',\n        name: 'isBackendInspectorAsked',\n        message: 'Do you want to have GraphQL Inspector tools for your backend?',\n        default: true,\n      },\n    ]);\n\n    if (isBackendInspectorAsked) {\n      project.addDependency('@graphql-cli/diff');\n      project.addDependency('@graphql-cli/similar');\n\n      project.addScript('graphql:diff', 'graphql diff');\n      project.addScript('graphql:similar', 'graphql similar');\n\n      if (!context.graphqlConfig.extensions.diff) {\n        context.graphqlConfig.extensions.diff = {\n          baseSchema: 'your-base-schema-here',\n        };\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "packages/commands/init/src/index.ts",
    "content": "import { defineCommand } from '@graphql-cli/common';\nimport { prompt } from 'inquirer';\nimport { join } from 'path';\nimport chalk from 'chalk';\nimport { ensureFile, writeFileSync, readFileSync, existsSync } from 'fs-extra';\nimport { safeLoad as YAMLParse, safeDump as YAMLStringify } from 'js-yaml';\nimport { Context, InitializationType, ProjectType, askForEnum, managePackageManifest } from './common';\nimport { askForInspector } from './features/inspector';\nimport { askForCodegen } from './features/codegen';\nimport { fromExisting } from './sources/from-existing';\nimport { fromScratch } from './sources/from-scratch';\nimport { fromExistingOpenAPI } from './sources/from-open-api';\n\nexport default defineCommand<\n  {},\n  {\n    projectName?: string;\n    templateName?: string;\n    templateUrl?: string;\n  }\n>(() => {\n  return {\n    command: 'init',\n    builder(yargs) {\n      return yargs.options({\n        projectName: {\n          describe: 'Project name',\n          type: 'string',\n        },\n        templateName: {\n          describe: 'Name of the predefined template',\n          type: 'string',\n        },\n        templateUrl: {\n          describe: 'GitHub URL of the template. For example (http://github.com/example/graphql-cli-example-template)',\n          type: 'string',\n        },\n      });\n    },\n    async handler(args) {\n      let { projectName, templateName, templateUrl } = args;\n      const initializationType = await askForInitializationType();\n      \n      const context: Context = {\n        name: projectName,\n        path: process.cwd(),\n        graphqlConfig: {\n          extensions: {},\n        },\n      };\n\n      const project = managePackageManifest();\n\n      project.addDependency('graphql-cli');\n\n      if (initializationType === InitializationType.ExistingGraphQL) {\n        await fromExisting({\n          context,\n          project,\n        });\n      } else if (initializationType === InitializationType.FromScratch) {\n        await fromScratch({\n          context,\n          templateName,\n          templateUrl,\n        });\n      }\n\n      if (initializationType !== InitializationType.FromScratch) {\n        context.type = await askForProject();\n      }\n\n      loadGraphQLConfig(context);\n\n      if (initializationType === InitializationType.ExistingOpenAPI) {\n        await fromExistingOpenAPI(context);\n      }\n\n      await askForSchema(context);\n      await askForDocuments(context);\n      await askForCodegen({ context, project });\n      await askForInspector({ context, project });\n\n      await Promise.all([\n        writeGraphQLConfig(context),\n        project.writePackage({\n        path: context.path,\n        name: projectName,\n        initializationType,\n      })]);\n\n      const successMessages = [\n        `🚀  GraphQL CLI project successfully initialized:`,\n        context.name,\n        'Next Steps:',\n        `- Change directory to the project folder - ${chalk.cyan(`cd ${context.path}`)}`,\n        `- Run ${chalk.cyan(`yarn install`)} to install dependencies`,\n      ];\n\n      if (initializationType !== InitializationType.ExistingGraphQL) {\n        successMessages.push(\n          `- ${chalk.cyan(`(Optional)`)} Initialize your git repo. ${chalk.cyan(`git init`)}.`,\n          `- Follow the instructions in README.md to continue...`\n        );\n      }\n\n      console.info(successMessages.join('\\n'));\n      process.exit(0);\n    },\n  };\n});\n\nfunction askForProject() {\n  return askForEnum({\n    enum: ProjectType,\n    message: 'What is the type of the project?',\n    defaultValue: ProjectType.FullStack,\n  });\n}\n\nfunction askForInitializationType() {\n  return askForEnum({\n    enum: InitializationType,\n    message: 'Select the best option for you',\n    defaultValue: InitializationType.FromScratch,\n    ignoreList: [],\n  });\n}\n\nfunction loadGraphQLConfig(context: Context) {\n  const graphqlConfigPath = join(context.path, '.graphqlrc.yml');\n\n  try {\n    if (existsSync(graphqlConfigPath)) {\n      context.graphqlConfig = YAMLParse(readFileSync(graphqlConfigPath, 'utf8'));\n    }\n  } catch (e) {\n    console.warn(`Existing GraphQL Config file looks broken! Skipping...`);\n  }\n}\n\nasync function askForSchema(context: Context) {\n  if (!context.graphqlConfig.schema) {\n    const { schema } = await prompt([\n      {\n        type: 'input',\n        name: 'schema',\n        message: 'Where is your schema?',\n        default: './schema.graphql',\n      },\n    ]);\n\n    context.graphqlConfig.schema = schema.endsWith('.ts')\n      ? {\n          [schema]: {\n            require: 'ts-node/register',\n          },\n        }\n      : schema;\n  }\n}\n\nasync function askForDocuments(context: Context) {\n  if (\n    !context.graphqlConfig.documents &&\n    (context.type === ProjectType.FullStack || context.type === ProjectType.FrontendOnly)\n  ) {\n    const { documents } = await prompt([\n      {\n        type: 'input',\n        name: 'documents',\n        message: 'Where are your operation documents?',\n      },\n    ]);\n    context.graphqlConfig.documents = documents;\n  }\n}\n\nasync function writeGraphQLConfig(context: Context) {\n  const configPath = join(context.path, '.graphqlrc.yml');\n  await ensureFile(configPath);\n\n  const keys = ['schema', 'documents', 'extensions'];\n\n  function sortKeys(a: string, b: string) {\n    const ai = keys.indexOf(a);\n    const bi = keys.indexOf(b);\n\n    if (ai === -1 && bi === -1) {\n      return a.localeCompare(b);\n    }\n\n    return ai <= bi ? -1 : 1;\n  }\n\n  writeFileSync(\n    configPath,\n    YAMLStringify(context.graphqlConfig, {\n      sortKeys,\n    })\n  );\n}\n"
  },
  {
    "path": "packages/commands/init/src/search-codegen-config.ts",
    "content": "import { cosmiconfig, defaultLoaders } from 'cosmiconfig';\nimport { env } from 'string-env-interpolation';\n\nfunction generateSearchPlaces(moduleName: string) {\n  const extensions = ['json', 'yaml', 'yml', 'js', 'config.js'];\n  // gives codegen.json...\n  const regular = extensions.map((ext) => `${moduleName}.${ext}`);\n  // gives .codegenrc.json... but no .codegenrc.config.js\n  const dot = extensions.filter((ext) => ext !== 'config.js').map((ext) => `.${moduleName}rc.${ext}`);\n\n  return regular.concat(dot);\n}\n\nfunction customLoader(ext: 'json' | 'yaml' | 'js') {\n  function loader(filepath: string, content: string) {\n    if (typeof process !== 'undefined' && 'env' in process) {\n      content = env(content);\n    }\n\n    if (ext === 'json') {\n      return defaultLoaders['.json'](filepath, content);\n    }\n\n    if (ext === 'yaml') {\n      return defaultLoaders['.yaml'](filepath, content);\n    }\n\n    if (ext === 'js') {\n      return defaultLoaders['.js'](filepath, content);\n    }\n  }\n\n  return loader;\n}\n\nexport async function searchCodegenConfig(cwd: string) {\n  const moduleName = 'codegen';\n  const cosmi = cosmiconfig(moduleName, {\n    searchPlaces: generateSearchPlaces(moduleName),\n    loaders: {\n      '.json': customLoader('json'),\n      '.yaml': customLoader('yaml'),\n      '.yml': customLoader('yaml'),\n      '.js': customLoader('js'),\n      noExt: customLoader('yaml'),\n    },\n  });\n  return cosmi.search(cwd);\n}\n"
  },
  {
    "path": "packages/commands/init/src/sources/from-existing.ts",
    "content": "import rimraf from 'rimraf';\nimport { join } from 'path';\nimport { existsSync } from 'fs-extra';\nimport { prompt } from 'inquirer';\nimport { Context, PackageManifest } from '../common';\nimport { searchCodegenConfig } from '../search-codegen-config';\n\nexport async function fromExisting({ context, project }: { context: Context; project: PackageManifest }) {\n  const manifestPath = join(context.path, 'package.json');\n\n  if (existsSync(manifestPath)) {\n    const { name: projectName } = require(manifestPath);\n    context.name = projectName;\n  }\n\n  const result = await searchCodegenConfig(context.path);\n\n  if (result && !result.isEmpty) {\n    const codegenFilePath = result.filepath;\n    const { willBeMerged } = await prompt([\n      {\n        type: 'confirm',\n        name: 'willBeMerged',\n        message: `GraphQL Code Generator configuration has been detected in ${codegenFilePath}.\\n Do you want to use the same configuration with GraphQL CLI?`,\n        default: true,\n      },\n    ]);\n\n    if (willBeMerged) {\n      project.addDependency('@graphql-cli/codegen');\n      const codegenConfig = result.config;\n\n      context.graphqlConfig.extensions.codegen = {\n        generates: {},\n      };\n\n      for (const key in codegenConfig) {\n        if (key === 'schema') {\n          context.graphqlConfig.schema = codegenConfig.schema;\n        } else if (key === 'documents') {\n          context.graphqlConfig.documents = codegenConfig.documents;\n        } else {\n          context.graphqlConfig.extensions.codegen[key] = codegenConfig[key];\n        }\n      }\n\n      rimraf.sync(result.filepath);\n    }\n  }\n}\n"
  },
  {
    "path": "packages/commands/init/src/sources/from-open-api.ts",
    "content": "import ora from 'ora';\nimport { safeLoad as YAMLParse } from 'js-yaml';\nimport { readFileSync, writeFileSync, ensureFile } from 'fs-extra';\nimport { prompt } from 'inquirer';\nimport { Context } from '../common';\n\nexport async function fromExistingOpenAPI(context: Context) {\n  const { openApiPath } = await prompt<{ openApiPath: string }>([\n    {\n      type: 'input',\n      name: 'openApiPath',\n      message: 'Enter your OpenAPI schema path',\n      default: './swagger.json',\n    },\n  ]);\n\n  const processingOpenAPISpinner = ora(`Processing OpenAPI definition: ${openApiPath}`).start();\n  const schemaText: string = readFileSync(`${openApiPath}`, 'utf8');\n\n  const parsedObject =\n    openApiPath.endsWith('yaml') || openApiPath.endsWith('yml') ? YAMLParse(schemaText) : JSON.parse(schemaText);\n\n  const datamodelPath = `${context.graphqlConfig.extensions.graphback.model}/datamodel.graphql`;\n\n  try {\n    const { createGraphQLSchema } = await import('openapi-to-graphql');\n    const { schema } = await createGraphQLSchema(parsedObject, {\n      strict: true,\n      fillEmptyResponses: true,\n      equivalentToMessages: false,\n    });\n    const { printSchema } = await import('graphql');\n    const schemaString = printSchema(schema);\n\n    await ensureFile(datamodelPath);\n\n    writeFileSync(datamodelPath, schemaString);\n    processingOpenAPISpinner.succeed();\n  } catch (err) {\n    processingOpenAPISpinner.fail(`Failed to process OpenAPI definition: ${datamodelPath}. Error: ${err}`);\n  }\n}\n"
  },
  {
    "path": "packages/commands/init/src/sources/from-scratch.ts",
    "content": "import { join } from 'path';\nimport { prompt } from 'inquirer';\nimport { Context } from '../common';\nimport { handler } from 'create-graphback';\n\nexport async function fromScratch({\n  context,\n  templateName,\n  templateUrl,\n}: {\n  context: Context;\n  templateName: string;\n  templateUrl: string;\n}) {\n  if (!context.name) {\n    const { projectName: enteredName } = await prompt([\n      {\n        type: 'input',\n        name: 'projectName',\n        message: 'What is the name of the project?',\n        default: 'my-graphql-project',\n      },\n    ]);\n    context.name = enteredName;\n    context.path = join(process.cwd(), context.name);\n  }\n\n  await handler({ name: context.name, templateName, templateUrl });\n}\n"
  },
  {
    "path": "packages/commands/init/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"skipLibCheck\": true,\n    \"esModuleInterop\": true,\n    \"importHelpers\": true,\n    \"experimentalDecorators\": true,\n    \"module\": \"commonjs\",\n    \"target\": \"es2018\",\n    \"lib\": [\"es6\", \"esnext\", \"es2015\", \"dom\"],\n    \"moduleResolution\": \"node\",\n    \"emitDecoratorMetadata\": true,\n    \"sourceMap\": true,\n    \"declaration\": true,\n    \"outDir\": \"./dist\",\n    \"rootDir\": \"./src\",\n    \"noImplicitAny\": true,\n    \"noImplicitThis\": true,\n    \"alwaysStrict\": true,\n    \"noImplicitReturns\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": false,\n    \"resolveJsonModule\": true\n  },\n  \"files\": [\"src/index.ts\"],\n  \"exclude\": [\"node_modules\"]\n}\n"
  },
  {
    "path": "packages/commands/serve/.gitignore",
    "content": "node_modules\nnpm-debug.log\ndist\ntemp\nyarn-error.log\ntests/coverage/"
  },
  {
    "path": "packages/commands/serve/.npmignore",
    "content": "src/"
  },
  {
    "path": "packages/commands/serve/README.md",
    "content": "## GraphQL CLI Serve command\n\nThis package is part of the GraphQL CLI ecosystem and it is not designed to be consumed separately.\nGo to: https://github.com/Urigo/graphql-cli for more information\n"
  },
  {
    "path": "packages/commands/serve/package.json",
    "content": "{\n  \"name\": \"@graphql-cli/serve\",\n  \"description\": \"Serves a GraphQL server using an in memory MongoDB\",\n  \"version\": \"5.0.0\",\n  \"license\": \"MIT\",\n  \"main\": \"dist/index.js\",\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/Urigo/graphql-cli\",\n    \"directory\": \"packages/commands/serve\"\n  },\n  \"keywords\": [\n    \"graphql-cli\",\n    \"graphql-cli-plugin\"\n  ],\n  \"scripts\": {\n    \"build\": \"tsc\"\n  },\n  \"peerDependencies\": {\n    \"graphql\": \"15.7.2\"\n  },\n  \"dependencies\": {\n    \"@graphql-cli/common\": \"^5.0.0\",\n    \"graphql-serve\": \"^1.1.2\",\n    \"tslib\": \"~2.3.0\"\n  }\n}\n"
  },
  {
    "path": "packages/commands/serve/src/index.ts",
    "content": "import { defineCommand } from '@graphql-cli/common';\nimport { serve } from 'graphql-serve';\n\nexport default defineCommand(() => {\n  return {\n    builder: (builder: any) => {\n      serve.builder(builder);\n      return builder;\n    },\n    command: serve.command,\n    handler: serve.handler,\n  };\n});\n"
  },
  {
    "path": "packages/commands/serve/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"skipLibCheck\": true,\n    \"esModuleInterop\": true,\n    \"importHelpers\": true,\n    \"experimentalDecorators\": true,\n    \"module\": \"commonjs\",\n    \"target\": \"es2018\",\n    \"lib\": [\"es6\", \"esnext\", \"es2015\", \"dom\"],\n    \"moduleResolution\": \"node\",\n    \"emitDecoratorMetadata\": true,\n    \"sourceMap\": true,\n    \"declaration\": true,\n    \"outDir\": \"./dist\",\n    \"rootDir\": \"./src\",\n    \"noImplicitAny\": true,\n    \"noImplicitThis\": true,\n    \"alwaysStrict\": true,\n    \"noImplicitReturns\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": false\n  },\n  \"files\": [\"src/index.ts\"],\n  \"exclude\": [\"node_modules\"]\n}\n"
  },
  {
    "path": "packages/common/.gitignore",
    "content": "node_modules\nnpm-debug.log\ndist\ntemp\nyarn-error.log\ntests/coverage/"
  },
  {
    "path": "packages/common/.npmignore",
    "content": "src/"
  },
  {
    "path": "packages/common/package.json",
    "content": "{\n  \"name\": \"@graphql-cli/common\",\n  \"version\": \"5.0.0\",\n  \"license\": \"MIT\",\n  \"main\": \"dist/index.js\",\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"build\": \"tsc\"\n  },\n  \"peerDependencies\": {\n    \"graphql-config\": \"3.4.1\",\n    \"yargs\": \"16.2.0\"\n  },\n  \"dependencies\": {\n    \"@graphql-tools/load\": \"^7.1.6\",\n    \"tslib\": \"^2.3.1\"\n  }\n}\n"
  },
  {
    "path": "packages/common/src/command.ts",
    "content": "import { CommandModule } from 'yargs';\nimport { loadConfig, GraphQLConfig } from 'graphql-config';\nimport { loadDocuments, loadSchema } from '@graphql-tools/load';\nimport { Loader } from '@graphql-tools/utils';\nimport { LoadConfigOptions } from './types';\n\nexport type CommandFactory<T = {}, U = {}> = (api: {\n  useConfig: (options?: LoadConfigOptions) => Promise<GraphQLConfig>;\n  useLoaders: typeof useLoaders;\n}) => CommandModule<T, U>;\n\nexport function defineCommand<T = {}, U = {}>(factory: CommandFactory<T, U>) {\n  return factory;\n}\n\nexport function useConfig(options: LoadConfigOptions = {}) {\n  return loadConfig({\n    rootDir: process.cwd(),\n    throwOnEmpty: true,\n    throwOnMissing: true,\n    ...options,\n  });\n}\n\ntype PointerOf<T extends (...args: any) => any> = Parameters<T>[0];\ntype OptionsOf<T extends (...args: any) => any> = Omit<Parameters<T>[1], 'loaders'>;\n\nexport function useLoaders({ loaders }: { loaders: Loader[] }) {\n  return {\n    loadDocuments(pointer: PointerOf<typeof loadDocuments>, options: OptionsOf<typeof loadDocuments>) {\n      return loadDocuments(pointer, { loaders, ...options });\n    },\n    loadSchema(pointer: PointerOf<typeof loadSchema>, options: OptionsOf<typeof loadSchema>) {\n      return loadSchema(pointer, { loaders, ...options });\n    },\n  };\n}\n"
  },
  {
    "path": "packages/common/src/index.ts",
    "content": "export * from './types';\nexport * from './command';\n"
  },
  {
    "path": "packages/common/src/types.ts",
    "content": "import { loadConfig } from 'graphql-config';\n\nexport type LoadConfigOptions = Partial<Parameters<typeof loadConfig>[0]>;\n"
  },
  {
    "path": "packages/common/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"skipLibCheck\": true,\n    \"importHelpers\": true,\n    \"experimentalDecorators\": true,\n    \"module\": \"commonjs\",\n    \"target\": \"es2018\",\n    \"lib\": [\"es6\", \"esnext\", \"es2015\", \"dom\"],\n    \"moduleResolution\": \"node\",\n    \"emitDecoratorMetadata\": true,\n    \"sourceMap\": true,\n    \"declaration\": true,\n    \"outDir\": \"./dist\",\n    \"rootDir\": \"./src\",\n    \"noImplicitAny\": true,\n    \"noImplicitThis\": true,\n    \"alwaysStrict\": true,\n    \"noImplicitReturns\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": false\n  },\n  \"files\": [\"src/index.ts\"],\n  \"exclude\": [\"node_modules\"]\n}\n"
  },
  {
    "path": "packages/loaders/.gitignore",
    "content": "node_modules\nnpm-debug.log\ndist\ntemp\nyarn-error.log\ntests/coverage/"
  },
  {
    "path": "packages/loaders/.npmignore",
    "content": "src/"
  },
  {
    "path": "packages/loaders/package.json",
    "content": "{\n  \"name\": \"@graphql-cli/loaders\",\n  \"description\": \"Internal usage\",\n  \"version\": \"5.0.0\",\n  \"license\": \"MIT\",\n  \"main\": \"dist/index.js\",\n  \"publishConfig\": {\n    \"access\": \"public\"\n  },\n  \"scripts\": {\n    \"build\": \"tsc\"\n  },\n  \"peerDependencies\": {\n    \"graphql\": \"15.7.2\"\n  },\n  \"dependencies\": {\n    \"@graphql-tools/apollo-engine-loader\": \"^7.0.4\",\n    \"@graphql-tools/code-file-loader\": \"^7.0.4\",\n    \"@graphql-tools/git-loader\": \"^7.0.4\",\n    \"@graphql-tools/github-loader\": \"^7.0.4\",\n    \"@graphql-tools/prisma-loader\": \"^7.0.5\",\n    \"@graphql-tools/url-loader\": \"^7.0.10\",\n    \"@graphql-tools/utils\": \"^8.1.1\"\n  }\n}\n"
  },
  {
    "path": "packages/loaders/src/index.ts",
    "content": "import { Loader } from '@graphql-tools/utils';\nimport { ApolloEngineLoader } from '@graphql-tools/apollo-engine-loader';\nimport { CodeFileLoader } from '@graphql-tools/code-file-loader';\nimport { GitLoader } from '@graphql-tools/git-loader';\nimport { GithubLoader } from '@graphql-tools/github-loader';\nimport { PrismaLoader } from '@graphql-tools/prisma-loader';\nimport { UrlLoader } from '@graphql-tools/url-loader';\n\nexport const loaders: Loader[] = [\n  new ApolloEngineLoader(),\n  new CodeFileLoader(),\n  new GitLoader(),\n  new GithubLoader(),\n  new PrismaLoader(),\n  new UrlLoader(),\n];\n"
  },
  {
    "path": "packages/loaders/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"skipLibCheck\": true,\n    \"importHelpers\": true,\n    \"experimentalDecorators\": true,\n    \"module\": \"commonjs\",\n    \"target\": \"es2018\",\n    \"lib\": [\"es6\", \"esnext\", \"es2015\", \"dom\"],\n    \"moduleResolution\": \"node\",\n    \"emitDecoratorMetadata\": true,\n    \"sourceMap\": true,\n    \"declaration\": true,\n    \"outDir\": \"./dist\",\n    \"rootDir\": \"./src\",\n    \"noImplicitAny\": true,\n    \"noImplicitThis\": true,\n    \"alwaysStrict\": true,\n    \"noImplicitReturns\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": false\n  },\n  \"files\": [\"src/index.ts\"],\n  \"exclude\": [\"node_modules\"]\n}\n"
  },
  {
    "path": "renovate.json",
    "content": "{\n  \"extends\": [\n    \"config:base\"\n  ],\n  \"automerge\": true,\n  \"major\": {\n    \"automerge\": false\n  },\n  \"rangeStrategy\": \"replace\"\n}\n"
  },
  {
    "path": "scripts/introspect-config.js",
    "content": "const { loadSchema } = require('@graphql-tools/load');\nconst { GraphQLFileLoader } = require('@graphql-tools/graphql-file-loader');\nconst { printSchemaWithDirectives } = require('@graphql-tools/utils');\nconst { writeFileSync } = require('fs');\nconst { resolve } = require('path');\nconst { DIRECTIVES } = require('graphql-to-config-schema');\n\nasync function main() {\n  const schema = await loadSchema([DIRECTIVES, './**/yaml-config.graphql'], {\n    loaders: [new GraphQLFileLoader()],\n    assumeValidSDL: true,\n  });\n  \n  writeFileSync(resolve(__dirname, '../schema.graphql'), printSchemaWithDirectives(schema));\n}\n\nmain().catch(console.error);\n"
  },
  {
    "path": "scripts/release.js",
    "content": "const { argv } = require('yargs');\nconst { sync: glob } = require('globby');\nconst { writeFile } = require('fs-extra');\nconst { resolve, dirname, join } = require('path');\nconst semver = require('semver');\nconst cp = require('child_process');\nconst rootPackageJson = require('../package.json');\n\nasync function release() {\n  let version = process.env.RELEASE_VERSION || rootPackageJson.version;\n\n  if (version.startsWith('v')) {\n    version = version.replace('v', '');\n  }\n\n  let tag = argv.tag || 'latest';\n\n  if (argv.canary) {\n    const gitHash = cp.spawnSync('git', ['rev-parse', '--short', 'HEAD']).stdout.toString().trim();\n    version = semver.inc(version, 'prerelease', true, 'alpha-' + gitHash);\n    tag = 'canary';\n  }\n\n  const workspaceGlobs = (rootPackageJson.workspaces.packages || rootPackageJson.workspaces).map(\n    (workspace) => workspace + '/package.json'\n  );\n  const packageJsonPaths = glob(workspaceGlobs).map((packageJsonPath) => resolve(process.cwd(), packageJsonPath));\n  const packageNames = packageJsonPaths.map((packageJsonPath) => require(packageJsonPath).name);\n\n  rootPackageJson.version = version;\n  \n  await writeFile(resolve(__dirname, '../package.json'), JSON.stringify(rootPackageJson, null, 2));\n  \n  await Promise.all(\n    packageJsonPaths.map(async (packageJsonPath) => {\n      const packageJson = require(packageJsonPath);\n\n      packageJson.version = version;\n\n      for (const dependency in packageJson.dependencies) {\n        if (packageNames.includes(dependency)) {\n          packageJson.dependencies[dependency] = version;\n        }\n      }\n\n      for (const dependency in packageJson.devDependencies) {\n        if (packageNames.includes(dependency)) {\n          packageJson.devDependencies[dependency] = version;\n        }\n      }\n\n      await writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2));\n\n      if (!packageJson.private) {\n        const distDirName = (packageJson.publishConfig && packageJson.publishConfig.directory) || '';\n        const distPath = join(dirname(packageJsonPath), distDirName);\n\n        //Fix package.json in dist directory\n        const distPackageJsonPath = join(distPath, 'package.json');\n        const distPackageJson = require(distPackageJsonPath);\n\n        distPackageJson.name = packageJson.name;\n        distPackageJson.version = packageJson.version;\n        distPackageJson.dependencies = packageJson.dependencies;\n        distPackageJson.devDependencies = packageJson.devDependencies;\n        distPackageJson.publishConfig = {\n          access: (packageJson.publishConfig && packageJson.publishConfig.access) || 'public',\n        };\n\n        await writeFile(distPackageJsonPath, JSON.stringify(distPackageJson, null, 2));\n\n        return new Promise((resolve, reject) => {\n          const publishSpawn = cp.spawn('npm', [\n            'publish',\n            distPath,\n            '--tag',\n            tag,\n            '--access',\n            distPackageJson.publishConfig.access,\n          ]);\n\n          publishSpawn.stdout.on('data', (data) => {\n            console.info(data.toString('utf8'));\n          });\n\n          publishSpawn.stderr.on('data', function (data) {\n            console.error(data.toString('utf8'));\n          });\n\n          publishSpawn.on('exit', function (code, signal) {\n            if (code !== 0) {\n              reject(new Error(`npm publish exited with code: ${code} and signal: ${signal}`));\n            } else {\n              resolve();\n            }\n          });\n        });\n      }\n    })\n  );\n  \n  console.info(`${tag} => ${version}`);\n}\n\nrelease().catch((err) => {\n  console.error(err);\n  process.exit(1);\n});\n"
  },
  {
    "path": "templates/fullstack/.dockerignore",
    "content": "node_modules\nnpm-debug.log"
  },
  {
    "path": "templates/fullstack/.gitignore",
    "content": "node_modules\ndist\ntypes\nyarn.lock\nyarn-error.log\n"
  },
  {
    "path": "templates/fullstack/.graphqlrc.yml",
    "content": "schema: ./server/src/schema/**/*.graphql\ndocuments: ./client/src/graphql/**/*.graphql\nextensions:\n  codegen:\n    generates:\n      ./client/src/generated-types.tsx:\n        config:\n          withComponent: false\n          withHOC: false\n          withHooks: true\n          skipDocumentsValidation: true\n        plugins:\n          - add: '/* tslint:disable */'\n          - typescript\n          - typescript-operations\n          - typescript-react-apollo\n      ./server/src/generated-types.ts:\n        config:\n          contextType: '@graphback/core#GraphbackContext'\n          mappers:\n            Comment: './generated-db-types#comment'\n            Note: './generated-db-types#note'\n          useIndexSignature: true\n          skipDocumentsValidation: true\n        plugins:\n          - add: '/* tslint:disable */'\n          - typescript\n          - typescript-resolvers\n  # Graphback configuration\n  graphback:\n    ##  Input schema\n    model: ./model\n    ## Global configuration for CRUD generator\n    crud:\n      create: true\n      update: true\n      find: true\n      findOne: true\n      delete: true\n      subCreate: true\n      subUpdate: true\n      subDelete: true\n    ## Codegen plugins\n    plugins:\n        graphback-schema:\n          outputPath: ./server/src/schema/schema.graphql\n        graphback-client:\n          outputFile: ./client/src/graphql/graphback.graphql"
  },
  {
    "path": "templates/fullstack/Dockerfile",
    "content": "# Stage 1 - the build process\nFROM node:10 as compile-server\nWORKDIR /usr/src/app\nCOPY . .\nRUN npm install\nRUN npm run build\n\nCMD [ \"npm\", \"start\" ]"
  },
  {
    "path": "templates/fullstack/README.md",
    "content": "# GraphQL CLI Basic Full Stack Template\n\nStarter Full Stack template using GraphQL CLI.\n\n## Usage\n\nThis project has been created using GraphQL CLI. Run the project using the following steps:\n\n### Install\n\n    yarn install\n\n### Database\nStart the database\n\n    docker-compose up -d\n\nGenerate resources(schema and resolvers) and create database\n\n    yarn graphql generate --backend\n    yarn graphql generate --db\n\nGenerate typings for Database Schema and Resolvers\n\n    yarn schemats generate\n    yarn graphql codegen\n\n### Server\nStart the server\n\n    yarn start:server\n\n### Client\n\nGenerate queries, mutations and subscriptions for client-side project\n\n    yarn graphql generate --client\n\nGenerate React components\n\n    yarn graphql codegen\n\nStart React App\n\n    yarn start:client\n"
  },
  {
    "path": "templates/fullstack/client/.gitignore",
    "content": "# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.\n\n# dependencies\n/node_modules\n/.pnp\n.pnp.js\n\n# testing\n/coverage\n\n# production\n/build\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "templates/fullstack/client/generated-types.tsx",
    "content": "/* tslint:disable */\nimport gql from 'graphql-tag';\nimport * as ApolloReactCommon from '@apollo/react-common';\nimport * as ApolloReactHooks from '@apollo/react-hooks';\nexport type Maybe<T> = T | null;\n\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n  ID: string;\n  String: string;\n  Boolean: boolean;\n  Int: number;\n  Float: number;\n};\n\n/**  @model  */\nexport type Comment = {\n  __typename?: 'Comment';\n  id: Scalars['ID'];\n  text?: Maybe<Scalars['String']>;\n  description?: Maybe<Scalars['String']>;\n  /**  @manyToOne field: 'comments', key: 'noteId'  */\n  note?: Maybe<Note>;\n};\n\nexport type CommentInput = {\n  id?: Maybe<Scalars['ID']>;\n  text?: Maybe<Scalars['String']>;\n  description?: Maybe<Scalars['String']>;\n  noteId?: Maybe<Scalars['String']>;\n};\n\nexport type Mutation = {\n  __typename?: 'Mutation';\n  createNote: Note;\n  updateNote: Note;\n  deleteNote: Note;\n  createComment: Comment;\n  updateComment: Comment;\n  deleteComment: Comment;\n};\n\nexport type MutationCreateNoteArgs = {\n  input?: Maybe<NoteInput>;\n};\n\nexport type MutationUpdateNoteArgs = {\n  input?: Maybe<NoteInput>;\n};\n\nexport type MutationDeleteNoteArgs = {\n  input?: Maybe<NoteInput>;\n};\n\nexport type MutationCreateCommentArgs = {\n  input?: Maybe<CommentInput>;\n};\n\nexport type MutationUpdateCommentArgs = {\n  input?: Maybe<CommentInput>;\n};\n\nexport type MutationDeleteCommentArgs = {\n  input?: Maybe<CommentInput>;\n};\n\n/**  @model  */\nexport type Note = {\n  __typename?: 'Note';\n  id: Scalars['ID'];\n  title: Scalars['String'];\n  description?: Maybe<Scalars['String']>;\n  /** @oneToMany field: 'note', key: 'noteId' */\n  comments: Array<Maybe<Comment>>;\n};\n\nexport type NoteInput = {\n  id?: Maybe<Scalars['ID']>;\n  title?: Maybe<Scalars['String']>;\n  description?: Maybe<Scalars['String']>;\n};\n\nexport type Query = {\n  __typename?: 'Query';\n  findAllNotes: Array<Maybe<Note>>;\n  findNotes: Array<Maybe<Note>>;\n  findAllComments: Array<Maybe<Comment>>;\n  findComments: Array<Maybe<Comment>>;\n};\n\nexport type QueryFindAllNotesArgs = {\n  limit?: Maybe<Scalars['Int']>;\n  offset?: Maybe<Scalars['Int']>;\n};\n\nexport type QueryFindNotesArgs = {\n  fields?: Maybe<NoteInput>;\n  limit?: Maybe<Scalars['Int']>;\n  offset?: Maybe<Scalars['Int']>;\n};\n\nexport type QueryFindAllCommentsArgs = {\n  limit?: Maybe<Scalars['Int']>;\n  offset?: Maybe<Scalars['Int']>;\n};\n\nexport type QueryFindCommentsArgs = {\n  fields?: Maybe<CommentInput>;\n  limit?: Maybe<Scalars['Int']>;\n  offset?: Maybe<Scalars['Int']>;\n};\n\nexport type Subscription = {\n  __typename?: 'Subscription';\n  newNote: Note;\n  updatedNote: Note;\n  deletedNote: Note;\n  newComment: Comment;\n  updatedComment: Comment;\n  deletedComment: Comment;\n};\n\nexport type SubscriptionNewNoteArgs = {\n  input?: Maybe<NoteInput>;\n};\n\nexport type SubscriptionUpdatedNoteArgs = {\n  input?: Maybe<NoteInput>;\n};\n\nexport type SubscriptionDeletedNoteArgs = {\n  input?: Maybe<NoteInput>;\n};\n\nexport type SubscriptionNewCommentArgs = {\n  input?: Maybe<CommentInput>;\n};\n\nexport type SubscriptionUpdatedCommentArgs = {\n  input?: Maybe<CommentInput>;\n};\n\nexport type SubscriptionDeletedCommentArgs = {\n  input?: Maybe<CommentInput>;\n};\n\nexport type CommentFieldsFragment = { __typename?: 'Comment' } & Pick<Comment, 'id' | 'text' | 'description'>;\n\nexport type CommentExpandedFieldsFragment = { __typename?: 'Comment' } & Pick<\n  Comment,\n  'id' | 'text' | 'description'\n> & { note: Maybe<{ __typename?: 'Note' } & Pick<Note, 'id' | 'title' | 'description'>> };\n\nexport type NoteFieldsFragment = { __typename?: 'Note' } & Pick<Note, 'id' | 'title' | 'description'>;\n\nexport type NoteExpandedFieldsFragment = { __typename?: 'Note' } & Pick<Note, 'id' | 'title' | 'description'> & {\n    comments: Array<Maybe<{ __typename?: 'Comment' } & Pick<Comment, 'id' | 'text' | 'description'>>>;\n  };\n\nexport type CreateCommentMutationVariables = {\n  input: CommentInput;\n};\n\nexport type CreateCommentMutation = { __typename?: 'Mutation' } & {\n  createComment: { __typename?: 'Comment' } & CommentFieldsFragment;\n};\n\nexport type CreateNoteMutationVariables = {\n  input: NoteInput;\n};\n\nexport type CreateNoteMutation = { __typename?: 'Mutation' } & {\n  createNote: { __typename?: 'Note' } & NoteFieldsFragment;\n};\n\nexport type DeleteCommentMutationVariables = {\n  input: CommentInput;\n};\n\nexport type DeleteCommentMutation = { __typename?: 'Mutation' } & {\n  deleteComment: { __typename?: 'Comment' } & CommentFieldsFragment;\n};\n\nexport type DeleteNoteMutationVariables = {\n  input: NoteInput;\n};\n\nexport type DeleteNoteMutation = { __typename?: 'Mutation' } & {\n  deleteNote: { __typename?: 'Note' } & NoteFieldsFragment;\n};\n\nexport type UpdateCommentMutationVariables = {\n  input: CommentInput;\n};\n\nexport type UpdateCommentMutation = { __typename?: 'Mutation' } & {\n  updateComment: { __typename?: 'Comment' } & CommentFieldsFragment;\n};\n\nexport type UpdateNoteMutationVariables = {\n  input: NoteInput;\n};\n\nexport type UpdateNoteMutation = { __typename?: 'Mutation' } & {\n  updateNote: { __typename?: 'Note' } & NoteFieldsFragment;\n};\n\nexport type FindAllCommentsQueryVariables = {\n  limit?: Maybe<Scalars['Int']>;\n  offset?: Maybe<Scalars['Int']>;\n};\n\nexport type FindAllCommentsQuery = { __typename?: 'Query' } & {\n  findAllComments: Array<Maybe<{ __typename?: 'Comment' } & CommentExpandedFieldsFragment>>;\n};\n\nexport type FindAllNotesQueryVariables = {\n  limit?: Maybe<Scalars['Int']>;\n  offset?: Maybe<Scalars['Int']>;\n};\n\nexport type FindAllNotesQuery = { __typename?: 'Query' } & {\n  findAllNotes: Array<Maybe<{ __typename?: 'Note' } & NoteExpandedFieldsFragment>>;\n};\n\nexport type FindCommentsQueryVariables = {\n  fields: CommentInput;\n  limit?: Maybe<Scalars['Int']>;\n  offset?: Maybe<Scalars['Int']>;\n};\n\nexport type FindCommentsQuery = { __typename?: 'Query' } & {\n  findComments: Array<Maybe<{ __typename?: 'Comment' } & CommentExpandedFieldsFragment>>;\n};\n\nexport type FindNotesQueryVariables = {\n  fields: NoteInput;\n  limit?: Maybe<Scalars['Int']>;\n  offset?: Maybe<Scalars['Int']>;\n};\n\nexport type FindNotesQuery = { __typename?: 'Query' } & {\n  findNotes: Array<Maybe<{ __typename?: 'Note' } & NoteExpandedFieldsFragment>>;\n};\n\nexport type DeletedCommentSubscriptionVariables = {};\n\nexport type DeletedCommentSubscription = { __typename?: 'Subscription' } & {\n  deletedComment: { __typename?: 'Comment' } & CommentFieldsFragment;\n};\n\nexport type DeletedNoteSubscriptionVariables = {};\n\nexport type DeletedNoteSubscription = { __typename?: 'Subscription' } & {\n  deletedNote: { __typename?: 'Note' } & NoteFieldsFragment;\n};\n\nexport type NewCommentSubscriptionVariables = {};\n\nexport type NewCommentSubscription = { __typename?: 'Subscription' } & {\n  newComment: { __typename?: 'Comment' } & CommentFieldsFragment;\n};\n\nexport type NewNoteSubscriptionVariables = {};\n\nexport type NewNoteSubscription = { __typename?: 'Subscription' } & {\n  newNote: { __typename?: 'Note' } & NoteFieldsFragment;\n};\n\nexport type UpdatedCommentSubscriptionVariables = {};\n\nexport type UpdatedCommentSubscription = { __typename?: 'Subscription' } & {\n  updatedComment: { __typename?: 'Comment' } & CommentFieldsFragment;\n};\n\nexport type UpdatedNoteSubscriptionVariables = {};\n\nexport type UpdatedNoteSubscription = { __typename?: 'Subscription' } & {\n  updatedNote: { __typename?: 'Note' } & NoteFieldsFragment;\n};\n\nexport const CommentFieldsFragmentDoc = gql`\n  fragment CommentFields on Comment {\n    id\n    text\n    description\n  }\n`;\nexport const CommentExpandedFieldsFragmentDoc = gql`\n  fragment CommentExpandedFields on Comment {\n    id\n    text\n    description\n    note {\n      id\n      title\n      description\n    }\n  }\n`;\nexport const NoteFieldsFragmentDoc = gql`\n  fragment NoteFields on Note {\n    id\n    title\n    description\n  }\n`;\nexport const NoteExpandedFieldsFragmentDoc = gql`\n  fragment NoteExpandedFields on Note {\n    id\n    title\n    description\n    comments {\n      id\n      text\n      description\n    }\n  }\n`;\nexport const CreateCommentDocument = gql`\n  mutation createComment($input: CommentInput!) {\n    createComment(input: $input) {\n      ...CommentFields\n    }\n  }\n  ${CommentFieldsFragmentDoc}\n`;\nexport type CreateCommentMutationFn = ApolloReactCommon.MutationFunction<\n  CreateCommentMutation,\n  CreateCommentMutationVariables\n>;\n\n/**\n * __useCreateCommentMutation__\n *\n * To run a mutation, you first call `useCreateCommentMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useCreateCommentMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [createCommentMutation, { data, loading, error }] = useCreateCommentMutation({\n *   variables: {\n *      input: // value for 'input'\n *   },\n * });\n */\nexport function useCreateCommentMutation(\n  baseOptions?: ApolloReactHooks.MutationHookOptions<CreateCommentMutation, CreateCommentMutationVariables>\n) {\n  return ApolloReactHooks.useMutation<CreateCommentMutation, CreateCommentMutationVariables>(\n    CreateCommentDocument,\n    baseOptions\n  );\n}\nexport type CreateCommentMutationHookResult = ReturnType<typeof useCreateCommentMutation>;\nexport type CreateCommentMutationResult = ApolloReactCommon.MutationResult<CreateCommentMutation>;\nexport type CreateCommentMutationOptions = ApolloReactCommon.BaseMutationOptions<\n  CreateCommentMutation,\n  CreateCommentMutationVariables\n>;\nexport const CreateNoteDocument = gql`\n  mutation createNote($input: NoteInput!) {\n    createNote(input: $input) {\n      ...NoteFields\n    }\n  }\n  ${NoteFieldsFragmentDoc}\n`;\nexport type CreateNoteMutationFn = ApolloReactCommon.MutationFunction<CreateNoteMutation, CreateNoteMutationVariables>;\n\n/**\n * __useCreateNoteMutation__\n *\n * To run a mutation, you first call `useCreateNoteMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useCreateNoteMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [createNoteMutation, { data, loading, error }] = useCreateNoteMutation({\n *   variables: {\n *      input: // value for 'input'\n *   },\n * });\n */\nexport function useCreateNoteMutation(\n  baseOptions?: ApolloReactHooks.MutationHookOptions<CreateNoteMutation, CreateNoteMutationVariables>\n) {\n  return ApolloReactHooks.useMutation<CreateNoteMutation, CreateNoteMutationVariables>(CreateNoteDocument, baseOptions);\n}\nexport type CreateNoteMutationHookResult = ReturnType<typeof useCreateNoteMutation>;\nexport type CreateNoteMutationResult = ApolloReactCommon.MutationResult<CreateNoteMutation>;\nexport type CreateNoteMutationOptions = ApolloReactCommon.BaseMutationOptions<\n  CreateNoteMutation,\n  CreateNoteMutationVariables\n>;\nexport const DeleteCommentDocument = gql`\n  mutation deleteComment($input: CommentInput!) {\n    deleteComment(input: $input) {\n      ...CommentFields\n    }\n  }\n  ${CommentFieldsFragmentDoc}\n`;\nexport type DeleteCommentMutationFn = ApolloReactCommon.MutationFunction<\n  DeleteCommentMutation,\n  DeleteCommentMutationVariables\n>;\n\n/**\n * __useDeleteCommentMutation__\n *\n * To run a mutation, you first call `useDeleteCommentMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useDeleteCommentMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [deleteCommentMutation, { data, loading, error }] = useDeleteCommentMutation({\n *   variables: {\n *      input: // value for 'input'\n *   },\n * });\n */\nexport function useDeleteCommentMutation(\n  baseOptions?: ApolloReactHooks.MutationHookOptions<DeleteCommentMutation, DeleteCommentMutationVariables>\n) {\n  return ApolloReactHooks.useMutation<DeleteCommentMutation, DeleteCommentMutationVariables>(\n    DeleteCommentDocument,\n    baseOptions\n  );\n}\nexport type DeleteCommentMutationHookResult = ReturnType<typeof useDeleteCommentMutation>;\nexport type DeleteCommentMutationResult = ApolloReactCommon.MutationResult<DeleteCommentMutation>;\nexport type DeleteCommentMutationOptions = ApolloReactCommon.BaseMutationOptions<\n  DeleteCommentMutation,\n  DeleteCommentMutationVariables\n>;\nexport const DeleteNoteDocument = gql`\n  mutation deleteNote($input: NoteInput!) {\n    deleteNote(input: $input) {\n      ...NoteFields\n    }\n  }\n  ${NoteFieldsFragmentDoc}\n`;\nexport type DeleteNoteMutationFn = ApolloReactCommon.MutationFunction<DeleteNoteMutation, DeleteNoteMutationVariables>;\n\n/**\n * __useDeleteNoteMutation__\n *\n * To run a mutation, you first call `useDeleteNoteMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useDeleteNoteMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [deleteNoteMutation, { data, loading, error }] = useDeleteNoteMutation({\n *   variables: {\n *      input: // value for 'input'\n *   },\n * });\n */\nexport function useDeleteNoteMutation(\n  baseOptions?: ApolloReactHooks.MutationHookOptions<DeleteNoteMutation, DeleteNoteMutationVariables>\n) {\n  return ApolloReactHooks.useMutation<DeleteNoteMutation, DeleteNoteMutationVariables>(DeleteNoteDocument, baseOptions);\n}\nexport type DeleteNoteMutationHookResult = ReturnType<typeof useDeleteNoteMutation>;\nexport type DeleteNoteMutationResult = ApolloReactCommon.MutationResult<DeleteNoteMutation>;\nexport type DeleteNoteMutationOptions = ApolloReactCommon.BaseMutationOptions<\n  DeleteNoteMutation,\n  DeleteNoteMutationVariables\n>;\nexport const UpdateCommentDocument = gql`\n  mutation updateComment($input: CommentInput!) {\n    updateComment(input: $input) {\n      ...CommentFields\n    }\n  }\n  ${CommentFieldsFragmentDoc}\n`;\nexport type UpdateCommentMutationFn = ApolloReactCommon.MutationFunction<\n  UpdateCommentMutation,\n  UpdateCommentMutationVariables\n>;\n\n/**\n * __useUpdateCommentMutation__\n *\n * To run a mutation, you first call `useUpdateCommentMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useUpdateCommentMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [updateCommentMutation, { data, loading, error }] = useUpdateCommentMutation({\n *   variables: {\n *      input: // value for 'input'\n *   },\n * });\n */\nexport function useUpdateCommentMutation(\n  baseOptions?: ApolloReactHooks.MutationHookOptions<UpdateCommentMutation, UpdateCommentMutationVariables>\n) {\n  return ApolloReactHooks.useMutation<UpdateCommentMutation, UpdateCommentMutationVariables>(\n    UpdateCommentDocument,\n    baseOptions\n  );\n}\nexport type UpdateCommentMutationHookResult = ReturnType<typeof useUpdateCommentMutation>;\nexport type UpdateCommentMutationResult = ApolloReactCommon.MutationResult<UpdateCommentMutation>;\nexport type UpdateCommentMutationOptions = ApolloReactCommon.BaseMutationOptions<\n  UpdateCommentMutation,\n  UpdateCommentMutationVariables\n>;\nexport const UpdateNoteDocument = gql`\n  mutation updateNote($input: NoteInput!) {\n    updateNote(input: $input) {\n      ...NoteFields\n    }\n  }\n  ${NoteFieldsFragmentDoc}\n`;\nexport type UpdateNoteMutationFn = ApolloReactCommon.MutationFunction<UpdateNoteMutation, UpdateNoteMutationVariables>;\n\n/**\n * __useUpdateNoteMutation__\n *\n * To run a mutation, you first call `useUpdateNoteMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useUpdateNoteMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [updateNoteMutation, { data, loading, error }] = useUpdateNoteMutation({\n *   variables: {\n *      input: // value for 'input'\n *   },\n * });\n */\nexport function useUpdateNoteMutation(\n  baseOptions?: ApolloReactHooks.MutationHookOptions<UpdateNoteMutation, UpdateNoteMutationVariables>\n) {\n  return ApolloReactHooks.useMutation<UpdateNoteMutation, UpdateNoteMutationVariables>(UpdateNoteDocument, baseOptions);\n}\nexport type UpdateNoteMutationHookResult = ReturnType<typeof useUpdateNoteMutation>;\nexport type UpdateNoteMutationResult = ApolloReactCommon.MutationResult<UpdateNoteMutation>;\nexport type UpdateNoteMutationOptions = ApolloReactCommon.BaseMutationOptions<\n  UpdateNoteMutation,\n  UpdateNoteMutationVariables\n>;\nexport const FindAllCommentsDocument = gql`\n  query findAllComments($limit: Int, $offset: Int) {\n    findAllComments(limit: $limit, offset: $offset) {\n      ...CommentExpandedFields\n    }\n  }\n  ${CommentExpandedFieldsFragmentDoc}\n`;\n\n/**\n * __useFindAllCommentsQuery__\n *\n * To run a query within a React component, call `useFindAllCommentsQuery` and pass it any options that fit your needs.\n * When your component renders, `useFindAllCommentsQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useFindAllCommentsQuery({\n *   variables: {\n *      limit: // value for 'limit'\n *      offset: // value for 'offset'\n *   },\n * });\n */\nexport function useFindAllCommentsQuery(\n  baseOptions?: ApolloReactHooks.QueryHookOptions<FindAllCommentsQuery, FindAllCommentsQueryVariables>\n) {\n  return ApolloReactHooks.useQuery<FindAllCommentsQuery, FindAllCommentsQueryVariables>(\n    FindAllCommentsDocument,\n    baseOptions\n  );\n}\nexport function useFindAllCommentsLazyQuery(\n  baseOptions?: ApolloReactHooks.LazyQueryHookOptions<FindAllCommentsQuery, FindAllCommentsQueryVariables>\n) {\n  return ApolloReactHooks.useLazyQuery<FindAllCommentsQuery, FindAllCommentsQueryVariables>(\n    FindAllCommentsDocument,\n    baseOptions\n  );\n}\nexport type FindAllCommentsQueryHookResult = ReturnType<typeof useFindAllCommentsQuery>;\nexport type FindAllCommentsLazyQueryHookResult = ReturnType<typeof useFindAllCommentsLazyQuery>;\nexport type FindAllCommentsQueryResult = ApolloReactCommon.QueryResult<\n  FindAllCommentsQuery,\n  FindAllCommentsQueryVariables\n>;\nexport const FindAllNotesDocument = gql`\n  query findAllNotes($limit: Int, $offset: Int) {\n    findAllNotes(limit: $limit, offset: $offset) {\n      ...NoteExpandedFields\n    }\n  }\n  ${NoteExpandedFieldsFragmentDoc}\n`;\n\n/**\n * __useFindAllNotesQuery__\n *\n * To run a query within a React component, call `useFindAllNotesQuery` and pass it any options that fit your needs.\n * When your component renders, `useFindAllNotesQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useFindAllNotesQuery({\n *   variables: {\n *      limit: // value for 'limit'\n *      offset: // value for 'offset'\n *   },\n * });\n */\nexport function useFindAllNotesQuery(\n  baseOptions?: ApolloReactHooks.QueryHookOptions<FindAllNotesQuery, FindAllNotesQueryVariables>\n) {\n  return ApolloReactHooks.useQuery<FindAllNotesQuery, FindAllNotesQueryVariables>(FindAllNotesDocument, baseOptions);\n}\nexport function useFindAllNotesLazyQuery(\n  baseOptions?: ApolloReactHooks.LazyQueryHookOptions<FindAllNotesQuery, FindAllNotesQueryVariables>\n) {\n  return ApolloReactHooks.useLazyQuery<FindAllNotesQuery, FindAllNotesQueryVariables>(\n    FindAllNotesDocument,\n    baseOptions\n  );\n}\nexport type FindAllNotesQueryHookResult = ReturnType<typeof useFindAllNotesQuery>;\nexport type FindAllNotesLazyQueryHookResult = ReturnType<typeof useFindAllNotesLazyQuery>;\nexport type FindAllNotesQueryResult = ApolloReactCommon.QueryResult<FindAllNotesQuery, FindAllNotesQueryVariables>;\nexport const FindCommentsDocument = gql`\n  query findComments($fields: CommentInput!, $limit: Int, $offset: Int) {\n    findComments(fields: $fields, limit: $limit, offset: $offset) {\n      ...CommentExpandedFields\n    }\n  }\n  ${CommentExpandedFieldsFragmentDoc}\n`;\n\n/**\n * __useFindCommentsQuery__\n *\n * To run a query within a React component, call `useFindCommentsQuery` and pass it any options that fit your needs.\n * When your component renders, `useFindCommentsQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useFindCommentsQuery({\n *   variables: {\n *      fields: // value for 'fields'\n *      limit: // value for 'limit'\n *      offset: // value for 'offset'\n *   },\n * });\n */\nexport function useFindCommentsQuery(\n  baseOptions?: ApolloReactHooks.QueryHookOptions<FindCommentsQuery, FindCommentsQueryVariables>\n) {\n  return ApolloReactHooks.useQuery<FindCommentsQuery, FindCommentsQueryVariables>(FindCommentsDocument, baseOptions);\n}\nexport function useFindCommentsLazyQuery(\n  baseOptions?: ApolloReactHooks.LazyQueryHookOptions<FindCommentsQuery, FindCommentsQueryVariables>\n) {\n  return ApolloReactHooks.useLazyQuery<FindCommentsQuery, FindCommentsQueryVariables>(\n    FindCommentsDocument,\n    baseOptions\n  );\n}\nexport type FindCommentsQueryHookResult = ReturnType<typeof useFindCommentsQuery>;\nexport type FindCommentsLazyQueryHookResult = ReturnType<typeof useFindCommentsLazyQuery>;\nexport type FindCommentsQueryResult = ApolloReactCommon.QueryResult<FindCommentsQuery, FindCommentsQueryVariables>;\nexport const FindNotesDocument = gql`\n  query findNotes($fields: NoteInput!, $limit: Int, $offset: Int) {\n    findNotes(fields: $fields, limit: $limit, offset: $offset) {\n      ...NoteExpandedFields\n    }\n  }\n  ${NoteExpandedFieldsFragmentDoc}\n`;\n\n/**\n * __useFindNotesQuery__\n *\n * To run a query within a React component, call `useFindNotesQuery` and pass it any options that fit your needs.\n * When your component renders, `useFindNotesQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useFindNotesQuery({\n *   variables: {\n *      fields: // value for 'fields'\n *      limit: // value for 'limit'\n *      offset: // value for 'offset'\n *   },\n * });\n */\nexport function useFindNotesQuery(\n  baseOptions?: ApolloReactHooks.QueryHookOptions<FindNotesQuery, FindNotesQueryVariables>\n) {\n  return ApolloReactHooks.useQuery<FindNotesQuery, FindNotesQueryVariables>(FindNotesDocument, baseOptions);\n}\nexport function useFindNotesLazyQuery(\n  baseOptions?: ApolloReactHooks.LazyQueryHookOptions<FindNotesQuery, FindNotesQueryVariables>\n) {\n  return ApolloReactHooks.useLazyQuery<FindNotesQuery, FindNotesQueryVariables>(FindNotesDocument, baseOptions);\n}\nexport type FindNotesQueryHookResult = ReturnType<typeof useFindNotesQuery>;\nexport type FindNotesLazyQueryHookResult = ReturnType<typeof useFindNotesLazyQuery>;\nexport type FindNotesQueryResult = ApolloReactCommon.QueryResult<FindNotesQuery, FindNotesQueryVariables>;\nexport const DeletedCommentDocument = gql`\n  subscription deletedComment {\n    deletedComment {\n      ...CommentFields\n    }\n  }\n  ${CommentFieldsFragmentDoc}\n`;\n\n/**\n * __useDeletedCommentSubscription__\n *\n * To run a query within a React component, call `useDeletedCommentSubscription` and pass it any options that fit your needs.\n * When your component renders, `useDeletedCommentSubscription` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useDeletedCommentSubscription({\n *   variables: {\n *   },\n * });\n */\nexport function useDeletedCommentSubscription(\n  baseOptions?: ApolloReactHooks.SubscriptionHookOptions<\n    DeletedCommentSubscription,\n    DeletedCommentSubscriptionVariables\n  >\n) {\n  return ApolloReactHooks.useSubscription<DeletedCommentSubscription, DeletedCommentSubscriptionVariables>(\n    DeletedCommentDocument,\n    baseOptions\n  );\n}\nexport type DeletedCommentSubscriptionHookResult = ReturnType<typeof useDeletedCommentSubscription>;\nexport type DeletedCommentSubscriptionResult = ApolloReactCommon.SubscriptionResult<DeletedCommentSubscription>;\nexport const DeletedNoteDocument = gql`\n  subscription deletedNote {\n    deletedNote {\n      ...NoteFields\n    }\n  }\n  ${NoteFieldsFragmentDoc}\n`;\n\n/**\n * __useDeletedNoteSubscription__\n *\n * To run a query within a React component, call `useDeletedNoteSubscription` and pass it any options that fit your needs.\n * When your component renders, `useDeletedNoteSubscription` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useDeletedNoteSubscription({\n *   variables: {\n *   },\n * });\n */\nexport function useDeletedNoteSubscription(\n  baseOptions?: ApolloReactHooks.SubscriptionHookOptions<DeletedNoteSubscription, DeletedNoteSubscriptionVariables>\n) {\n  return ApolloReactHooks.useSubscription<DeletedNoteSubscription, DeletedNoteSubscriptionVariables>(\n    DeletedNoteDocument,\n    baseOptions\n  );\n}\nexport type DeletedNoteSubscriptionHookResult = ReturnType<typeof useDeletedNoteSubscription>;\nexport type DeletedNoteSubscriptionResult = ApolloReactCommon.SubscriptionResult<DeletedNoteSubscription>;\nexport const NewCommentDocument = gql`\n  subscription newComment {\n    newComment {\n      ...CommentFields\n    }\n  }\n  ${CommentFieldsFragmentDoc}\n`;\n\n/**\n * __useNewCommentSubscription__\n *\n * To run a query within a React component, call `useNewCommentSubscription` and pass it any options that fit your needs.\n * When your component renders, `useNewCommentSubscription` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useNewCommentSubscription({\n *   variables: {\n *   },\n * });\n */\nexport function useNewCommentSubscription(\n  baseOptions?: ApolloReactHooks.SubscriptionHookOptions<NewCommentSubscription, NewCommentSubscriptionVariables>\n) {\n  return ApolloReactHooks.useSubscription<NewCommentSubscription, NewCommentSubscriptionVariables>(\n    NewCommentDocument,\n    baseOptions\n  );\n}\nexport type NewCommentSubscriptionHookResult = ReturnType<typeof useNewCommentSubscription>;\nexport type NewCommentSubscriptionResult = ApolloReactCommon.SubscriptionResult<NewCommentSubscription>;\nexport const NewNoteDocument = gql`\n  subscription newNote {\n    newNote {\n      ...NoteFields\n    }\n  }\n  ${NoteFieldsFragmentDoc}\n`;\n\n/**\n * __useNewNoteSubscription__\n *\n * To run a query within a React component, call `useNewNoteSubscription` and pass it any options that fit your needs.\n * When your component renders, `useNewNoteSubscription` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useNewNoteSubscription({\n *   variables: {\n *   },\n * });\n */\nexport function useNewNoteSubscription(\n  baseOptions?: ApolloReactHooks.SubscriptionHookOptions<NewNoteSubscription, NewNoteSubscriptionVariables>\n) {\n  return ApolloReactHooks.useSubscription<NewNoteSubscription, NewNoteSubscriptionVariables>(\n    NewNoteDocument,\n    baseOptions\n  );\n}\nexport type NewNoteSubscriptionHookResult = ReturnType<typeof useNewNoteSubscription>;\nexport type NewNoteSubscriptionResult = ApolloReactCommon.SubscriptionResult<NewNoteSubscription>;\nexport const UpdatedCommentDocument = gql`\n  subscription updatedComment {\n    updatedComment {\n      ...CommentFields\n    }\n  }\n  ${CommentFieldsFragmentDoc}\n`;\n\n/**\n * __useUpdatedCommentSubscription__\n *\n * To run a query within a React component, call `useUpdatedCommentSubscription` and pass it any options that fit your needs.\n * When your component renders, `useUpdatedCommentSubscription` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useUpdatedCommentSubscription({\n *   variables: {\n *   },\n * });\n */\nexport function useUpdatedCommentSubscription(\n  baseOptions?: ApolloReactHooks.SubscriptionHookOptions<\n    UpdatedCommentSubscription,\n    UpdatedCommentSubscriptionVariables\n  >\n) {\n  return ApolloReactHooks.useSubscription<UpdatedCommentSubscription, UpdatedCommentSubscriptionVariables>(\n    UpdatedCommentDocument,\n    baseOptions\n  );\n}\nexport type UpdatedCommentSubscriptionHookResult = ReturnType<typeof useUpdatedCommentSubscription>;\nexport type UpdatedCommentSubscriptionResult = ApolloReactCommon.SubscriptionResult<UpdatedCommentSubscription>;\nexport const UpdatedNoteDocument = gql`\n  subscription updatedNote {\n    updatedNote {\n      ...NoteFields\n    }\n  }\n  ${NoteFieldsFragmentDoc}\n`;\n\n/**\n * __useUpdatedNoteSubscription__\n *\n * To run a query within a React component, call `useUpdatedNoteSubscription` and pass it any options that fit your needs.\n * When your component renders, `useUpdatedNoteSubscription` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useUpdatedNoteSubscription({\n *   variables: {\n *   },\n * });\n */\nexport function useUpdatedNoteSubscription(\n  baseOptions?: ApolloReactHooks.SubscriptionHookOptions<UpdatedNoteSubscription, UpdatedNoteSubscriptionVariables>\n) {\n  return ApolloReactHooks.useSubscription<UpdatedNoteSubscription, UpdatedNoteSubscriptionVariables>(\n    UpdatedNoteDocument,\n    baseOptions\n  );\n}\nexport type UpdatedNoteSubscriptionHookResult = ReturnType<typeof useUpdatedNoteSubscription>;\nexport type UpdatedNoteSubscriptionResult = ApolloReactCommon.SubscriptionResult<UpdatedNoteSubscription>;\n"
  },
  {
    "path": "templates/fullstack/client/package.json",
    "content": "{\n  \"name\": \"full-stack-template-client\",\n  \"version\": \"4.1.0\",\n  \"private\": true,\n  \"devDependencies\": {\n    \"@types/jest\": \"26.0.24\",\n    \"@types/node\": \"13.13.45\",\n    \"@types/react\": \"17.0.34\",\n    \"@types/react-dom\": \"17.0.11\",\n    \"react-scripts\": \"4.0.3\",\n    \"typescript\": \"4.4.4\"\n  },\n  \"dependencies\": {\n    \"@apollo/react-common\": \"3.1.4\",\n    \"@apollo/react-hooks\": \"3.1.5\",\n    \"@material-ui/core\": \"4.12.3\",\n    \"apollo-boost\": \"0.4.9\",\n    \"graphql\": \"15.7.2\",\n    \"react\": \"17.0.2\",\n    \"react-dom\": \"17.0.2\"\n  },\n  \"scripts\": {\n    \"start\": \"react-scripts start\",\n    \"build\": \"react-scripts build\",\n    \"test\": \"react-scripts test\",\n    \"eject\": \"react-scripts eject\"\n  },\n  \"eslintConfig\": {\n    \"extends\": \"react-app\"\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}\n"
  },
  {
    "path": "templates/fullstack/client/public/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\" />\n    <link rel=\"icon\" href=\"%PUBLIC_URL%/favicon.ico\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <meta name=\"theme-color\" content=\"#000000\" />\n    <meta\n      name=\"description\"\n      content=\"Web site created using create-react-app\"\n    />\n    <link rel=\"apple-touch-icon\" href=\"logo192.png\" />\n    <!--\n      manifest.json provides metadata used when your web app is installed on a\n      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/\n    -->\n    <link rel=\"manifest\" href=\"%PUBLIC_URL%/manifest.json\" />\n    <!--\n      Notice the use of %PUBLIC_URL% in the tags above.\n      It will be replaced with the URL of the `public` folder during the build.\n      Only files inside the `public` folder can be referenced from the HTML.\n\n      Unlike \"/favicon.ico\" or \"favicon.ico\", \"%PUBLIC_URL%/favicon.ico\" will\n      work correctly both with client-side routing and a non-root public URL.\n      Learn how to configure a non-root public URL by running `npm run build`.\n    -->\n    <title>React App</title>\n  </head>\n  <body>\n    <noscript>You need to enable JavaScript to run this app.</noscript>\n    <div id=\"root\"></div>\n    <!--\n      This HTML file is a template.\n      If you open it directly in the browser, you will see an empty page.\n\n      You can add webfonts, meta tags, or analytics to this file.\n      The build step will place the bundled scripts into the <body> tag.\n\n      To begin the development, run `npm start` or `yarn start`.\n      To create a production bundle, use `npm run build` or `yarn build`.\n    -->\n  </body>\n</html>\n"
  },
  {
    "path": "templates/fullstack/client/public/manifest.json",
    "content": "{\n  \"short_name\": \"React App\",\n  \"name\": \"Create React App Sample\",\n  \"icons\": [\n    {\n      \"src\": \"favicon.ico\",\n      \"sizes\": \"64x64 32x32 24x24 16x16\",\n      \"type\": \"image/x-icon\"\n    },\n    {\n      \"src\": \"logo192.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"192x192\"\n    },\n    {\n      \"src\": \"logo512.png\",\n      \"type\": \"image/png\",\n      \"sizes\": \"512x512\"\n    }\n  ],\n  \"start_url\": \".\",\n  \"display\": \"standalone\",\n  \"theme_color\": \"#000000\",\n  \"background_color\": \"#ffffff\"\n}\n"
  },
  {
    "path": "templates/fullstack/client/public/robots.txt",
    "content": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\n"
  },
  {
    "path": "templates/fullstack/client/src/App.css",
    "content": ".App {\n  text-align: center;\n}\n\n.App-logo {\n  height: 40vmin;\n}\n\n.App-header {\n  background-color: #282c34;\n  min-height: 100vh;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  justify-content: center;\n  font-size: calc(10px + 2vmin);\n  color: white;\n}\n\n.App-link {\n  color: #09d3ac;\n}\n"
  },
  {
    "path": "templates/fullstack/client/src/App.test.tsx",
    "content": "import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\n\nit('renders without crashing', () => {\n  const div = document.createElement('div');\n  ReactDOM.render(<App />, div);\n  ReactDOM.unmountComponentAtNode(div);\n});\n"
  },
  {
    "path": "templates/fullstack/client/src/App.tsx",
    "content": "import React from 'react';\nimport './App.css';\nimport { useFindNotesQuery } from './generated-types';\nimport CreateNote from './components/notes/CreateNote';\nimport OneNote from './components/notes/OneNote';\n\nconst App: React.FC = () => {\n  const allNotes = useFindNotesQuery();\n  allNotes.startPolling(2000);\n  console.log(allNotes.data?.findNotes);\n\n  return (\n    <div>\n      <CreateNote></CreateNote>\n      <ul>\n        {\n          // TODO fix typings\n          allNotes.data &&\n            allNotes.data.findNotes.items.map((note: any) => (\n              <OneNote\n                key={note.id}\n                id={note.id}\n                title={note.title}\n                description={note.description}\n                comments={note.comments}\n              ></OneNote>\n            ))\n        }\n      </ul>\n    </div>\n  );\n};\n\nexport default App;\n"
  },
  {
    "path": "templates/fullstack/client/src/components/comment/Comment.css",
    "content": ".comment{\n    color:grey;\n}"
  },
  {
    "path": "templates/fullstack/client/src/components/comment/CreateComment.tsx",
    "content": "import React, { useState } from 'react';\nimport { useCreateCommentMutation } from '../../generated-types';\nimport { Card, TextField, Button } from '@material-ui/core';\nimport './../notes/Note.css';\n\ntype createCommentProps = {\n  noteId: string;\n  addCommentState: any;\n};\n\nconst CreateComment = ({ noteId, addCommentState }: createCommentProps) => {\n  const [createComment] = useCreateCommentMutation();\n  const [newCommentTitle, setNewCommentTitle] = useState('');\n  const [newCommentDescription, setNewCommentDescription] = useState('');\n\n  return (\n    <div>\n      <Card className=\"inputCard\">\n        <form noValidate autoComplete=\"off\" className=\"inputForm\">\n          <h3>Create Comment</h3>\n          <TextField\n            label=\"Title\"\n            variant=\"outlined\"\n            onChange={(e) => setNewCommentTitle(e.target.value)}\n            value={newCommentTitle}\n          />\n          <TextField\n            label=\"Description\"\n            variant=\"outlined\"\n            onChange={(e) => setNewCommentDescription(e.target.value)}\n            value={newCommentDescription}\n          />\n          <Button\n            variant=\"outlined\"\n            color=\"primary\"\n            onClick={() => {\n              createComment({\n                variables: { input: { text: newCommentTitle, description: newCommentDescription, noteId: noteId } },\n              });\n              addCommentState(false);\n            }}\n          >\n            Add Comment\n          </Button>\n        </form>\n      </Card>\n    </div>\n  );\n};\n\nexport default CreateComment;\n"
  },
  {
    "path": "templates/fullstack/client/src/components/comment/OneComment.tsx",
    "content": "import React from 'react';\nimport { useDeleteCommentMutation, Comment } from '../../generated-types';\nimport { Button } from '@material-ui/core';\nimport './Comment.css';\n\nconst OneComment = ({ id, text, description }: Comment) => {\n  const [deleteComment] = useDeleteCommentMutation();\n\n  return (\n    <div>\n      <li className=\"comment\">\n        <strong>{text}</strong>:&nbsp;\n        {description}\n        <Button\n          variant=\"outlined\"\n          color=\"secondary\"\n          onClick={() => deleteComment({ variables: { input: { id: id } } })}\n        >\n          Delete Comment\n        </Button>\n      </li>\n    </div>\n  );\n};\n\nexport default OneComment;\n"
  },
  {
    "path": "templates/fullstack/client/src/components/notes/CreateNote.tsx",
    "content": "import React, { useState } from 'react';\nimport { useCreateNoteMutation } from '../../generated-types';\nimport { Button, TextField, Card } from '@material-ui/core';\nimport './Note.css';\n\nconst CreateNote: React.FC = () => {\n  const [createNote] = useCreateNoteMutation();\n  const [newNoteTitle, setNewNoteTitle] = useState('');\n  const [newNoteDescription, setNewNoteDescription] = useState('');\n\n  return (\n    <div>\n      <Card className=\"inputCard\">\n        <form noValidate autoComplete=\"off\" className=\"inputForm\">\n          <h3>Create Note</h3>\n          <p>This application works only with sample Node/Comment model</p>\n          <TextField\n            label=\"Title\"\n            variant=\"outlined\"\n            onChange={(e) => setNewNoteTitle(e.target.value)}\n            value={newNoteTitle}\n          />\n          <TextField\n            label=\"Description\"\n            variant=\"outlined\"\n            onChange={(e) => setNewNoteDescription(e.target.value)}\n            value={newNoteDescription}\n          />\n          <Button\n            variant=\"outlined\"\n            color=\"primary\"\n            onClick={() => {\n              createNote({ variables: { input: { title: newNoteTitle, description: newNoteDescription } } });\n            }}\n          >\n            Add Note\n          </Button>\n        </form>\n      </Card>\n    </div>\n  );\n};\n\nexport default CreateNote;\n"
  },
  {
    "path": "templates/fullstack/client/src/components/notes/EditNote.tsx",
    "content": "import React, { useState } from 'react';\nimport { useUpdateNoteMutation } from '../../generated-types';\nimport { Button, TextField, Card } from '@material-ui/core';\nimport './Note.css';\n\ntype noteProps = {\n  id: string;\n  title: string;\n  description: string | undefined;\n  editState: any;\n};\n\nconst EditNote = ({ id, title, description, editState }: noteProps) => {\n  const [updateNote] = useUpdateNoteMutation();\n  const [NoteTitle, setNoteTitle] = useState(title);\n  const [NoteDescription, setNoteDescription] = useState(description);\n\n  return (\n    <div>\n      <Card className=\"inputCard\">\n        <form noValidate autoComplete=\"off\" className=\"inputForm\">\n          <h3>Edit Note</h3>\n          <TextField\n            label=\"Title\"\n            variant=\"outlined\"\n            onChange={(e) => setNoteTitle(e.target.value)}\n            value={NoteTitle}\n          />\n          <TextField\n            label=\"Description\"\n            variant=\"outlined\"\n            onChange={(e) => setNoteDescription(e.target.value)}\n            value={NoteDescription}\n          />\n          <Button\n            variant=\"outlined\"\n            color=\"primary\"\n            onClick={() => {\n              updateNote({ variables: { input: { id: id, title: NoteTitle, description: NoteDescription } } });\n              editState(false);\n            }}\n          >\n            Update Note\n          </Button>\n        </form>\n      </Card>\n    </div>\n  );\n};\n\nexport default EditNote;\n"
  },
  {
    "path": "templates/fullstack/client/src/components/notes/Note.css",
    "content": ".inputForm{\n    display:grid;\n    margin: 15%;\n    width: 70%;\n}\n\n.inputCard{\n    width: 50%;\n    margin-left: 25%;\n}\n.OneNote{\n    margin:5%;\n}"
  },
  {
    "path": "templates/fullstack/client/src/components/notes/OneNote.tsx",
    "content": "import React, { useState } from 'react';\nimport EditNote from './EditNote';\nimport { Note } from '../../generated-types';\nimport CreateComment from '../comment/CreateComment';\nimport OneComment from '../comment/OneComment';\nimport { Button, Card } from '@material-ui/core';\n\nconst OneNote = ({ id, title, description, comments }: Note) => {\n  const [noteEdit, setNoteEdit] = useState(false);\n  const [addComment, setAddComment] = useState(false);\n\n  return (\n    <div>\n      <Card className=\"inputCard\">\n        <li className=\"OneNote\">\n          <strong>{title}</strong>:&nbsp;\n          {description}\n          <Button onClick={() => setNoteEdit(!noteEdit)} variant=\"outlined\" color=\"primary\">\n            Edit\n          </Button>\n          <Button onClick={() => setAddComment(!addComment)} variant=\"outlined\" color=\"primary\">\n            Add Comment\n          </Button>\n          {noteEdit ? (\n            <EditNote id={id} title={title} description={description || ''} editState={setNoteEdit}></EditNote>\n          ) : (\n            <div></div>\n          )}\n          {addComment ? <CreateComment noteId={id} addCommentState={setAddComment}></CreateComment> : <div></div>}\n          <ul>\n            {comments && comments.length > 0 ? (\n              comments.map((com) => {\n                if (!com) {\n                  return;\n                }\n                return <OneComment id={com.id} text={com.text} description={com.description} key={com.id}></OneComment>;\n              })\n            ) : (\n              <div></div>\n            )}\n          </ul>\n        </li>\n      </Card>\n    </div>\n  );\n};\n\nexport default OneNote;\n"
  },
  {
    "path": "templates/fullstack/client/src/generated-types.tsx",
    "content": "/* tslint:disable */\nimport gql from 'graphql-tag';\nimport * as ApolloReactCommon from '@apollo/react-common';\nimport * as ApolloReactHooks from '@apollo/react-hooks';\nexport type Maybe<T> = T | null;\nexport type Exact<T extends { [key: string]: any }> = { [K in keyof T]: T[K] };\n\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n  ID: string;\n  String: string;\n  Boolean: boolean;\n  Int: number;\n  Float: number;\n};\n\n/**  @model  */\nexport type Comment = {\n  __typename?: 'Comment';\n  id: Scalars['ID'];\n  text?: Maybe<Scalars['String']>;\n  description?: Maybe<Scalars['String']>;\n  /** @manyToOne(field: 'comments', key: 'noteId') */\n  note?: Maybe<Note>;\n};\n\nexport type CommentFilter = {\n  id?: Maybe<IdInput>;\n  text?: Maybe<StringInput>;\n  description?: Maybe<StringInput>;\n  noteId?: Maybe<IdInput>;\n  and?: Maybe<Array<CommentFilter>>;\n  or?: Maybe<Array<CommentFilter>>;\n  not?: Maybe<CommentFilter>;\n};\n\nexport type CommentResultList = {\n  __typename?: 'CommentResultList';\n  items: Array<Maybe<Comment>>;\n  offset?: Maybe<Scalars['Int']>;\n  limit?: Maybe<Scalars['Int']>;\n  count?: Maybe<Scalars['Int']>;\n};\n\nexport type CommentSubscriptionFilter = {\n  id?: Maybe<Scalars['ID']>;\n  text?: Maybe<Scalars['String']>;\n  description?: Maybe<Scalars['String']>;\n};\n\nexport type CreateCommentInput = {\n  id?: Maybe<Scalars['ID']>;\n  text?: Maybe<Scalars['String']>;\n  description?: Maybe<Scalars['String']>;\n  noteId?: Maybe<Scalars['ID']>;\n};\n\nexport type CreateNoteInput = {\n  id?: Maybe<Scalars['ID']>;\n  title: Scalars['String'];\n  description?: Maybe<Scalars['String']>;\n};\n\nexport type IdInput = {\n  ne?: Maybe<Scalars['ID']>;\n  eq?: Maybe<Scalars['ID']>;\n  le?: Maybe<Scalars['ID']>;\n  lt?: Maybe<Scalars['ID']>;\n  ge?: Maybe<Scalars['ID']>;\n  gt?: Maybe<Scalars['ID']>;\n  in?: Maybe<Array<Scalars['ID']>>;\n};\n\nexport type MutateCommentInput = {\n  id: Scalars['ID'];\n  text?: Maybe<Scalars['String']>;\n  description?: Maybe<Scalars['String']>;\n  noteId?: Maybe<Scalars['ID']>;\n};\n\nexport type MutateNoteInput = {\n  id: Scalars['ID'];\n  title?: Maybe<Scalars['String']>;\n  description?: Maybe<Scalars['String']>;\n};\n\nexport type Mutation = {\n  __typename?: 'Mutation';\n  createNote?: Maybe<Note>;\n  updateNote?: Maybe<Note>;\n  deleteNote?: Maybe<Note>;\n  createComment?: Maybe<Comment>;\n  updateComment?: Maybe<Comment>;\n  deleteComment?: Maybe<Comment>;\n};\n\n\nexport type MutationCreateNoteArgs = {\n  input: CreateNoteInput;\n};\n\n\nexport type MutationUpdateNoteArgs = {\n  input: MutateNoteInput;\n};\n\n\nexport type MutationDeleteNoteArgs = {\n  input: MutateNoteInput;\n};\n\n\nexport type MutationCreateCommentArgs = {\n  input: CreateCommentInput;\n};\n\n\nexport type MutationUpdateCommentArgs = {\n  input: MutateCommentInput;\n};\n\n\nexport type MutationDeleteCommentArgs = {\n  input: MutateCommentInput;\n};\n\n/**  @model  */\nexport type Note = {\n  __typename?: 'Note';\n  id: Scalars['ID'];\n  title: Scalars['String'];\n  description?: Maybe<Scalars['String']>;\n  /** @oneToMany(field: 'note', key: 'noteId') */\n  comments: Array<Maybe<Comment>>;\n};\n\n\n/**  @model  */\nexport type NoteCommentsArgs = {\n  filter?: Maybe<CommentFilter>;\n};\n\nexport type NoteFilter = {\n  id?: Maybe<IdInput>;\n  title?: Maybe<StringInput>;\n  description?: Maybe<StringInput>;\n  and?: Maybe<Array<NoteFilter>>;\n  or?: Maybe<Array<NoteFilter>>;\n  not?: Maybe<NoteFilter>;\n};\n\nexport type NoteResultList = {\n  __typename?: 'NoteResultList';\n  items: Array<Maybe<Note>>;\n  offset?: Maybe<Scalars['Int']>;\n  limit?: Maybe<Scalars['Int']>;\n  count?: Maybe<Scalars['Int']>;\n};\n\nexport type NoteSubscriptionFilter = {\n  id?: Maybe<Scalars['ID']>;\n  title?: Maybe<Scalars['String']>;\n  description?: Maybe<Scalars['String']>;\n};\n\nexport type OrderByInput = {\n  field: Scalars['String'];\n  order?: Maybe<SortDirectionEnum>;\n};\n\nexport type PageRequest = {\n  limit?: Maybe<Scalars['Int']>;\n  offset?: Maybe<Scalars['Int']>;\n};\n\nexport type Query = {\n  __typename?: 'Query';\n  getNote?: Maybe<Note>;\n  findNotes: NoteResultList;\n  getComment?: Maybe<Comment>;\n  findComments: CommentResultList;\n};\n\n\nexport type QueryGetNoteArgs = {\n  id: Scalars['ID'];\n};\n\n\nexport type QueryFindNotesArgs = {\n  filter?: Maybe<NoteFilter>;\n  page?: Maybe<PageRequest>;\n  orderBy?: Maybe<OrderByInput>;\n};\n\n\nexport type QueryGetCommentArgs = {\n  id: Scalars['ID'];\n};\n\n\nexport type QueryFindCommentsArgs = {\n  filter?: Maybe<CommentFilter>;\n  page?: Maybe<PageRequest>;\n  orderBy?: Maybe<OrderByInput>;\n};\n\nexport enum SortDirectionEnum {\n  Desc = 'DESC',\n  Asc = 'ASC'\n}\n\nexport type StringInput = {\n  ne?: Maybe<Scalars['String']>;\n  eq?: Maybe<Scalars['String']>;\n  le?: Maybe<Scalars['String']>;\n  lt?: Maybe<Scalars['String']>;\n  ge?: Maybe<Scalars['String']>;\n  gt?: Maybe<Scalars['String']>;\n  in?: Maybe<Array<Scalars['String']>>;\n  contains?: Maybe<Scalars['String']>;\n  startsWith?: Maybe<Scalars['String']>;\n  endsWith?: Maybe<Scalars['String']>;\n};\n\nexport type Subscription = {\n  __typename?: 'Subscription';\n  newNote: Note;\n  updatedNote: Note;\n  deletedNote: Note;\n  newComment: Comment;\n  updatedComment: Comment;\n  deletedComment: Comment;\n};\n\n\nexport type SubscriptionNewNoteArgs = {\n  filter?: Maybe<NoteSubscriptionFilter>;\n};\n\n\nexport type SubscriptionUpdatedNoteArgs = {\n  filter?: Maybe<NoteSubscriptionFilter>;\n};\n\n\nexport type SubscriptionDeletedNoteArgs = {\n  filter?: Maybe<NoteSubscriptionFilter>;\n};\n\n\nexport type SubscriptionNewCommentArgs = {\n  filter?: Maybe<CommentSubscriptionFilter>;\n};\n\n\nexport type SubscriptionUpdatedCommentArgs = {\n  filter?: Maybe<CommentSubscriptionFilter>;\n};\n\n\nexport type SubscriptionDeletedCommentArgs = {\n  filter?: Maybe<CommentSubscriptionFilter>;\n};\n\nexport type NoteFieldsFragment = (\n  { __typename?: 'Note' }\n  & Pick<Note, 'id' | 'title' | 'description'>\n);\n\nexport type NoteExpandedFieldsFragment = (\n  { __typename?: 'Note' }\n  & Pick<Note, 'id' | 'title' | 'description'>\n  & { comments: Array<Maybe<(\n    { __typename?: 'Comment' }\n    & Pick<Comment, 'id' | 'text' | 'description'>\n  )>> }\n);\n\nexport type CommentFieldsFragment = (\n  { __typename?: 'Comment' }\n  & Pick<Comment, 'id' | 'text' | 'description'>\n);\n\nexport type CommentExpandedFieldsFragment = (\n  { __typename?: 'Comment' }\n  & Pick<Comment, 'id' | 'text' | 'description'>\n  & { note?: Maybe<(\n    { __typename?: 'Note' }\n    & Pick<Note, 'id' | 'title' | 'description'>\n  )> }\n);\n\nexport type FindNotesQueryVariables = Exact<{\n  filter?: Maybe<NoteFilter>;\n  page?: Maybe<PageRequest>;\n  orderBy?: Maybe<OrderByInput>;\n}>;\n\n\nexport type FindNotesQuery = (\n  { __typename?: 'Query' }\n  & { findNotes: (\n    { __typename?: 'NoteResultList' }\n    & Pick<NoteResultList, 'offset' | 'limit' | 'count'>\n    & { items: Array<Maybe<(\n      { __typename?: 'Note' }\n      & NoteExpandedFieldsFragment\n    )>> }\n  ) }\n);\n\nexport type GetNoteQueryVariables = Exact<{\n  id: Scalars['ID'];\n}>;\n\n\nexport type GetNoteQuery = (\n  { __typename?: 'Query' }\n  & { getNote?: Maybe<(\n    { __typename?: 'Note' }\n    & NoteExpandedFieldsFragment\n  )> }\n);\n\nexport type FindCommentsQueryVariables = Exact<{\n  filter?: Maybe<CommentFilter>;\n  page?: Maybe<PageRequest>;\n  orderBy?: Maybe<OrderByInput>;\n}>;\n\n\nexport type FindCommentsQuery = (\n  { __typename?: 'Query' }\n  & { findComments: (\n    { __typename?: 'CommentResultList' }\n    & Pick<CommentResultList, 'offset' | 'limit' | 'count'>\n    & { items: Array<Maybe<(\n      { __typename?: 'Comment' }\n      & CommentExpandedFieldsFragment\n    )>> }\n  ) }\n);\n\nexport type GetCommentQueryVariables = Exact<{\n  id: Scalars['ID'];\n}>;\n\n\nexport type GetCommentQuery = (\n  { __typename?: 'Query' }\n  & { getComment?: Maybe<(\n    { __typename?: 'Comment' }\n    & CommentExpandedFieldsFragment\n  )> }\n);\n\nexport type CreateNoteMutationVariables = Exact<{\n  input: CreateNoteInput;\n}>;\n\n\nexport type CreateNoteMutation = (\n  { __typename?: 'Mutation' }\n  & { createNote?: Maybe<(\n    { __typename?: 'Note' }\n    & NoteFieldsFragment\n  )> }\n);\n\nexport type UpdateNoteMutationVariables = Exact<{\n  input: MutateNoteInput;\n}>;\n\n\nexport type UpdateNoteMutation = (\n  { __typename?: 'Mutation' }\n  & { updateNote?: Maybe<(\n    { __typename?: 'Note' }\n    & NoteFieldsFragment\n  )> }\n);\n\nexport type DeleteNoteMutationVariables = Exact<{\n  input: MutateNoteInput;\n}>;\n\n\nexport type DeleteNoteMutation = (\n  { __typename?: 'Mutation' }\n  & { deleteNote?: Maybe<(\n    { __typename?: 'Note' }\n    & NoteFieldsFragment\n  )> }\n);\n\nexport type CreateCommentMutationVariables = Exact<{\n  input: CreateCommentInput;\n}>;\n\n\nexport type CreateCommentMutation = (\n  { __typename?: 'Mutation' }\n  & { createComment?: Maybe<(\n    { __typename?: 'Comment' }\n    & CommentFieldsFragment\n  )> }\n);\n\nexport type UpdateCommentMutationVariables = Exact<{\n  input: MutateCommentInput;\n}>;\n\n\nexport type UpdateCommentMutation = (\n  { __typename?: 'Mutation' }\n  & { updateComment?: Maybe<(\n    { __typename?: 'Comment' }\n    & CommentFieldsFragment\n  )> }\n);\n\nexport type DeleteCommentMutationVariables = Exact<{\n  input: MutateCommentInput;\n}>;\n\n\nexport type DeleteCommentMutation = (\n  { __typename?: 'Mutation' }\n  & { deleteComment?: Maybe<(\n    { __typename?: 'Comment' }\n    & CommentFieldsFragment\n  )> }\n);\n\nexport type NewNoteSubscriptionVariables = Exact<{\n  filter?: Maybe<NoteSubscriptionFilter>;\n}>;\n\n\nexport type NewNoteSubscription = (\n  { __typename?: 'Subscription' }\n  & { newNote: (\n    { __typename?: 'Note' }\n    & NoteFieldsFragment\n  ) }\n);\n\nexport type UpdatedNoteSubscriptionVariables = Exact<{\n  filter?: Maybe<NoteSubscriptionFilter>;\n}>;\n\n\nexport type UpdatedNoteSubscription = (\n  { __typename?: 'Subscription' }\n  & { updatedNote: (\n    { __typename?: 'Note' }\n    & NoteFieldsFragment\n  ) }\n);\n\nexport type DeletedNoteSubscriptionVariables = Exact<{\n  filter?: Maybe<NoteSubscriptionFilter>;\n}>;\n\n\nexport type DeletedNoteSubscription = (\n  { __typename?: 'Subscription' }\n  & { deletedNote: (\n    { __typename?: 'Note' }\n    & NoteFieldsFragment\n  ) }\n);\n\nexport type NewCommentSubscriptionVariables = Exact<{\n  filter?: Maybe<CommentSubscriptionFilter>;\n}>;\n\n\nexport type NewCommentSubscription = (\n  { __typename?: 'Subscription' }\n  & { newComment: (\n    { __typename?: 'Comment' }\n    & CommentFieldsFragment\n  ) }\n);\n\nexport type UpdatedCommentSubscriptionVariables = Exact<{\n  filter?: Maybe<CommentSubscriptionFilter>;\n}>;\n\n\nexport type UpdatedCommentSubscription = (\n  { __typename?: 'Subscription' }\n  & { updatedComment: (\n    { __typename?: 'Comment' }\n    & CommentFieldsFragment\n  ) }\n);\n\nexport type DeletedCommentSubscriptionVariables = Exact<{\n  filter?: Maybe<CommentSubscriptionFilter>;\n}>;\n\n\nexport type DeletedCommentSubscription = (\n  { __typename?: 'Subscription' }\n  & { deletedComment: (\n    { __typename?: 'Comment' }\n    & CommentFieldsFragment\n  ) }\n);\n\nexport const NoteFieldsFragmentDoc = gql`\n    fragment NoteFields on Note {\n  id\n  title\n  description\n}\n    `;\nexport const NoteExpandedFieldsFragmentDoc = gql`\n    fragment NoteExpandedFields on Note {\n  id\n  title\n  description\n  comments {\n    id\n    text\n    description\n  }\n}\n    `;\nexport const CommentFieldsFragmentDoc = gql`\n    fragment CommentFields on Comment {\n  id\n  text\n  description\n}\n    `;\nexport const CommentExpandedFieldsFragmentDoc = gql`\n    fragment CommentExpandedFields on Comment {\n  id\n  text\n  description\n  note {\n    id\n    title\n    description\n  }\n}\n    `;\nexport const FindNotesDocument = gql`\n    query findNotes($filter: NoteFilter, $page: PageRequest, $orderBy: OrderByInput) {\n  findNotes(filter: $filter, page: $page, orderBy: $orderBy) {\n    items {\n      ...NoteExpandedFields\n    }\n    offset\n    limit\n    count\n  }\n}\n    ${NoteExpandedFieldsFragmentDoc}`;\n\n/**\n * __useFindNotesQuery__\n *\n * To run a query within a React component, call `useFindNotesQuery` and pass it any options that fit your needs.\n * When your component renders, `useFindNotesQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useFindNotesQuery({\n *   variables: {\n *      filter: // value for 'filter'\n *      page: // value for 'page'\n *      orderBy: // value for 'orderBy'\n *   },\n * });\n */\nexport function useFindNotesQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<FindNotesQuery, FindNotesQueryVariables>) {\n        return ApolloReactHooks.useQuery<FindNotesQuery, FindNotesQueryVariables>(FindNotesDocument, baseOptions);\n      }\nexport function useFindNotesLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<FindNotesQuery, FindNotesQueryVariables>) {\n          return ApolloReactHooks.useLazyQuery<FindNotesQuery, FindNotesQueryVariables>(FindNotesDocument, baseOptions);\n        }\nexport type FindNotesQueryHookResult = ReturnType<typeof useFindNotesQuery>;\nexport type FindNotesLazyQueryHookResult = ReturnType<typeof useFindNotesLazyQuery>;\nexport type FindNotesQueryResult = ApolloReactCommon.QueryResult<FindNotesQuery, FindNotesQueryVariables>;\nexport const GetNoteDocument = gql`\n    query getNote($id: ID!) {\n  getNote(id: $id) {\n    ...NoteExpandedFields\n  }\n}\n    ${NoteExpandedFieldsFragmentDoc}`;\n\n/**\n * __useGetNoteQuery__\n *\n * To run a query within a React component, call `useGetNoteQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetNoteQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetNoteQuery({\n *   variables: {\n *      id: // value for 'id'\n *   },\n * });\n */\nexport function useGetNoteQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<GetNoteQuery, GetNoteQueryVariables>) {\n        return ApolloReactHooks.useQuery<GetNoteQuery, GetNoteQueryVariables>(GetNoteDocument, baseOptions);\n      }\nexport function useGetNoteLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<GetNoteQuery, GetNoteQueryVariables>) {\n          return ApolloReactHooks.useLazyQuery<GetNoteQuery, GetNoteQueryVariables>(GetNoteDocument, baseOptions);\n        }\nexport type GetNoteQueryHookResult = ReturnType<typeof useGetNoteQuery>;\nexport type GetNoteLazyQueryHookResult = ReturnType<typeof useGetNoteLazyQuery>;\nexport type GetNoteQueryResult = ApolloReactCommon.QueryResult<GetNoteQuery, GetNoteQueryVariables>;\nexport const FindCommentsDocument = gql`\n    query findComments($filter: CommentFilter, $page: PageRequest, $orderBy: OrderByInput) {\n  findComments(filter: $filter, page: $page, orderBy: $orderBy) {\n    items {\n      ...CommentExpandedFields\n    }\n    offset\n    limit\n    count\n  }\n}\n    ${CommentExpandedFieldsFragmentDoc}`;\n\n/**\n * __useFindCommentsQuery__\n *\n * To run a query within a React component, call `useFindCommentsQuery` and pass it any options that fit your needs.\n * When your component renders, `useFindCommentsQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useFindCommentsQuery({\n *   variables: {\n *      filter: // value for 'filter'\n *      page: // value for 'page'\n *      orderBy: // value for 'orderBy'\n *   },\n * });\n */\nexport function useFindCommentsQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<FindCommentsQuery, FindCommentsQueryVariables>) {\n        return ApolloReactHooks.useQuery<FindCommentsQuery, FindCommentsQueryVariables>(FindCommentsDocument, baseOptions);\n      }\nexport function useFindCommentsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<FindCommentsQuery, FindCommentsQueryVariables>) {\n          return ApolloReactHooks.useLazyQuery<FindCommentsQuery, FindCommentsQueryVariables>(FindCommentsDocument, baseOptions);\n        }\nexport type FindCommentsQueryHookResult = ReturnType<typeof useFindCommentsQuery>;\nexport type FindCommentsLazyQueryHookResult = ReturnType<typeof useFindCommentsLazyQuery>;\nexport type FindCommentsQueryResult = ApolloReactCommon.QueryResult<FindCommentsQuery, FindCommentsQueryVariables>;\nexport const GetCommentDocument = gql`\n    query getComment($id: ID!) {\n  getComment(id: $id) {\n    ...CommentExpandedFields\n  }\n}\n    ${CommentExpandedFieldsFragmentDoc}`;\n\n/**\n * __useGetCommentQuery__\n *\n * To run a query within a React component, call `useGetCommentQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetCommentQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetCommentQuery({\n *   variables: {\n *      id: // value for 'id'\n *   },\n * });\n */\nexport function useGetCommentQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<GetCommentQuery, GetCommentQueryVariables>) {\n        return ApolloReactHooks.useQuery<GetCommentQuery, GetCommentQueryVariables>(GetCommentDocument, baseOptions);\n      }\nexport function useGetCommentLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<GetCommentQuery, GetCommentQueryVariables>) {\n          return ApolloReactHooks.useLazyQuery<GetCommentQuery, GetCommentQueryVariables>(GetCommentDocument, baseOptions);\n        }\nexport type GetCommentQueryHookResult = ReturnType<typeof useGetCommentQuery>;\nexport type GetCommentLazyQueryHookResult = ReturnType<typeof useGetCommentLazyQuery>;\nexport type GetCommentQueryResult = ApolloReactCommon.QueryResult<GetCommentQuery, GetCommentQueryVariables>;\nexport const CreateNoteDocument = gql`\n    mutation createNote($input: CreateNoteInput!) {\n  createNote(input: $input) {\n    ...NoteFields\n  }\n}\n    ${NoteFieldsFragmentDoc}`;\nexport type CreateNoteMutationFn = ApolloReactCommon.MutationFunction<CreateNoteMutation, CreateNoteMutationVariables>;\n\n/**\n * __useCreateNoteMutation__\n *\n * To run a mutation, you first call `useCreateNoteMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useCreateNoteMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [createNoteMutation, { data, loading, error }] = useCreateNoteMutation({\n *   variables: {\n *      input: // value for 'input'\n *   },\n * });\n */\nexport function useCreateNoteMutation(baseOptions?: ApolloReactHooks.MutationHookOptions<CreateNoteMutation, CreateNoteMutationVariables>) {\n        return ApolloReactHooks.useMutation<CreateNoteMutation, CreateNoteMutationVariables>(CreateNoteDocument, baseOptions);\n      }\nexport type CreateNoteMutationHookResult = ReturnType<typeof useCreateNoteMutation>;\nexport type CreateNoteMutationResult = ApolloReactCommon.MutationResult<CreateNoteMutation>;\nexport type CreateNoteMutationOptions = ApolloReactCommon.BaseMutationOptions<CreateNoteMutation, CreateNoteMutationVariables>;\nexport const UpdateNoteDocument = gql`\n    mutation updateNote($input: MutateNoteInput!) {\n  updateNote(input: $input) {\n    ...NoteFields\n  }\n}\n    ${NoteFieldsFragmentDoc}`;\nexport type UpdateNoteMutationFn = ApolloReactCommon.MutationFunction<UpdateNoteMutation, UpdateNoteMutationVariables>;\n\n/**\n * __useUpdateNoteMutation__\n *\n * To run a mutation, you first call `useUpdateNoteMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useUpdateNoteMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [updateNoteMutation, { data, loading, error }] = useUpdateNoteMutation({\n *   variables: {\n *      input: // value for 'input'\n *   },\n * });\n */\nexport function useUpdateNoteMutation(baseOptions?: ApolloReactHooks.MutationHookOptions<UpdateNoteMutation, UpdateNoteMutationVariables>) {\n        return ApolloReactHooks.useMutation<UpdateNoteMutation, UpdateNoteMutationVariables>(UpdateNoteDocument, baseOptions);\n      }\nexport type UpdateNoteMutationHookResult = ReturnType<typeof useUpdateNoteMutation>;\nexport type UpdateNoteMutationResult = ApolloReactCommon.MutationResult<UpdateNoteMutation>;\nexport type UpdateNoteMutationOptions = ApolloReactCommon.BaseMutationOptions<UpdateNoteMutation, UpdateNoteMutationVariables>;\nexport const DeleteNoteDocument = gql`\n    mutation deleteNote($input: MutateNoteInput!) {\n  deleteNote(input: $input) {\n    ...NoteFields\n  }\n}\n    ${NoteFieldsFragmentDoc}`;\nexport type DeleteNoteMutationFn = ApolloReactCommon.MutationFunction<DeleteNoteMutation, DeleteNoteMutationVariables>;\n\n/**\n * __useDeleteNoteMutation__\n *\n * To run a mutation, you first call `useDeleteNoteMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useDeleteNoteMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [deleteNoteMutation, { data, loading, error }] = useDeleteNoteMutation({\n *   variables: {\n *      input: // value for 'input'\n *   },\n * });\n */\nexport function useDeleteNoteMutation(baseOptions?: ApolloReactHooks.MutationHookOptions<DeleteNoteMutation, DeleteNoteMutationVariables>) {\n        return ApolloReactHooks.useMutation<DeleteNoteMutation, DeleteNoteMutationVariables>(DeleteNoteDocument, baseOptions);\n      }\nexport type DeleteNoteMutationHookResult = ReturnType<typeof useDeleteNoteMutation>;\nexport type DeleteNoteMutationResult = ApolloReactCommon.MutationResult<DeleteNoteMutation>;\nexport type DeleteNoteMutationOptions = ApolloReactCommon.BaseMutationOptions<DeleteNoteMutation, DeleteNoteMutationVariables>;\nexport const CreateCommentDocument = gql`\n    mutation createComment($input: CreateCommentInput!) {\n  createComment(input: $input) {\n    ...CommentFields\n  }\n}\n    ${CommentFieldsFragmentDoc}`;\nexport type CreateCommentMutationFn = ApolloReactCommon.MutationFunction<CreateCommentMutation, CreateCommentMutationVariables>;\n\n/**\n * __useCreateCommentMutation__\n *\n * To run a mutation, you first call `useCreateCommentMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useCreateCommentMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [createCommentMutation, { data, loading, error }] = useCreateCommentMutation({\n *   variables: {\n *      input: // value for 'input'\n *   },\n * });\n */\nexport function useCreateCommentMutation(baseOptions?: ApolloReactHooks.MutationHookOptions<CreateCommentMutation, CreateCommentMutationVariables>) {\n        return ApolloReactHooks.useMutation<CreateCommentMutation, CreateCommentMutationVariables>(CreateCommentDocument, baseOptions);\n      }\nexport type CreateCommentMutationHookResult = ReturnType<typeof useCreateCommentMutation>;\nexport type CreateCommentMutationResult = ApolloReactCommon.MutationResult<CreateCommentMutation>;\nexport type CreateCommentMutationOptions = ApolloReactCommon.BaseMutationOptions<CreateCommentMutation, CreateCommentMutationVariables>;\nexport const UpdateCommentDocument = gql`\n    mutation updateComment($input: MutateCommentInput!) {\n  updateComment(input: $input) {\n    ...CommentFields\n  }\n}\n    ${CommentFieldsFragmentDoc}`;\nexport type UpdateCommentMutationFn = ApolloReactCommon.MutationFunction<UpdateCommentMutation, UpdateCommentMutationVariables>;\n\n/**\n * __useUpdateCommentMutation__\n *\n * To run a mutation, you first call `useUpdateCommentMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useUpdateCommentMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [updateCommentMutation, { data, loading, error }] = useUpdateCommentMutation({\n *   variables: {\n *      input: // value for 'input'\n *   },\n * });\n */\nexport function useUpdateCommentMutation(baseOptions?: ApolloReactHooks.MutationHookOptions<UpdateCommentMutation, UpdateCommentMutationVariables>) {\n        return ApolloReactHooks.useMutation<UpdateCommentMutation, UpdateCommentMutationVariables>(UpdateCommentDocument, baseOptions);\n      }\nexport type UpdateCommentMutationHookResult = ReturnType<typeof useUpdateCommentMutation>;\nexport type UpdateCommentMutationResult = ApolloReactCommon.MutationResult<UpdateCommentMutation>;\nexport type UpdateCommentMutationOptions = ApolloReactCommon.BaseMutationOptions<UpdateCommentMutation, UpdateCommentMutationVariables>;\nexport const DeleteCommentDocument = gql`\n    mutation deleteComment($input: MutateCommentInput!) {\n  deleteComment(input: $input) {\n    ...CommentFields\n  }\n}\n    ${CommentFieldsFragmentDoc}`;\nexport type DeleteCommentMutationFn = ApolloReactCommon.MutationFunction<DeleteCommentMutation, DeleteCommentMutationVariables>;\n\n/**\n * __useDeleteCommentMutation__\n *\n * To run a mutation, you first call `useDeleteCommentMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useDeleteCommentMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [deleteCommentMutation, { data, loading, error }] = useDeleteCommentMutation({\n *   variables: {\n *      input: // value for 'input'\n *   },\n * });\n */\nexport function useDeleteCommentMutation(baseOptions?: ApolloReactHooks.MutationHookOptions<DeleteCommentMutation, DeleteCommentMutationVariables>) {\n        return ApolloReactHooks.useMutation<DeleteCommentMutation, DeleteCommentMutationVariables>(DeleteCommentDocument, baseOptions);\n      }\nexport type DeleteCommentMutationHookResult = ReturnType<typeof useDeleteCommentMutation>;\nexport type DeleteCommentMutationResult = ApolloReactCommon.MutationResult<DeleteCommentMutation>;\nexport type DeleteCommentMutationOptions = ApolloReactCommon.BaseMutationOptions<DeleteCommentMutation, DeleteCommentMutationVariables>;\nexport const NewNoteDocument = gql`\n    subscription newNote($filter: NoteSubscriptionFilter) {\n  newNote(filter: $filter) {\n    ...NoteFields\n  }\n}\n    ${NoteFieldsFragmentDoc}`;\n\n/**\n * __useNewNoteSubscription__\n *\n * To run a query within a React component, call `useNewNoteSubscription` and pass it any options that fit your needs.\n * When your component renders, `useNewNoteSubscription` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useNewNoteSubscription({\n *   variables: {\n *      filter: // value for 'filter'\n *   },\n * });\n */\nexport function useNewNoteSubscription(baseOptions?: ApolloReactHooks.SubscriptionHookOptions<NewNoteSubscription, NewNoteSubscriptionVariables>) {\n        return ApolloReactHooks.useSubscription<NewNoteSubscription, NewNoteSubscriptionVariables>(NewNoteDocument, baseOptions);\n      }\nexport type NewNoteSubscriptionHookResult = ReturnType<typeof useNewNoteSubscription>;\nexport type NewNoteSubscriptionResult = ApolloReactCommon.SubscriptionResult<NewNoteSubscription>;\nexport const UpdatedNoteDocument = gql`\n    subscription updatedNote($filter: NoteSubscriptionFilter) {\n  updatedNote(filter: $filter) {\n    ...NoteFields\n  }\n}\n    ${NoteFieldsFragmentDoc}`;\n\n/**\n * __useUpdatedNoteSubscription__\n *\n * To run a query within a React component, call `useUpdatedNoteSubscription` and pass it any options that fit your needs.\n * When your component renders, `useUpdatedNoteSubscription` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useUpdatedNoteSubscription({\n *   variables: {\n *      filter: // value for 'filter'\n *   },\n * });\n */\nexport function useUpdatedNoteSubscription(baseOptions?: ApolloReactHooks.SubscriptionHookOptions<UpdatedNoteSubscription, UpdatedNoteSubscriptionVariables>) {\n        return ApolloReactHooks.useSubscription<UpdatedNoteSubscription, UpdatedNoteSubscriptionVariables>(UpdatedNoteDocument, baseOptions);\n      }\nexport type UpdatedNoteSubscriptionHookResult = ReturnType<typeof useUpdatedNoteSubscription>;\nexport type UpdatedNoteSubscriptionResult = ApolloReactCommon.SubscriptionResult<UpdatedNoteSubscription>;\nexport const DeletedNoteDocument = gql`\n    subscription deletedNote($filter: NoteSubscriptionFilter) {\n  deletedNote(filter: $filter) {\n    ...NoteFields\n  }\n}\n    ${NoteFieldsFragmentDoc}`;\n\n/**\n * __useDeletedNoteSubscription__\n *\n * To run a query within a React component, call `useDeletedNoteSubscription` and pass it any options that fit your needs.\n * When your component renders, `useDeletedNoteSubscription` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useDeletedNoteSubscription({\n *   variables: {\n *      filter: // value for 'filter'\n *   },\n * });\n */\nexport function useDeletedNoteSubscription(baseOptions?: ApolloReactHooks.SubscriptionHookOptions<DeletedNoteSubscription, DeletedNoteSubscriptionVariables>) {\n        return ApolloReactHooks.useSubscription<DeletedNoteSubscription, DeletedNoteSubscriptionVariables>(DeletedNoteDocument, baseOptions);\n      }\nexport type DeletedNoteSubscriptionHookResult = ReturnType<typeof useDeletedNoteSubscription>;\nexport type DeletedNoteSubscriptionResult = ApolloReactCommon.SubscriptionResult<DeletedNoteSubscription>;\nexport const NewCommentDocument = gql`\n    subscription newComment($filter: CommentSubscriptionFilter) {\n  newComment(filter: $filter) {\n    ...CommentFields\n  }\n}\n    ${CommentFieldsFragmentDoc}`;\n\n/**\n * __useNewCommentSubscription__\n *\n * To run a query within a React component, call `useNewCommentSubscription` and pass it any options that fit your needs.\n * When your component renders, `useNewCommentSubscription` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useNewCommentSubscription({\n *   variables: {\n *      filter: // value for 'filter'\n *   },\n * });\n */\nexport function useNewCommentSubscription(baseOptions?: ApolloReactHooks.SubscriptionHookOptions<NewCommentSubscription, NewCommentSubscriptionVariables>) {\n        return ApolloReactHooks.useSubscription<NewCommentSubscription, NewCommentSubscriptionVariables>(NewCommentDocument, baseOptions);\n      }\nexport type NewCommentSubscriptionHookResult = ReturnType<typeof useNewCommentSubscription>;\nexport type NewCommentSubscriptionResult = ApolloReactCommon.SubscriptionResult<NewCommentSubscription>;\nexport const UpdatedCommentDocument = gql`\n    subscription updatedComment($filter: CommentSubscriptionFilter) {\n  updatedComment(filter: $filter) {\n    ...CommentFields\n  }\n}\n    ${CommentFieldsFragmentDoc}`;\n\n/**\n * __useUpdatedCommentSubscription__\n *\n * To run a query within a React component, call `useUpdatedCommentSubscription` and pass it any options that fit your needs.\n * When your component renders, `useUpdatedCommentSubscription` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useUpdatedCommentSubscription({\n *   variables: {\n *      filter: // value for 'filter'\n *   },\n * });\n */\nexport function useUpdatedCommentSubscription(baseOptions?: ApolloReactHooks.SubscriptionHookOptions<UpdatedCommentSubscription, UpdatedCommentSubscriptionVariables>) {\n        return ApolloReactHooks.useSubscription<UpdatedCommentSubscription, UpdatedCommentSubscriptionVariables>(UpdatedCommentDocument, baseOptions);\n      }\nexport type UpdatedCommentSubscriptionHookResult = ReturnType<typeof useUpdatedCommentSubscription>;\nexport type UpdatedCommentSubscriptionResult = ApolloReactCommon.SubscriptionResult<UpdatedCommentSubscription>;\nexport const DeletedCommentDocument = gql`\n    subscription deletedComment($filter: CommentSubscriptionFilter) {\n  deletedComment(filter: $filter) {\n    ...CommentFields\n  }\n}\n    ${CommentFieldsFragmentDoc}`;\n\n/**\n * __useDeletedCommentSubscription__\n *\n * To run a query within a React component, call `useDeletedCommentSubscription` and pass it any options that fit your needs.\n * When your component renders, `useDeletedCommentSubscription` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the subscription, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useDeletedCommentSubscription({\n *   variables: {\n *      filter: // value for 'filter'\n *   },\n * });\n */\nexport function useDeletedCommentSubscription(baseOptions?: ApolloReactHooks.SubscriptionHookOptions<DeletedCommentSubscription, DeletedCommentSubscriptionVariables>) {\n        return ApolloReactHooks.useSubscription<DeletedCommentSubscription, DeletedCommentSubscriptionVariables>(DeletedCommentDocument, baseOptions);\n      }\nexport type DeletedCommentSubscriptionHookResult = ReturnType<typeof useDeletedCommentSubscription>;\nexport type DeletedCommentSubscriptionResult = ApolloReactCommon.SubscriptionResult<DeletedCommentSubscription>;"
  },
  {
    "path": "templates/fullstack/client/src/graphql/graphback.graphql",
    "content": "fragment NoteFields on Note {\n   id\n   title\n   description\n\n} \n\nfragment NoteExpandedFields on Note {\n   id\n   title\n   description\n   comments {\n      id\n      text\n      description\n   }\n} \n\nfragment CommentFields on Comment {\n   id\n   text\n   description\n\n} \n\nfragment CommentExpandedFields on Comment {\n   id\n   text\n   description\n   note {\n      id\n      title\n      description\n   }\n} \n\nquery findNotes($filter: NoteFilter, $page: PageRequest, $orderBy: OrderByInput) {\n    findNotes(filter: $filter, page: $page, orderBy: $orderBy) {\n      items {\n        ...NoteExpandedFields\n      }\n      offset\n      limit\n      count\n    }\n  }\n\nquery getNote($id: ID!) {\n    getNote(id: $id) {\n      ...NoteExpandedFields\n    }\n  }\n\nquery findComments($filter: CommentFilter, $page: PageRequest, $orderBy: OrderByInput) {\n    findComments(filter: $filter, page: $page, orderBy: $orderBy) {\n      items {\n        ...CommentExpandedFields\n      }\n      offset\n      limit\n      count\n    }\n  }\n\nquery getComment($id: ID!) {\n    getComment(id: $id) {\n      ...CommentExpandedFields\n    }\n  }\n\nmutation createNote($input: CreateNoteInput!) {\n  createNote(input: $input) {\n      ...NoteFields\n  }\n}\n\n\nmutation updateNote($input: MutateNoteInput!) {\n  updateNote(input: $input) {\n      ...NoteFields\n  }\n}\n\n\nmutation deleteNote($input: MutateNoteInput!) {\n  deleteNote(input: $input) {\n      ...NoteFields\n  }\n}\n\n\nmutation createComment($input: CreateCommentInput!) {\n  createComment(input: $input) {\n      ...CommentFields\n  }\n}\n\n\nmutation updateComment($input: MutateCommentInput!) {\n  updateComment(input: $input) {\n      ...CommentFields\n  }\n}\n\n\nmutation deleteComment($input: MutateCommentInput!) {\n  deleteComment(input: $input) {\n      ...CommentFields\n  }\n}\n\n\nsubscription newNote($filter: NoteSubscriptionFilter) {\n  newNote(filter: $filter) {\n      ...NoteFields\n  }\n} \n\nsubscription updatedNote($filter: NoteSubscriptionFilter) {\n  updatedNote(filter: $filter) {\n      ...NoteFields\n  }\n} \n\nsubscription deletedNote($filter: NoteSubscriptionFilter) {\n  deletedNote(filter: $filter) {\n      ...NoteFields\n  }\n} \n\nsubscription newComment($filter: CommentSubscriptionFilter) {\n  newComment(filter: $filter) {\n      ...CommentFields\n  }\n} \n\nsubscription updatedComment($filter: CommentSubscriptionFilter) {\n  updatedComment(filter: $filter) {\n      ...CommentFields\n  }\n} \n\nsubscription deletedComment($filter: CommentSubscriptionFilter) {\n  deletedComment(filter: $filter) {\n      ...CommentFields\n  }\n} "
  },
  {
    "path": "templates/fullstack/client/src/index.css",
    "content": "body {\n  margin: 0;\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n    sans-serif;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n    monospace;\n}\n"
  },
  {
    "path": "templates/fullstack/client/src/index.tsx",
    "content": "import { ApolloProvider } from '@apollo/react-hooks';\nimport ApolloClient from 'apollo-boost';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './App';\nimport './index.css';\nimport * as serviceWorker from './serviceWorker';\n\nconst apolloClient = new ApolloClient({\n  uri: 'http://localhost:4000/graphql',\n});\n\nReactDOM.render(\n  <ApolloProvider client={apolloClient}>\n    <App />\n  </ApolloProvider>,\n  document.getElementById('root')\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"
  },
  {
    "path": "templates/fullstack/client/src/react-app-env.d.ts",
    "content": "/// <reference types=\"react-scripts\" />\n"
  },
  {
    "path": "templates/fullstack/client/src/serviceWorker.ts",
    "content": "// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n  window.location.hostname === 'localhost' ||\n    // [::1] is the IPv6 localhost address.\n    window.location.hostname === '[::1]' ||\n    // 127.0.0.1/8 is considered localhost for IPv4.\n    window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)\n);\n\ntype Config = {\n  onSuccess?: (registration: ServiceWorkerRegistration) => void;\n  onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: Config) {\n  if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n    // The URL constructor is available in all browsers that support SW.\n    const publicUrl = new URL((process as { env: { [key: string]: string } }).env.PUBLIC_URL, window.location.href);\n    if (publicUrl.origin !== window.location.origin) {\n      // Our service worker won't work if PUBLIC_URL is on a different origin\n      // from what our page is served on. This might happen if a CDN is used to\n      // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n      return;\n    }\n\n    window.addEventListener('load', () => {\n      const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n      if (isLocalhost) {\n        // This is running on localhost. Let's check if a service worker still exists or not.\n        checkValidServiceWorker(swUrl, config);\n\n        // Add some additional logging to localhost, pointing developers to the\n        // service worker/PWA documentation.\n        navigator.serviceWorker.ready.then(() => {\n          console.log(\n            'This web app is being served cache-first by a service ' +\n              'worker. To learn more, visit https://bit.ly/CRA-PWA'\n          );\n        });\n      } else {\n        // Is not localhost. Just register service worker\n        registerValidSW(swUrl, config);\n      }\n    });\n  }\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n  navigator.serviceWorker\n    .register(swUrl)\n    .then((registration) => {\n      registration.onupdatefound = () => {\n        const installingWorker = registration.installing;\n        if (installingWorker == null) {\n          return;\n        }\n        installingWorker.onstatechange = () => {\n          if (installingWorker.state === 'installed') {\n            if (navigator.serviceWorker.controller) {\n              // At this point, the updated precached content has been fetched,\n              // but the previous service worker will still serve the older\n              // content until all client tabs are closed.\n              console.log(\n                'New content is available and will be used when all ' +\n                  'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n              );\n\n              // Execute callback\n              if (config && config.onUpdate) {\n                config.onUpdate(registration);\n              }\n            } else {\n              // At this point, everything has been precached.\n              // It's the perfect time to display a\n              // \"Content is cached for offline use.\" message.\n              console.log('Content is cached for offline use.');\n\n              // Execute callback\n              if (config && config.onSuccess) {\n                config.onSuccess(registration);\n              }\n            }\n          }\n        };\n      };\n    })\n    .catch((error) => {\n      console.error('Error during service worker registration:', error);\n    });\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n  // Check if the service worker can be found. If it can't reload the page.\n  fetch(swUrl)\n    .then((response) => {\n      // Ensure service worker exists, and that we really are getting a JS file.\n      const contentType = response.headers.get('content-type');\n      if (response.status === 404 || (contentType != null && contentType.indexOf('javascript') === -1)) {\n        // No service worker found. Probably a different app. Reload the page.\n        navigator.serviceWorker.ready.then((registration) => {\n          registration.unregister().then(() => {\n            window.location.reload();\n          });\n        });\n      } else {\n        // Service worker found. Proceed as normal.\n        registerValidSW(swUrl, config);\n      }\n    })\n    .catch(() => {\n      console.log('No internet connection found. App is running in offline mode.');\n    });\n}\n\nexport function unregister() {\n  if ('serviceWorker' in navigator) {\n    navigator.serviceWorker.ready.then((registration) => {\n      registration.unregister();\n    });\n  }\n}\n"
  },
  {
    "path": "templates/fullstack/client/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"es5\",\n    \"lib\": [\n      \"dom\",\n      \"dom.iterable\",\n      \"esnext\"\n    ],\n    \"allowJs\": true,\n    \"skipLibCheck\": true,\n    \"esModuleInterop\": true,\n    \"allowSyntheticDefaultImports\": true,\n    \"strict\": true,\n    \"forceConsistentCasingInFileNames\": true,\n    \"module\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"resolveJsonModule\": true,\n    \"isolatedModules\": true,\n    \"noEmit\": true,\n    \"jsx\": \"react\"\n  },\n  \"include\": [\n    \"src\"\n  ]\n}\n"
  },
  {
    "path": "templates/fullstack/docker-compose.yml",
    "content": "version: '3'\n\nservices:\n  postgres:\n    image: postgres:9.6\n    ports:\n      - \"55432:5432\"\n    environment:\n      POSTGRES_PASSWORD: postgres\n      POSTGRES_USER: postgresql\n      POSTGRES_DB: users\n"
  },
  {
    "path": "templates/fullstack/model/datamodel.graphql",
    "content": "\"\"\" @model \"\"\"\ntype Note {\n  id: ID!\n  title: String!\n  description: String\n  \"\"\"\n  @oneToMany(field: 'note')\n  \"\"\"\n  comments: [Comment]!\n}\n\n\"\"\" @model \"\"\"\ntype Comment {\n  id: ID!\n  text: String\n  description: String\n}"
  },
  {
    "path": "templates/fullstack/package.json",
    "content": "{\n  \"name\": \"full-stack-template\",\n  \"version\": \"4.1.0\",\n  \"private\": true,\n  \"workspaces\": [\n    \"client\",\n    \"server\"\n  ],\n  \"scripts\": {\n    \"start:server\": \"cd server/ && yarn start\",\n    \"start:client\": \"cd client/ && yarn start\"\n  },\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"@graphql-codegen/add\": \"2.0.2\",\n    \"@graphql-codegen/typescript\": \"1.23.0\",\n    \"@graphql-codegen/typescript-operations\": \"1.18.4\",\n    \"@graphql-codegen/typescript-react-apollo\": \"2.3.1\",\n    \"@graphql-codegen/typescript-resolvers\": \"1.20.0\",\n    \"@graphql-cli/codegen\": \"1.17.27\",\n    \"@graphql-cli/coverage\": \"2.1.0\",\n    \"@graphql-cli/diff\": \"2.1.0\",\n    \"@graphql-cli/generate\": \"4.1.0\",\n    \"@graphql-cli/serve\": \"4.1.0\",\n    \"@graphql-cli/similar\": \"2.1.0\",\n    \"@graphql-cli/validate\": \"2.1.0\",\n    \"graphql\": \"15.7.2\",\n    \"graphql-cli\": \"4.1.0\",\n    \"schemats\": \"3.0.3\",\n    \"tslint\": \"6.1.3\",\n    \"typescript\": \"4.4.4\"\n  },\n  \"resolutions\": {\n    \"graphql\": \"15.7.2\"\n  },\n  \"author\": {\n    \"name\": \"Arda TANRIKULU\"\n  }\n}\n"
  },
  {
    "path": "templates/fullstack/renovate.json",
    "content": "{\n  \"extends\": [\n    \"config:base\"\n  ],\n  \"automerge\": true,\n  \"major\": {\n    \"automerge\": false\n  }\n}\n"
  },
  {
    "path": "templates/fullstack/schemats.json",
    "content": "{\n    \"conn\": \"postgres://postgresql:postgres@localhost:55432/users\",\n    \"output\": \"server/src/generated-db-types.ts\"\n}"
  },
  {
    "path": "templates/fullstack/server/package.json",
    "content": "{\n  \"private\": true,\n  \"name\": \"full-stack-template-server\",\n  \"version\": \"4.1.0\",\n  \"scripts\": {\n    \"develop\": \"ts-node-dev src/index.ts\",\n    \"start\": \"ts-node src/index.ts\"\n  },\n  \"dependencies\": {\n    \"graphback\": \"1.1.2\",\n    \"@graphback/runtime-knex\": \"1.1.2\",\n    \"@graphback/codegen-schema\": \"1.1.2\",\n    \"graphql-migrations\": \"1.1.2\",\n    \"@graphql-tools/load-files\": \"6.5.2\",\n    \"@types/cors\": \"2.8.12\",\n    \"@types/express\": \"4.17.13\",\n    \"@types/node\": \"13.13.45\",\n    \"apollo-server-express\": \"2.25.3\",\n    \"cors\": \"2.8.5\",\n    \"express\": \"4.17.1\",\n    \"graphql\": \"15.7.2\",\n    \"graphql-config\": \"3.4.1\",\n    \"graphql-tag\": \"2.12.6\",\n    \"knex\": \"0.95.14\",\n    \"pg\": \"8.7.1\",\n    \"ts-node\": \"9.1.1\",\n    \"ts-node-dev\": \"1.1.8\",\n    \"typescript\": \"4.4.4\"\n  }\n}\n"
  },
  {
    "path": "templates/fullstack/server/src/db.ts",
    "content": "import { loadConfig } from 'graphql-config';\nimport Knex from 'knex';\n\nexport const getConfig = async () => {\n  const config = await loadConfig({\n    extensions: [() => ({ name: 'dbmigrations' })],\n  });\n  if (!config) {\n    throw new Error('Missing dbmigrations config');\n  }\n  const conf = await config.getDefault().extension('dbmigrations');\n\n  return conf;\n};\n\n/**\n * Creates knex based database using migration configuration\n * For production use please use different source of the configuration\n */\nexport const createDB = async () => {\n  const dbmigrations = await getConfig();\n  // connect to db\n  const db = Knex(dbmigrations);\n\n  return db as any;\n};\n"
  },
  {
    "path": "templates/fullstack/server/src/generated-db-types.ts",
    "content": "/* tslint:disable */\r\n\r\n/**\r\n * AUTO-GENERATED FILE @ 2020-06-03 11:49:44 - DO NOT EDIT!\r\n *\r\n * This file was automatically generated by schemats v.3.0.3\r\n * $ schemats generate -c postgres://username:password@localhost:55432/users -t note -t comment -s public\r\n *\r\n */\r\n\r\nexport namespace noteFields {\r\n    export type title = string;\r\n    export type description = string | null;\r\n    export type id = number;\r\n\r\n}\r\n\r\nexport interface note {\r\n    title: noteFields.title;\r\n    description: noteFields.description;\r\n    id: noteFields.id;\r\n\r\n}\r\n\r\nexport namespace commentFields {\r\n    export type text = string | null;\r\n    export type description = string | null;\r\n    export type noteId = number | null;\r\n    export type id = number;\r\n\r\n}\r\n\r\nexport interface comment {\r\n    text: commentFields.text;\r\n    description: commentFields.description;\r\n    noteId: commentFields.noteId;\r\n    id: commentFields.id;\r\n\r\n}\r\n"
  },
  {
    "path": "templates/fullstack/server/src/generated-types.ts",
    "content": "/* tslint:disable */\nimport { GraphQLResolveInfo } from 'graphql';\nimport { comment, note } from './generated-db-types';\nimport { GraphbackRuntimeContext } from '@graphback/runtime';\nexport type Maybe<T> = T | null;\nexport type Exact<T extends { [key: string]: any }> = { [K in keyof T]: T[K] };\nexport type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;\nexport type RequireFields<T, K extends keyof T> = { [X in Exclude<keyof T, K>]?: T[X] } & { [P in K]-?: NonNullable<T[P]> };\n\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n  ID: string;\n  String: string;\n  Boolean: boolean;\n  Int: number;\n  Float: number;\n};\n\n/**  @model  */\nexport type Comment = {\n  __typename?: 'Comment';\n  id: Scalars['ID'];\n  text?: Maybe<Scalars['String']>;\n  description?: Maybe<Scalars['String']>;\n  /** @manyToOne(field: 'comments', key: 'noteId') */\n  note?: Maybe<Note>;\n};\n\nexport type CommentFilter = {\n  id?: Maybe<IdInput>;\n  text?: Maybe<StringInput>;\n  description?: Maybe<StringInput>;\n  noteId?: Maybe<IdInput>;\n  and?: Maybe<Array<CommentFilter>>;\n  or?: Maybe<Array<CommentFilter>>;\n  not?: Maybe<CommentFilter>;\n};\n\nexport type CommentResultList = {\n  __typename?: 'CommentResultList';\n  items: Array<Maybe<Comment>>;\n  offset?: Maybe<Scalars['Int']>;\n  limit?: Maybe<Scalars['Int']>;\n  count?: Maybe<Scalars['Int']>;\n};\n\nexport type CommentSubscriptionFilter = {\n  id?: Maybe<Scalars['ID']>;\n  text?: Maybe<Scalars['String']>;\n  description?: Maybe<Scalars['String']>;\n};\n\nexport type CreateCommentInput = {\n  id?: Maybe<Scalars['ID']>;\n  text?: Maybe<Scalars['String']>;\n  description?: Maybe<Scalars['String']>;\n  noteId?: Maybe<Scalars['ID']>;\n};\n\nexport type CreateNoteInput = {\n  id?: Maybe<Scalars['ID']>;\n  title: Scalars['String'];\n  description?: Maybe<Scalars['String']>;\n};\n\nexport type IdInput = {\n  ne?: Maybe<Scalars['ID']>;\n  eq?: Maybe<Scalars['ID']>;\n  le?: Maybe<Scalars['ID']>;\n  lt?: Maybe<Scalars['ID']>;\n  ge?: Maybe<Scalars['ID']>;\n  gt?: Maybe<Scalars['ID']>;\n  in?: Maybe<Array<Scalars['ID']>>;\n};\n\nexport type MutateCommentInput = {\n  id: Scalars['ID'];\n  text?: Maybe<Scalars['String']>;\n  description?: Maybe<Scalars['String']>;\n  noteId?: Maybe<Scalars['ID']>;\n};\n\nexport type MutateNoteInput = {\n  id: Scalars['ID'];\n  title?: Maybe<Scalars['String']>;\n  description?: Maybe<Scalars['String']>;\n};\n\nexport type Mutation = {\n  __typename?: 'Mutation';\n  createNote?: Maybe<Note>;\n  updateNote?: Maybe<Note>;\n  deleteNote?: Maybe<Note>;\n  createComment?: Maybe<Comment>;\n  updateComment?: Maybe<Comment>;\n  deleteComment?: Maybe<Comment>;\n};\n\n\nexport type MutationCreateNoteArgs = {\n  input: CreateNoteInput;\n};\n\n\nexport type MutationUpdateNoteArgs = {\n  input: MutateNoteInput;\n};\n\n\nexport type MutationDeleteNoteArgs = {\n  input: MutateNoteInput;\n};\n\n\nexport type MutationCreateCommentArgs = {\n  input: CreateCommentInput;\n};\n\n\nexport type MutationUpdateCommentArgs = {\n  input: MutateCommentInput;\n};\n\n\nexport type MutationDeleteCommentArgs = {\n  input: MutateCommentInput;\n};\n\n/**  @model  */\nexport type Note = {\n  __typename?: 'Note';\n  id: Scalars['ID'];\n  title: Scalars['String'];\n  description?: Maybe<Scalars['String']>;\n  /** @oneToMany(field: 'note', key: 'noteId') */\n  comments: Array<Maybe<Comment>>;\n};\n\n\n/**  @model  */\nexport type NoteCommentsArgs = {\n  filter?: Maybe<CommentFilter>;\n};\n\nexport type NoteFilter = {\n  id?: Maybe<IdInput>;\n  title?: Maybe<StringInput>;\n  description?: Maybe<StringInput>;\n  and?: Maybe<Array<NoteFilter>>;\n  or?: Maybe<Array<NoteFilter>>;\n  not?: Maybe<NoteFilter>;\n};\n\nexport type NoteResultList = {\n  __typename?: 'NoteResultList';\n  items: Array<Maybe<Note>>;\n  offset?: Maybe<Scalars['Int']>;\n  limit?: Maybe<Scalars['Int']>;\n  count?: Maybe<Scalars['Int']>;\n};\n\nexport type NoteSubscriptionFilter = {\n  id?: Maybe<Scalars['ID']>;\n  title?: Maybe<Scalars['String']>;\n  description?: Maybe<Scalars['String']>;\n};\n\nexport type OrderByInput = {\n  field: Scalars['String'];\n  order?: Maybe<SortDirectionEnum>;\n};\n\nexport type PageRequest = {\n  limit?: Maybe<Scalars['Int']>;\n  offset?: Maybe<Scalars['Int']>;\n};\n\nexport type Query = {\n  __typename?: 'Query';\n  getNote?: Maybe<Note>;\n  findNotes: NoteResultList;\n  getComment?: Maybe<Comment>;\n  findComments: CommentResultList;\n};\n\n\nexport type QueryGetNoteArgs = {\n  id: Scalars['ID'];\n};\n\n\nexport type QueryFindNotesArgs = {\n  filter?: Maybe<NoteFilter>;\n  page?: Maybe<PageRequest>;\n  orderBy?: Maybe<OrderByInput>;\n};\n\n\nexport type QueryGetCommentArgs = {\n  id: Scalars['ID'];\n};\n\n\nexport type QueryFindCommentsArgs = {\n  filter?: Maybe<CommentFilter>;\n  page?: Maybe<PageRequest>;\n  orderBy?: Maybe<OrderByInput>;\n};\n\nexport enum SortDirectionEnum {\n  Desc = 'DESC',\n  Asc = 'ASC'\n}\n\nexport type StringInput = {\n  ne?: Maybe<Scalars['String']>;\n  eq?: Maybe<Scalars['String']>;\n  le?: Maybe<Scalars['String']>;\n  lt?: Maybe<Scalars['String']>;\n  ge?: Maybe<Scalars['String']>;\n  gt?: Maybe<Scalars['String']>;\n  in?: Maybe<Array<Scalars['String']>>;\n  contains?: Maybe<Scalars['String']>;\n  startsWith?: Maybe<Scalars['String']>;\n  endsWith?: Maybe<Scalars['String']>;\n};\n\nexport type Subscription = {\n  __typename?: 'Subscription';\n  newNote: Note;\n  updatedNote: Note;\n  deletedNote: Note;\n  newComment: Comment;\n  updatedComment: Comment;\n  deletedComment: Comment;\n};\n\n\nexport type SubscriptionNewNoteArgs = {\n  filter?: Maybe<NoteSubscriptionFilter>;\n};\n\n\nexport type SubscriptionUpdatedNoteArgs = {\n  filter?: Maybe<NoteSubscriptionFilter>;\n};\n\n\nexport type SubscriptionDeletedNoteArgs = {\n  filter?: Maybe<NoteSubscriptionFilter>;\n};\n\n\nexport type SubscriptionNewCommentArgs = {\n  filter?: Maybe<CommentSubscriptionFilter>;\n};\n\n\nexport type SubscriptionUpdatedCommentArgs = {\n  filter?: Maybe<CommentSubscriptionFilter>;\n};\n\n\nexport type SubscriptionDeletedCommentArgs = {\n  filter?: Maybe<CommentSubscriptionFilter>;\n};\n\nexport type WithIndex<TObject> = TObject & Record<string, any>;\nexport type ResolversObject<TObject> = WithIndex<TObject>;\n\nexport type ResolverTypeWrapper<T> = Promise<T> | T;\n\n\nexport type LegacyStitchingResolver<TResult, TParent, TContext, TArgs> = {\n  fragment: string;\n  resolve: ResolverFn<TResult, TParent, TContext, TArgs>;\n};\n\nexport type NewStitchingResolver<TResult, TParent, TContext, TArgs> = {\n  selectionSet: string;\n  resolve: ResolverFn<TResult, TParent, TContext, TArgs>;\n};\nexport type StitchingResolver<TResult, TParent, TContext, TArgs> = LegacyStitchingResolver<TResult, TParent, TContext, TArgs> | NewStitchingResolver<TResult, TParent, TContext, TArgs>;\nexport type Resolver<TResult, TParent = {}, TContext = {}, TArgs = {}> =\n  | ResolverFn<TResult, TParent, TContext, TArgs>\n  | StitchingResolver<TResult, TParent, TContext, TArgs>;\n\nexport type ResolverFn<TResult, TParent, TContext, TArgs> = (\n  parent: TParent,\n  args: TArgs,\n  context: TContext,\n  info: GraphQLResolveInfo\n) => Promise<TResult> | TResult;\n\nexport type SubscriptionSubscribeFn<TResult, TParent, TContext, TArgs> = (\n  parent: TParent,\n  args: TArgs,\n  context: TContext,\n  info: GraphQLResolveInfo\n) => AsyncIterator<TResult> | Promise<AsyncIterator<TResult>>;\n\nexport type SubscriptionResolveFn<TResult, TParent, TContext, TArgs> = (\n  parent: TParent,\n  args: TArgs,\n  context: TContext,\n  info: GraphQLResolveInfo\n) => TResult | Promise<TResult>;\n\nexport interface SubscriptionSubscriberObject<TResult, TKey extends string, TParent, TContext, TArgs> {\n  subscribe: SubscriptionSubscribeFn<{ [key in TKey]: TResult }, TParent, TContext, TArgs>;\n  resolve?: SubscriptionResolveFn<TResult, { [key in TKey]: TResult }, TContext, TArgs>;\n}\n\nexport interface SubscriptionResolverObject<TResult, TParent, TContext, TArgs> {\n  subscribe: SubscriptionSubscribeFn<any, TParent, TContext, TArgs>;\n  resolve: SubscriptionResolveFn<TResult, any, TContext, TArgs>;\n}\n\nexport type SubscriptionObject<TResult, TKey extends string, TParent, TContext, TArgs> =\n  | SubscriptionSubscriberObject<TResult, TKey, TParent, TContext, TArgs>\n  | SubscriptionResolverObject<TResult, TParent, TContext, TArgs>;\n\nexport type SubscriptionResolver<TResult, TKey extends string, TParent = {}, TContext = {}, TArgs = {}> =\n  | ((...args: any[]) => SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>)\n  | SubscriptionObject<TResult, TKey, TParent, TContext, TArgs>;\n\nexport type TypeResolveFn<TTypes, TParent = {}, TContext = {}> = (\n  parent: TParent,\n  context: TContext,\n  info: GraphQLResolveInfo\n) => Maybe<TTypes> | Promise<Maybe<TTypes>>;\n\nexport type IsTypeOfResolverFn<T = {}> = (obj: T, info: GraphQLResolveInfo) => boolean | Promise<boolean>;\n\nexport type NextResolverFn<T> = () => Promise<T>;\n\nexport type DirectiveResolverFn<TResult = {}, TParent = {}, TContext = {}, TArgs = {}> = (\n  next: NextResolverFn<TResult>,\n  parent: TParent,\n  args: TArgs,\n  context: TContext,\n  info: GraphQLResolveInfo\n) => TResult | Promise<TResult>;\n\n/** Mapping between all available schema types and the resolvers types */\nexport type ResolversTypes = ResolversObject<{\n  Comment: ResolverTypeWrapper<comment>;\n  ID: ResolverTypeWrapper<Scalars['ID']>;\n  String: ResolverTypeWrapper<Scalars['String']>;\n  CommentFilter: CommentFilter;\n  CommentResultList: ResolverTypeWrapper<Omit<CommentResultList, 'items'> & { items: Array<Maybe<ResolversTypes['Comment']>> }>;\n  Int: ResolverTypeWrapper<Scalars['Int']>;\n  CommentSubscriptionFilter: CommentSubscriptionFilter;\n  CreateCommentInput: CreateCommentInput;\n  CreateNoteInput: CreateNoteInput;\n  IDInput: IdInput;\n  MutateCommentInput: MutateCommentInput;\n  MutateNoteInput: MutateNoteInput;\n  Mutation: ResolverTypeWrapper<{}>;\n  Note: ResolverTypeWrapper<note>;\n  NoteFilter: NoteFilter;\n  NoteResultList: ResolverTypeWrapper<Omit<NoteResultList, 'items'> & { items: Array<Maybe<ResolversTypes['Note']>> }>;\n  NoteSubscriptionFilter: NoteSubscriptionFilter;\n  OrderByInput: OrderByInput;\n  PageRequest: PageRequest;\n  Query: ResolverTypeWrapper<{}>;\n  SortDirectionEnum: SortDirectionEnum;\n  StringInput: StringInput;\n  Subscription: ResolverTypeWrapper<{}>;\n  Boolean: ResolverTypeWrapper<Scalars['Boolean']>;\n}>;\n\n/** Mapping between all available schema types and the resolvers parents */\nexport type ResolversParentTypes = ResolversObject<{\n  Comment: comment;\n  ID: Scalars['ID'];\n  String: Scalars['String'];\n  CommentFilter: CommentFilter;\n  CommentResultList: Omit<CommentResultList, 'items'> & { items: Array<Maybe<ResolversParentTypes['Comment']>> };\n  Int: Scalars['Int'];\n  CommentSubscriptionFilter: CommentSubscriptionFilter;\n  CreateCommentInput: CreateCommentInput;\n  CreateNoteInput: CreateNoteInput;\n  IDInput: IdInput;\n  MutateCommentInput: MutateCommentInput;\n  MutateNoteInput: MutateNoteInput;\n  Mutation: {};\n  Note: note;\n  NoteFilter: NoteFilter;\n  NoteResultList: Omit<NoteResultList, 'items'> & { items: Array<Maybe<ResolversParentTypes['Note']>> };\n  NoteSubscriptionFilter: NoteSubscriptionFilter;\n  OrderByInput: OrderByInput;\n  PageRequest: PageRequest;\n  Query: {};\n  StringInput: StringInput;\n  Subscription: {};\n  Boolean: Scalars['Boolean'];\n}>;\n\nexport type CommentResolvers<ContextType = GraphbackRuntimeContext, ParentType extends ResolversParentTypes['Comment'] = ResolversParentTypes['Comment']> = ResolversObject<{\n  id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;\n  text?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;\n  description?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;\n  note?: Resolver<Maybe<ResolversTypes['Note']>, ParentType, ContextType>;\n  __isTypeOf?: IsTypeOfResolverFn<ParentType>;\n}>;\n\nexport type CommentResultListResolvers<ContextType = GraphbackRuntimeContext, ParentType extends ResolversParentTypes['CommentResultList'] = ResolversParentTypes['CommentResultList']> = ResolversObject<{\n  items?: Resolver<Array<Maybe<ResolversTypes['Comment']>>, ParentType, ContextType>;\n  offset?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;\n  limit?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;\n  count?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;\n  __isTypeOf?: IsTypeOfResolverFn<ParentType>;\n}>;\n\nexport type MutationResolvers<ContextType = GraphbackRuntimeContext, ParentType extends ResolversParentTypes['Mutation'] = ResolversParentTypes['Mutation']> = ResolversObject<{\n  createNote?: Resolver<Maybe<ResolversTypes['Note']>, ParentType, ContextType, RequireFields<MutationCreateNoteArgs, 'input'>>;\n  updateNote?: Resolver<Maybe<ResolversTypes['Note']>, ParentType, ContextType, RequireFields<MutationUpdateNoteArgs, 'input'>>;\n  deleteNote?: Resolver<Maybe<ResolversTypes['Note']>, ParentType, ContextType, RequireFields<MutationDeleteNoteArgs, 'input'>>;\n  createComment?: Resolver<Maybe<ResolversTypes['Comment']>, ParentType, ContextType, RequireFields<MutationCreateCommentArgs, 'input'>>;\n  updateComment?: Resolver<Maybe<ResolversTypes['Comment']>, ParentType, ContextType, RequireFields<MutationUpdateCommentArgs, 'input'>>;\n  deleteComment?: Resolver<Maybe<ResolversTypes['Comment']>, ParentType, ContextType, RequireFields<MutationDeleteCommentArgs, 'input'>>;\n}>;\n\nexport type NoteResolvers<ContextType = GraphbackRuntimeContext, ParentType extends ResolversParentTypes['Note'] = ResolversParentTypes['Note']> = ResolversObject<{\n  id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;\n  title?: Resolver<ResolversTypes['String'], ParentType, ContextType>;\n  description?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;\n  comments?: Resolver<Array<Maybe<ResolversTypes['Comment']>>, ParentType, ContextType, RequireFields<NoteCommentsArgs, never>>;\n  __isTypeOf?: IsTypeOfResolverFn<ParentType>;\n}>;\n\nexport type NoteResultListResolvers<ContextType = GraphbackRuntimeContext, ParentType extends ResolversParentTypes['NoteResultList'] = ResolversParentTypes['NoteResultList']> = ResolversObject<{\n  items?: Resolver<Array<Maybe<ResolversTypes['Note']>>, ParentType, ContextType>;\n  offset?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;\n  limit?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;\n  count?: Resolver<Maybe<ResolversTypes['Int']>, ParentType, ContextType>;\n  __isTypeOf?: IsTypeOfResolverFn<ParentType>;\n}>;\n\nexport type QueryResolvers<ContextType = GraphbackRuntimeContext, ParentType extends ResolversParentTypes['Query'] = ResolversParentTypes['Query']> = ResolversObject<{\n  getNote?: Resolver<Maybe<ResolversTypes['Note']>, ParentType, ContextType, RequireFields<QueryGetNoteArgs, 'id'>>;\n  findNotes?: Resolver<ResolversTypes['NoteResultList'], ParentType, ContextType, RequireFields<QueryFindNotesArgs, never>>;\n  getComment?: Resolver<Maybe<ResolversTypes['Comment']>, ParentType, ContextType, RequireFields<QueryGetCommentArgs, 'id'>>;\n  findComments?: Resolver<ResolversTypes['CommentResultList'], ParentType, ContextType, RequireFields<QueryFindCommentsArgs, never>>;\n}>;\n\nexport type SubscriptionResolvers<ContextType = GraphbackRuntimeContext, ParentType extends ResolversParentTypes['Subscription'] = ResolversParentTypes['Subscription']> = ResolversObject<{\n  newNote?: SubscriptionResolver<ResolversTypes['Note'], \"newNote\", ParentType, ContextType, RequireFields<SubscriptionNewNoteArgs, never>>;\n  updatedNote?: SubscriptionResolver<ResolversTypes['Note'], \"updatedNote\", ParentType, ContextType, RequireFields<SubscriptionUpdatedNoteArgs, never>>;\n  deletedNote?: SubscriptionResolver<ResolversTypes['Note'], \"deletedNote\", ParentType, ContextType, RequireFields<SubscriptionDeletedNoteArgs, never>>;\n  newComment?: SubscriptionResolver<ResolversTypes['Comment'], \"newComment\", ParentType, ContextType, RequireFields<SubscriptionNewCommentArgs, never>>;\n  updatedComment?: SubscriptionResolver<ResolversTypes['Comment'], \"updatedComment\", ParentType, ContextType, RequireFields<SubscriptionUpdatedCommentArgs, never>>;\n  deletedComment?: SubscriptionResolver<ResolversTypes['Comment'], \"deletedComment\", ParentType, ContextType, RequireFields<SubscriptionDeletedCommentArgs, never>>;\n}>;\n\nexport type Resolvers<ContextType = GraphbackRuntimeContext> = ResolversObject<{\n  Comment?: CommentResolvers<ContextType>;\n  CommentResultList?: CommentResultListResolvers<ContextType>;\n  Mutation?: MutationResolvers<ContextType>;\n  Note?: NoteResolvers<ContextType>;\n  NoteResultList?: NoteResultListResolvers<ContextType>;\n  Query?: QueryResolvers<ContextType>;\n  Subscription?: SubscriptionResolvers<ContextType>;\n}>;\n\n\n/**\n * @deprecated\n * Use \"Resolvers\" root object instead. If you wish to get \"IResolvers\", add \"typesPrefix: I\" to your config.\n */\nexport type IResolvers<ContextType = GraphbackRuntimeContext> = Resolvers<ContextType>;\n"
  },
  {
    "path": "templates/fullstack/server/src/graphql.ts",
    "content": "import { join } from 'path';\nimport { loadFiles } from '@graphql-tools/load-files';\nimport { ApolloServer } from 'apollo-server-express';\nimport { buildGraphbackAPI } from 'graphback';\nimport { createKnexDbProvider } from '@graphback/runtime-knex';\nimport { migrateDB, removeNonSafeOperationsFilter } from 'graphql-migrations';\nimport { createDB, getConfig } from './db';\nimport { SchemaCRUDPlugin } from '@graphback/codegen-schema';\n\n/**\n * Creates Apollo server\n */\nexport const createApolloServer = async () => {\n  const db = await createDB();\n  const dbConfig = await getConfig();\n\n  const schema = (await loadFiles(join(__dirname, '../../model/'))).join('\\n');\n  const { resolvers, contextCreator, typeDefs} = buildGraphbackAPI(schema, {\n    dataProviderCreator: createKnexDbProvider(db),\n    plugins: [new SchemaCRUDPlugin({\n      outputPath: \"./src/schema/schema.graphql\"\n    })]\n  });\n\n  migrateDB(dbConfig, typeDefs, {\n    operationFilter: removeNonSafeOperationsFilter\n  }).then(() => {\n    console.log(\"Migrated database\");\n  });\n\n  const apolloServer = new ApolloServer({\n    typeDefs,\n    resolvers,\n    context: contextCreator,\n    playground: true,\n  });\n\n  return apolloServer;\n};\n"
  },
  {
    "path": "templates/fullstack/server/src/index.ts",
    "content": "import cors from 'cors';\nimport express from 'express';\nimport http from 'http';\n\nimport { createApolloServer } from './graphql';\n\nasync function start() {\n  const app = express();\n\n  app.use(cors());\n\n  app.get('/health', (req, res) => res.sendStatus(200));\n\n  const apolloServer = await createApolloServer();\n  apolloServer.applyMiddleware({ app });\n\n  const httpServer = http.createServer(app);\n  apolloServer.installSubscriptionHandlers(httpServer);\n\n  const port = process.env.PORT || 4000;\n\n  httpServer.listen({ port }, () => {\n    console.log(`🚀  Server ready at http://localhost:${port}/graphql`);\n  });\n}\n\nstart().catch((err) => {\n  console.error(err);\n  process.exit(1);\n});\n"
  },
  {
    "path": "templates/fullstack/server/src/schema/schema.graphql",
    "content": "## NOTE: This schema was generated by Graphback and should not be changed manually\n\n\"\"\"Exposes a URL that specifies the behaviour of this scalar.\"\"\"\ndirective @specifiedBy(\n  \"\"\"The URL that specifies the behaviour of this scalar.\"\"\"\n  url: String!\n) on SCALAR\n\n\"\"\" @model \"\"\"\ntype Comment {\n  id: ID!\n  text: String\n  description: String\n\n  \"\"\"@manyToOne(field: 'comments', key: 'noteId')\"\"\"\n  note: Note\n}\n\ninput CommentFilter {\n  id: IDInput\n  text: StringInput\n  description: StringInput\n  noteId: IDInput\n  and: [CommentFilter!]\n  or: [CommentFilter!]\n  not: CommentFilter\n}\n\ntype CommentResultList {\n  items: [Comment]!\n  offset: Int\n  limit: Int\n  count: Int\n}\n\ninput CommentSubscriptionFilter {\n  id: ID\n  text: String\n  description: String\n}\n\ninput CreateCommentInput {\n  id: ID\n  text: String\n  description: String\n  noteId: ID\n}\n\ninput CreateNoteInput {\n  id: ID\n  title: String!\n  description: String\n}\n\ninput IDInput {\n  ne: ID\n  eq: ID\n  le: ID\n  lt: ID\n  ge: ID\n  gt: ID\n  in: [ID!]\n}\n\ninput MutateCommentInput {\n  id: ID!\n  text: String\n  description: String\n  noteId: ID\n}\n\ninput MutateNoteInput {\n  id: ID!\n  title: String\n  description: String\n}\n\ntype Mutation {\n  createNote(input: CreateNoteInput!): Note\n  updateNote(input: MutateNoteInput!): Note\n  deleteNote(input: MutateNoteInput!): Note\n  createComment(input: CreateCommentInput!): Comment\n  updateComment(input: MutateCommentInput!): Comment\n  deleteComment(input: MutateCommentInput!): Comment\n}\n\n\"\"\" @model \"\"\"\ntype Note {\n  id: ID!\n  title: String!\n  description: String\n\n  \"\"\"@oneToMany(field: 'note', key: 'noteId')\"\"\"\n  comments(filter: CommentFilter): [Comment]!\n}\n\ninput NoteFilter {\n  id: IDInput\n  title: StringInput\n  description: StringInput\n  and: [NoteFilter!]\n  or: [NoteFilter!]\n  not: NoteFilter\n}\n\ntype NoteResultList {\n  items: [Note]!\n  offset: Int\n  limit: Int\n  count: Int\n}\n\ninput NoteSubscriptionFilter {\n  id: ID\n  title: String\n  description: String\n}\n\ninput OrderByInput {\n  field: String!\n  order: SortDirectionEnum = ASC\n}\n\ninput PageRequest {\n  limit: Int\n  offset: Int\n}\n\ntype Query {\n  getNote(id: ID!): Note\n  findNotes(filter: NoteFilter, page: PageRequest, orderBy: OrderByInput): NoteResultList!\n  getComment(id: ID!): Comment\n  findComments(filter: CommentFilter, page: PageRequest, orderBy: OrderByInput): CommentResultList!\n}\n\nenum SortDirectionEnum {\n  DESC\n  ASC\n}\n\ninput StringInput {\n  ne: String\n  eq: String\n  le: String\n  lt: String\n  ge: String\n  gt: String\n  in: [String!]\n  contains: String\n  startsWith: String\n  endsWith: String\n}\n\ntype Subscription {\n  newNote(filter: NoteSubscriptionFilter): Note!\n  updatedNote(filter: NoteSubscriptionFilter): Note!\n  deletedNote(filter: NoteSubscriptionFilter): Note!\n  newComment(filter: CommentSubscriptionFilter): Comment!\n  updatedComment(filter: CommentSubscriptionFilter): Comment!\n  deletedComment(filter: CommentSubscriptionFilter): Comment!\n}"
  },
  {
    "path": "templates/fullstack/server/tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"outDir\": \"./dist/\",\n    \"declarationDir\": \"./types\",\n    \"lib\": [\n      \"esnext\",\n      \"dom\"\n    ],\n    \"resolveJsonModule\": true,\n    \"noImplicitAny\": false,\n    \"preserveConstEnums\": true,\n    \"strict\": false,\n    \"strictNullChecks\": true,\n    \"esModuleInterop\": true,\n    \"target\": \"esnext\",\n    \"module\": \"commonjs\",\n    \"moduleResolution\": \"node\",\n    \"allowSyntheticDefaultImports\": true,\n    \"importHelpers\": true,\n    \"alwaysStrict\": false,\n    \"sourceMap\": true,\n    \"declaration\": true,\n    \"noImplicitReturns\": true,\n    \"noUnusedLocals\": false,\n    \"noUnusedParameters\": false,\n    \"noImplicitThis\": false\n  },\n}"
  },
  {
    "path": "templates/fullstack/tslint.json",
    "content": "{\n  \"extends\": \"tslint:recommended\",\n  \"rules\": {\n      \"max-line-length\": {\n          \"options\": [120]\n      },\n      \"semicolon\": false,\n      \"quotemark\": false,\n      \"new-parens\": true,\n      \"no-arg\": true,\n      \"no-bitwise\": true,\n      \"no-conditional-assignment\": false,\n      \"no-consecutive-blank-lines\": false,\n      \"object-literal-sort-keys\": false,\n      \"trailing-comma\": false,\n      \"object-literal-shorthand\": false,\n      \"no-console\": false,\n      \"interface-name\": false\n  },\n  \"jsRules\": {\n      \"max-line-length\": {\n          \"options\": [120]\n      }\n  }\n}\n"
  },
  {
    "path": "templates.json",
    "content": "{\n    \"Full Stack Template with React Hooks, Apollo, NodeJS and PostgreSQL\": {\n        \"repository\": \"https://github.com/Urigo/graphql-cli.git\",\n        \"path\": \"templates/fullstack\",\n        \"projectType\": \"Full Stack\"\n    }\n}\n"
  },
  {
    "path": "website/.gitignore",
    "content": "# Dependencies\n/node_modules\n\n# Production\n/build\n\n# Generated files\n.docusaurus\n.cache-loader\n\n# Misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debug.log*\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "website/README.md",
    "content": "# Website\n\nThis website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.\n\n### Installation\n\n```\n$ yarn\n```\n\n### Local Development\n\n```\n$ yarn start\n```\n\nThis command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.\n\n### Build\n\n```\n$ yarn build\n```\n\nThis command generates static content into the `build` directory and can be served using any static contents hosting service.\n\n### Deployment\n\n```\n$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy\n```\n\nIf you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.\n"
  },
  {
    "path": "website/algolia-lockfile.json",
    "content": "[\n  {\n    \"objectID\": \"cli-codegen\",\n    \"headings\": [],\n    \"toc\": [],\n    \"content\": \"-\",\n    \"url\": \"https://www.graphql-cli.com/codegen\",\n    \"domain\": \"https://www.graphql-cli.com/\",\n    \"hierarchy\": [\"CLI\", \"codegen\"],\n    \"source\": \"CLI\",\n    \"title\": \"codegen\",\n    \"type\": \"Documentation\"\n  },\n  {\n    \"objectID\": \"cli-coverage\",\n    \"headings\": [],\n    \"toc\": [],\n    \"content\": \"-\",\n    \"url\": \"https://www.graphql-cli.com/coverage\",\n    \"domain\": \"https://www.graphql-cli.com/\",\n    \"hierarchy\": [\"CLI\", \"coverage\"],\n    \"source\": \"CLI\",\n    \"title\": \"coverage\",\n    \"type\": \"Documentation\"\n  },\n  {\n    \"objectID\": \"cli-custom-commands\",\n    \"headings\": [\n      \"Writing your own commands\",\n      \"Testing your plugin locally\",\n      \"Loading GraphQL Schema\",\n      \"Error Handling\"\n    ],\n    \"toc\": [\n      {\n        \"children\": [\n          {\n            \"children\": [\n              {\n                \"children\": [],\n                \"title\": \"Getting Started\",\n                \"anchor\": \"getting-started\"\n              }\n            ],\n            \"title\": \"TL;DR\",\n            \"anchor\": \"tldr\"\n          }\n        ],\n        \"title\": \"Writing your own commands\",\n        \"anchor\": \"writing-your-own-commands\"\n      },\n      {\n        \"children\": [],\n        \"title\": \"Testing your plugin locally\",\n        \"anchor\": \"testing-your-plugin-locally\"\n      },\n      {\n        \"children\": [],\n        \"title\": \"Loading GraphQL Schema\",\n        \"anchor\": \"loading-graphql-schema\"\n      },\n      {\n        \"children\": [],\n        \"title\": \"Error Handling\",\n        \"anchor\": \"error-handling\"\n      }\n    ],\n    \"content\": \"-\",\n    \"url\": \"https://www.graphql-cli.com/custom-commands\",\n    \"domain\": \"https://www.graphql-cli.com/\",\n    \"hierarchy\": [\"CLI\", \"Custom commands\"],\n    \"source\": \"CLI\",\n    \"title\": \"Custom commands\",\n    \"type\": \"Documentation\"\n  },\n  {\n    \"objectID\": \"cli-diff\",\n    \"headings\": [],\n    \"toc\": [],\n    \"content\": \"-\",\n    \"url\": \"https://www.graphql-cli.com/diff\",\n    \"domain\": \"https://www.graphql-cli.com/\",\n    \"hierarchy\": [\"CLI\", \"diff\"],\n    \"source\": \"CLI\",\n    \"title\": \"diff\",\n    \"type\": \"Documentation\"\n  },\n  {\n    \"objectID\": \"cli-discover\",\n    \"headings\": [],\n    \"toc\": [],\n    \"content\": \"-\",\n    \"url\": \"https://www.graphql-cli.com/discover\",\n    \"domain\": \"https://www.graphql-cli.com/\",\n    \"hierarchy\": [\"CLI\", \"discover\"],\n    \"source\": \"CLI\",\n    \"title\": \"discover\",\n    \"type\": \"Documentation\"\n  },\n  {\n    \"objectID\": \"cli-generate\",\n    \"headings\": [],\n    \"toc\": [],\n    \"content\": \"-\",\n    \"url\": \"https://www.graphql-cli.com/generate\",\n    \"domain\": \"https://www.graphql-cli.com/\",\n    \"hierarchy\": [\"CLI\", \"generate\"],\n    \"source\": \"CLI\",\n    \"title\": \"generate\",\n    \"type\": \"Documentation\"\n  },\n  {\n    \"objectID\": \"cli-init\",\n    \"headings\": [],\n    \"toc\": [],\n    \"content\": \"-\",\n    \"url\": \"https://www.graphql-cli.com/init\",\n    \"domain\": \"https://www.graphql-cli.com/\",\n    \"hierarchy\": [\"CLI\", \"init\"],\n    \"source\": \"CLI\",\n    \"title\": \"init\",\n    \"type\": \"Documentation\"\n  },\n  {\n    \"objectID\": \"cli-introduction\",\n    \"headings\": [],\n    \"toc\": [],\n    \"content\": \"-\",\n    \"url\": \"https://www.graphql-cli.com/introduction\",\n    \"domain\": \"https://www.graphql-cli.com/\",\n    \"hierarchy\": [\"CLI\", \"Introduction\"],\n    \"source\": \"CLI\",\n    \"title\": \"Introduction\",\n    \"type\": \"Documentation\"\n  },\n  {\n    \"objectID\": \"cli-introspect\",\n    \"headings\": [],\n    \"toc\": [],\n    \"content\": \"-\",\n    \"url\": \"https://www.graphql-cli.com/introspect\",\n    \"domain\": \"https://www.graphql-cli.com/\",\n    \"hierarchy\": [\"CLI\", \"introspect\"],\n    \"source\": \"CLI\",\n    \"title\": \"introspect\",\n    \"type\": \"Documentation\"\n  },\n  {\n    \"objectID\": \"cli-migration\",\n    \"headings\": [\"Migration from GraphQL CLI 3.x or older\"],\n    \"toc\": [\n      {\n        \"children\": [\n          {\n            \"children\": [\n              {\n                \"children\": [],\n                \"title\": \"Update your configuration file\",\n                \"anchor\": \"update-your-configuration-file\"\n              },\n              {\n                \"children\": [],\n                \"title\": \"Comparison of old commands\",\n                \"anchor\": \"comparison-of-old-commands\"\n              },\n              {\n                \"children\": [],\n                \"title\": \"Special Notes for Prisma users\",\n                \"anchor\": \"special-notes-for-prisma-users\"\n              }\n            ],\n            \"title\": \"Install the new version\",\n            \"anchor\": \"install-the-new-version\"\n          }\n        ],\n        \"title\": \"Migration from GraphQL CLI 3.x or older\",\n        \"anchor\": \"migration-from-graphql-cli-3x-or-older\"\n      }\n    ],\n    \"content\": \"-\",\n    \"url\": \"https://www.graphql-cli.com/migration\",\n    \"domain\": \"https://www.graphql-cli.com/\",\n    \"hierarchy\": [\"CLI\", \"Migration\"],\n    \"source\": \"CLI\",\n    \"title\": \"Migration\",\n    \"type\": \"Documentation\"\n  },\n  {\n    \"objectID\": \"cli-serve\",\n    \"headings\": [],\n    \"toc\": [],\n    \"content\": \"-\",\n    \"url\": \"https://www.graphql-cli.com/serve\",\n    \"domain\": \"https://www.graphql-cli.com/\",\n    \"hierarchy\": [\"CLI\", \"serve\"],\n    \"source\": \"CLI\",\n    \"title\": \"serve\",\n    \"type\": \"Documentation\"\n  },\n  {\n    \"objectID\": \"cli-similar\",\n    \"headings\": [],\n    \"toc\": [],\n    \"content\": \"-\",\n    \"url\": \"https://www.graphql-cli.com/similar\",\n    \"domain\": \"https://www.graphql-cli.com/\",\n    \"hierarchy\": [\"CLI\", \"similar\"],\n    \"source\": \"CLI\",\n    \"title\": \"similar\",\n    \"type\": \"Documentation\"\n  },\n  {\n    \"objectID\": \"cli-validate\",\n    \"headings\": [],\n    \"toc\": [],\n    \"content\": \"-\",\n    \"url\": \"https://www.graphql-cli.com/validate\",\n    \"domain\": \"https://www.graphql-cli.com/\",\n    \"hierarchy\": [\"CLI\", \"validate\"],\n    \"source\": \"CLI\",\n    \"title\": \"validate\",\n    \"type\": \"Documentation\"\n  }\n]\n"
  },
  {
    "path": "website/babel.config.js",
    "content": "module.exports = {\n  presets: [require.resolve('@docusaurus/core/lib/babel/preset')],\n};\n"
  },
  {
    "path": "website/docs/codegen.md",
    "content": "---\nid: codegen\ntitle: codegen\nsidebar_label: codegen\n---\n\nGenerate code from your GraphQL schema and operations. See the official [GraphQL Code Generator](https://graphql-code-generator.com/) site for complete documentation, guides and more.\n\n### Installation\n\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\n<Tabs\n  defaultValue=\"yarn\"\n  values={[\n    {label: 'yarn', value: 'yarn'},\n    {label: 'npm', value: 'npm'},\n  ]}\n>\n  <TabItem value=\"yarn\">\n\n  ```\n  yarn global add @graphql-cli/codegen\n  ```\n\n  </TabItem>\n\n  <TabItem value=\"npm\">\n\n  ```\n  npm i -g @graphql-cli/codegen\n  ```\n\n  </TabItem>\n</Tabs>\n\nNote: GraphQL Code Generator also utilizes a plugin system, so make sure you also install any plugins you include inside your configuration. See [here](https://graphql-code-generator.com/docs/plugins/index) for a list of plugins.\n\n### Example Configuration\n\n```yml\nschema:\n  - http://localhost:4000/graphql\nextensions:\n  codegen:\n    generates:\n      ./graphql.schema.json:\n        plugins:\n          - \"introspection\"\n```\n\nSee [the docs](https://graphql-code-generator.com/docs/getting-started/codegen-config) for more details.\n\n### Usage\n\n```\ngraphql codegen\n```\n\n#### Arguments\n\n*None*\n\n#### Options\n\n| option | alias | description | default |\n| --- | --- | --- | --- |\n| `--config` | `-c` | Path to GraphQL codegen YAML config file | `codegen.yml` or GraphQL configuration file in cwd |\n| `--watch` | `-w` | Watch for changes and execute generation automatically. You can also specify a glob expreession for custom watch list. |   |\n| `--require` | `-r` | Loads specific require.extensions before running the codegen and reading the configuration | `[]` |\n| `--overwrite` | `-o` | Overwrites existing files | `true` |\n| `--silent` | `-s` | Suppresses printing errors | `false` |\n| `--project` | `-p` | Name of a project in GraphQL Config | `undefined` |"
  },
  {
    "path": "website/docs/coverage.md",
    "content": "---\nid: coverage\ntitle: coverage\nsidebar_label: coverage\n---\n\nSchema coverage based on documents. Find out how many times types and fields are used in your application. See the [official GraphQL Inspector documentation](https://graphql-inspector.com/docs/essentials/coverage) for details.\n\n### Installation\n\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\n<Tabs\n  defaultValue=\"yarn\"\n  values={[\n    {label: 'yarn', value: 'yarn'},\n    {label: 'npm', value: 'npm'},\n  ]}\n>\n  <TabItem value=\"yarn\">\n\n  ```\n  yarn global add @graphql-cli/coverage\n  ```\n\n  </TabItem>\n\n  <TabItem value=\"npm\">\n\n  ```\n  npm i -g @graphql-cli/coverage\n  ```\n\n  </TabItem>\n</Tabs>\n\n### Usage\n\n```\ngraphql coverage [DOCUMENTS] [SCHEMA]\n```\n\n#### Arguments\n\n| argument | description | default |\n| --- | --- | --- |\n| `DOCUMENTS` | A glob pattern that points to GraphQL Documents / Operations | `documents` property in GraphQL Config file |\n| `SCHEMA` | A pointer to a schema | `schema` property in GraphQL Config file |\n\n#### Options\n\n| option | alias | description | default |\n| --- | --- | --- | --- |\n| `--silent` | `-s` | Do not render any stats in the terminal | `false` |\n| `--write` | `-w` | Write a file with coverage stats | disabled |\n| `--deprecated` | `-d` | Fail on deprecated usage | `false` |\n| `--require` | `-r` | Require a module | `[]` |\n| `--token` | `-t` | An access token | `undefined` |\n| `--header` | `-h` | Set HTTP header (`--header 'Auth: Basic 123'`) | `undefined` |\n"
  },
  {
    "path": "website/docs/custom-commands.md",
    "content": "---\nid: custom-commands\ntitle: Custom commands\nsidebar_label: Custom commands\n---\n\n## Writing your own commands\n\n`graphql-cli` allow you to write your own plugin/extenion, and intergrate external tools and configuration, and run it from a single CLI.\n\nThe current implementation of `graphql-cli` is using [Yargs](https://yargs.js.org/) to manage it's CLI commands.\n\nPlugins and extension are treated as NodeJS module by the `graphql-cli`, so it means you can use JavaScript/TypeScript/Any other super-set of JavaScript to write your extension. It means that you plugin will be loaded by it's name under `node_modules` - for example `graphql-cli my-custom-plugin ...`.\n\n`graphql-cli` also supports `graphql-config`, so it can help you easily load your GraphQL schema, operations and configuration from a unified config file.\n\n> If you are wrapping an existing tool that has it's own CLI already, consider to expose a programatic API so it will be easier to consume.\n\n### TL;DR\n\nWe have a ready-to-use boilerplate for that purpose, [you can find it here](https://github.com/dotansimha/graphql-cli-plugin-example).\n\nAlso, inside this repo, under `packages/commands` you can find a set of plugins implementation you can use as reference.\n\n### Getting Started\n\nStart by creating a simple JavaScript/TypeScript project, according to your preference. Install `@graphql-cli/common` package and use `defineCommand` utility in your entry point (usually `index` file):\n\n```ts\nimport { defineCommand } from '@graphql-cli/common';\n\nexport default defineCommand((api) => {\n  return {};\n});\n```\n\nTo register your CLI command, give it a name first. Use the `command` property:\n\n```ts\nexport default defineCommand((api) => {\n  return {\n    command: 'my-plugin',\n    async handler() {\n      // code here\n    },\n  };\n});\n```\n\nNow, your plugin will be avaiable to use with the following command: `graphql my-plugin`.\n\nYou can also add custom validations, flags, default values and much more with Yargs. [You can read the documentation here](https://yargs.js.org/docs/#api-commandcmd-desc-module).\n\n## Testing your plugin locally\n\nTo test your plugin locally, install `graphql-cli` in your project as a `devDependency`, and run the following command:\n\n```\ngraphql ./src/index.js\n```\n\nIf you registerd sub-commands, you should be able to run those this way:\n\n```\ngraphql ./src/index.js do-something\n```\n\n> The path should point to the entry point of your script, and if you are using TypeScript - point to the compile file.\n\n## Loading GraphQL Schema\n\nTo easily load GraphQL schema, you can use `graphql-config`:\n\n```ts\nimport { defineCommand } from '@graphql-cli/common';\n\nexport default defineCommand((api) => {\n  return {\n    command: 'my-plugin',\n    builder(build) {\n      return build.options({\n        project: {\n          type: 'string',\n          describe: 'Name of your project',\n        },\n      });\n    },\n    async handler(args) {\n      // use graphql-config and find configuration\n      const config = await api.useConfig();\n      // pick project\n      const project = args.project ? config.getProject(args.project) : config.getDefault();\n      // get schema\n      const schema = await config.getSchema();\n    },\n  };\n});\n```\n\nIf you are using `graphql-config` to define your configuration, and you wish to load your extenion config from it, do:\n\n```ts\ntype MyConfig = { ... };\n\nconst extensionConfig = await config.extension<MyConfig>('my-plugin');\n```\n\n## Error Handling\n\nIf you wish to fail the execution of your plugin and report it back to GraphQL CLI host, simply throw an error:\n\n```ts\nimport { defineCommand } from '@graphql-cli/common';\n\nexport default defineCommand(() => {\n  return {\n    command: 'check-if-missing',\n    handler() {\n      if (somethingIsMissing) {\n        throw new Error(`Ooops, something is missing`);\n      }\n    },\n  };\n});\n```\n"
  },
  {
    "path": "website/docs/diff.md",
    "content": "---\nid: diff\ntitle: diff\nsidebar_label: diff\n---\n\nDetect changes to your GraphQL Schema and prevent breaking your existing applications. See the [official GraphQL Inspector documentation](https://graphql-inspector.com/docs/essentials/diff) for details.\n\n### Installation\n\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\n<Tabs\n  defaultValue=\"yarn\"\n  values={[\n    {label: 'yarn', value: 'yarn'},\n    {label: 'npm', value: 'npm'},\n  ]}\n>\n  <TabItem value=\"yarn\">\n\n  ```\n  yarn global add @graphql-cli/diff\n  ```\n\n  </TabItem>\n\n  <TabItem value=\"npm\">\n\n  ```\n  npm i -g @graphql-cli/diff\n  ```\n\n  </TabItem>\n</Tabs>\n\n### Usage\n\n```\ngraphql diff [OLD_SCHEMA] [NEW_SCHEMA]\n```\n\n#### Arguments\n\n| argument | description | default |\n| --- | --- | --- |\n| `OLD_SCHEMA` | A pointer to the old schema | `extensions.diff.baseSchema` property in GraphQL Config file |\n| `NEW_SCHEMA` | A pointer to the new schema | `schema` property in GraphQL Config file |\n\n#### Options\n\n| option | alias | description | default |\n| --- | --- | --- | --- |\n| `--require` | `-r` | Require a module | `[]` |\n| `--token` | `-t` | An access token | `undefined` |\n| `--header` | `-h` | Set HTTP header (`--header 'Auth: Basic 123'`) | `undefined` |\n"
  },
  {
    "path": "website/docs/discover.md",
    "content": "---\nid: discover\ntitle: discover\nsidebar_label: discover\n---\n\nOpen a list of available plugins in your browser.\n\n### Installation\n\nThis command does not need to be installed.\n\n### Usage\n\n```\ngraphql discover\n```\n\n#### Arguments\n\n*None*\n\n#### Options\n\n*None*"
  },
  {
    "path": "website/docs/generate.md",
    "content": "---\nid: generate\ntitle: generate\nsidebar_label: generate\n---\n\nGenerate schema and client documents for your GraphQL project by using [Graphback](https://graphback.dev).\n\n### Installation\n\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\n<Tabs\n  defaultValue=\"yarn\"\n  values={[\n    {label: 'yarn', value: 'yarn'},\n    {label: 'npm', value: 'npm'},\n  ]}\n>\n  <TabItem value=\"yarn\">\n\n  ```\n  yarn global add @graphql-cli/generate\n  ```\n\n  </TabItem>\n\n  <TabItem value=\"npm\">\n\n  ```\n  npm i -g @graphql-cli/generate\n  ```\n\n  </TabItem>\n</Tabs>\n\n### Example Configuration\n\n```yml\nschema: './src/schema.graphql'\ndocuments: './client/src/graphql/**/*.graphql'\nextensions:\n  graphback:\n    model: './model/*.graphql'\n    plugins:\n      graphback-schema:\n        outputPath: './src/schema/schema.graphql'\n      graphback-client:\n        outputFile: './client/src/graphql/graphback.graphql'\n```\n\nSee [the docs](https://graphback.dev/docs/introduction) for more details.\n\n### Usage\n\n```\ngraphql generate\n```\n\n#### Arguments\n\n*None*\n\n#### Options\n\n| option | alias | description | default |\n| --- | --- | --- | --- |\n| `--watch` | `-w` | Watch for changes and execute generation automatically |   |\n| `--db` |   |   |   |\n| `--backend` |   |   |   |\n| `--silent` |   |   |   |\n"
  },
  {
    "path": "website/docs/init.md",
    "content": "---\nid: init\ntitle: init\nsidebar_label: init\n---\n\nCreate a GraphQL project using a template or GraphQL Config file for your existing project.\n\n### Installation\n\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\n<Tabs\n  defaultValue=\"yarn\"\n  values={[\n    {label: 'yarn', value: 'yarn'},\n    {label: 'npm', value: 'npm'},\n  ]}\n>\n  <TabItem value=\"yarn\">\n\n  ```\n  yarn global add @graphql-cli/init\n  ```\n\n  </TabItem>\n\n  <TabItem value=\"npm\">\n\n  ```\n  npm i -g @graphql-cli/init\n  ```\n\n  </TabItem>\n</Tabs>\n\nNote: Because you probably won't need to run this command again after bootstrapping your project, you can also run it using `npx` instead of installing the package: `npx graphql init`.\n\n### Usage\n\n```\ngraphql init\n```\n\nFollow the prompts to set up your project.\n\n#### Arguments\n\n*None*\n\n#### Options\n\n| option | alias | description | default |\n| --- | --- | --- | --- |\n| `--projectName` |   | Name of a project in GraphQL Config | `undefined` |\n| `--templateName` |   | Name of one of the predefined templates | `undefined` |\n| `--templateUrl` |   | GitHub URL of the template. For example http://github.com/example/graphql-cli-example-template | `undefined` |"
  },
  {
    "path": "website/docs/introduction.md",
    "content": "---\nid: introduction\ntitle: Introduction\nsidebar_label: Introduction\n---\n\n![GraphQL CLI](https://user-images.githubusercontent.com/20847995/67651234-85bf1500-f916-11e9-90e5-cb3bd0e6a338.png)\n\n### Features\n\n* Helpful commands to improve your workflows\n* Compatible with editors and IDEs based on [graphql-config](https://www.graphql-config.com)\n* Powerful plugin system to extend graphql-cli with custom commands\n\n### Installation\n\nRun the following command to install GraphQL CLI globally:\n\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\n<Tabs\n  defaultValue=\"yarn\"\n  values={[\n    {label: 'yarn', value: 'yarn'},\n    {label: 'npm', value: 'npm'},\n  ]}\n>\n  <TabItem value=\"yarn\">\n\n  ```\n  yarn global add graphql-cli graphql\n  ```\n\n  </TabItem>\n\n  <TabItem value=\"npm\">\n\n  ```\n  npm i -g graphql-cli graphql\n  ```\n\n  </TabItem>\n</Tabs>\n\n### Configuration \n\nGraphQL CLI utilizes GraphQL Config for its configuration. You can learn more about GraphQL Config [here](https://www.graphql-config.com). The easiest way to get started is to run `init` command from your desired workspace:\n\n```\nnpx graphql-cli init\n```\n\nAfter a series of questions from the command-prompt, the command will use the inputs and selected project templates to generate your configuration file for you. You can also write your own configuration file using an editor of your choice. For example, you could create a `.graphqlrc.yml` file with the following content:\n\n```\nschema: \"server/src/schema/**/*.graphql\"\ndocuments: \"client/src/documents/**/*.graphql\"\n```\n\nIf you can run the `init` command with an existing file like the one above, its contents will be included with inputs you provide.\n\n### Commands\n\nEach command in GraphQL CLI is treated as a plugin. In order to use the command, you have to install it first. Each command's package name follows this pattern: `@graphql-cli/[COMMAND-NAME]`. So to install the `init` command we used above, we would run\n\n<Tabs\n  defaultValue=\"yarn\"\n  values={[\n    {label: 'yarn', value: 'yarn'},\n    {label: 'npm', value: 'npm'},\n  ]}\n>\n  <TabItem value=\"yarn\">\n\n  ```\n  yarn global add @graphql-cli/init\n  ```\n\n  </TabItem>\n\n  <TabItem value=\"npm\">\n\n  ```\n  npm i -g @graphql-cli/init\n  ```\n\n  </TabItem>\n</Tabs>\n\nAfter installing the command, we can then run it like this:\n\n```\ngraphql init\n```\n\nEach command can be configured by updating the `extensions` field in your configuration file (`.graphqlrc.yml`). For example, if we install the `codegen` command, we can provide additional options to it like this:\n\n```yml\nschema: \n  ./server/src/schema/**/*.ts:\n    require: ts-node/register\ndocuments: ./client/src/graphql/**/*.ts\nextensions:\n  codegen:\n    generates:\n      ./server/src/generated-types.d.ts:\n        plugins:\n          - typescript\n          - typescript-resolvers\n      ./client/src/generated-types.tsx:\n        plugins:\n          - typescript\n          - typescript-operations\n          - typescript-react-apollo\n```\n\nYou can learn more about each command by navigating to its page from the menu. You can also write your own commands; see [this guide](custom-commands) for a detailed explanation.\n\n:::tip\nNote: You can execute the command `graphql discover` to open a list of GraphQL CLI plugins you can still. This is the only command that is available without installing additional packages.\n:::\n"
  },
  {
    "path": "website/docs/introspect.md",
    "content": "---\nid: introspect\ntitle: introspect\nsidebar_label: introspect\n---\n\nDumps an introspection file based on a schema. See the [official GraphQL Inspector documentation](https://graphql-inspector.com/docs/essentials/introspect) for details.\n\n### Installation\n\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\n<Tabs\n  defaultValue=\"yarn\"\n  values={[\n    {label: 'yarn', value: 'yarn'},\n    {label: 'npm', value: 'npm'},\n  ]}\n>\n  <TabItem value=\"yarn\">\n\n  ```\n  yarn global add @graphql-cli/introspect\n  ```\n\n  </TabItem>\n\n  <TabItem value=\"npm\">\n\n  ```\n  npm i -g @graphql-cli/introspect\n  ```\n\n  </TabItem>\n</Tabs>\n\n### Usage\n\n```\ngraphql introspect [SCHEMA]\n```\n\n#### Arguments\n\n| argument | description | default |\n| --- | --- | --- |\n| `SCHEMA` | A pointer to a schema | `schema` property in GraphQL Config file |\n\n#### Options\n\n| option | alias | description | default |\n| --- | --- | --- | --- |\n| `--write` | `-w` | Overwrite the output | `graphql.schema.json` |\n| `--require` | `-r` | Require a module | `[]` |\n| `--token` | `-t` | An access token | `undefined` |\n| `--header` | `-h` | Set HTTP header (`--header 'Auth: Basic 123'`) | `undefined` |\n"
  },
  {
    "path": "website/docs/migration.md",
    "content": "---\nid: migration\ntitle: Migration\nsidebar_label: Migration\n---\n\n## Migration from GraphQL CLI 3.x or older\n\nStarting with GraphQL CLI 4.0 and higher, the way projects are set up is significantly restructured.\n\n### Install the new version\nTo get started, install the new version:\n```sh\nyarn global add graphql-cli\n```\nYou can also globally install using npm.\n\n> NOTE: If you have previous version of the GraphQL-CLI installed make sure to uninstall it first\n\n```bash\nnpm uninstall graphql-cli\n```\n\n### Update your configuration file\nIf you are working from an existing project, the GraphQL Config file that is used by GraphQL CLI is now called `.graphqlrc.yml` (by default) instead of `.graphqlconfig`. [Other options exist](https://graphql-config.com/usage) for naming the config files supported by GraphQL CLI, but this guide will assume you're using YAML syntax.\n\nTo migrate, you will first need to update your GraphQL Configuration file to match GraphQL Config's updated syntax and structure.\n\nYou can [check here](https://graphql-config.com/usage) for more information about the new structure.\n\n####Specifying schema(s):\n\n```yml\nschema: ./src/schema/**/*.graphql #You can have URL endpoint, Git URL and local files using globs here.\n```\n\n`schemaPath` is replaced by `schema`, which is now more flexible then the previous approach. This field is used by all commands and plugins of GraphQL CLI.\n\n### Comparison of old commands\n\n#### `get-schema` is no longer available\nIn previous versions, you were able to download the schema to the given path in `schemaPath` from the URL given inside `endpoint`. In the new version, `schema` refers to the endpoint of the schema.\n\nIf you use Prisma or any other tool that provides your schema under URL endpoint, you must to specify it using the following syntax in your configuration YAML:\n\n```yaml\nschema: http://localhost:4000/graphql #This is the schema path\n```\n\nIf you want to download the schema from this URL to your local file system, you will also need to install `codegen` plugin and its `schema-ast` plugin using the following command or its npm equivalent:\n\n```bash\nyarn add @graphql-cli/codegen @graphql-codegen/schema-ast --dev\n```\n\nAfter that, you can specify the output path of the local schema file:\n\n```yaml\nschema: http://localhost:4000/graphql\nextensions:\n  codegen:\n    generates:\n      ./schema.graphql:\n        plugins:\n          - schema-ast\n```\n\nBy running `graphql codegen`, the `schema.graphql` file is generated in the root path of your project.\n\n##### For JSON Output\nIf you want to download the schema as a `json` introspection file, you will need to install `@graphql-codegen/introspection` instead, and add `introspection` instead of `schema-ast`.\n\n```yaml\nschema: http://localhost:4000/graphql\nextensions:\n  codegen:\n    generates:\n      ./schema.json:\n        plugins:\n          - introspection\n```\n\n#### `create` is no longer available: it is replaced by the `init` command.\nIf you want to create a GraphQL Config file on an existing project or create a project using a template from scratch, you can use `graphql init` command.\nThis command will ask some questions about your new or existing project to update your dependencies and create a new configuration file for GraphQL CLI.\n\n#### `diff` has been changed\nIf you want to see the differences between your schema and another schema, use the `diff` command as follows:\n```yaml\ngraphql diff git:origin/master:schema.graphql\n```\nFor example, `diff` will show the differences between the version in `schema` field of GraphQL Configuration file and the `schema.graphql` file in the remote master branch.\n\nAlternatively, you can compare `schema` with a URL endpoint:\n```yaml\ngraphql diff http://my-dev-instance.com/graphql\n```\n\n#### `add-endpoint`, `add-project`, `schema-status`, `ping`, `query`, `prepare`, `lint` and `playground` commands are no longer available.\nGraphQL CLI (as well as GraphQL Config) no longer separates `endpoints` and `schemaPath`. The new `schema` field refers to the single endpoint of your GraphQL schema, so it can be a URL endpoint or a local file. If your project uses a remote schema, you can directly define this URL in `schema` path without downloading it or defining it as an extra `endpoint` etc.\n\nInstead of using these legacy commands, you can create a faked server to test your schema using the `yarn serve` command.\n\n#### `codegen` now uses GraphQL Code Generator\nGraphQL CLI now uses GraphQL Code Generator which has a lot of plugins and templates for various environments, platforms and use cases. You can generate resolver signatures, TypeScript representations of your GraphQL Schema and more. [Check it out](https://graphql-code-generator.com/)\n\nThe usage is slightly different from the old one:\n```yaml\nschema: src/schema/**/*.graphql\nextensions:\n    codegen:\n        src/generated-types.ts: # Output file name\n            - typescript # Plugin names to be used\n            - typescript-resolvers\n```\n\nFor instance, consider a hypothetical case where you need to generate TypeScript resolvers signatures for your GraphQL project. To do this, you would install the `codegen` plugin and the additional plugins and templates for GraphQL Code Generator. For this case, you would need `typescript` and `typescript-resolvers` plugins:\n\n```bash\nyarn add @graphql-cli/codegen @graphql-codegen/typescript @graphql-codegen/typescript-resolvers --dev\n```\n\nNow, using a single command, you can run GraphQL Code Generator using GraphQL CLI:\n```bash\ngraphql codegen\n```\n\n### Special Notes for Prisma users\nPrisma users will need to download a schema from a URL endpoint. For example, here is a *legacy GraphQL Config file* doing this:\n\n`.graphqlconfig`\n```yaml\nprojects:\n  app:\n    schemaPath: src/schema.graphql\n    extensions:\n      endpoints:\n        default: http://localhost:4000\n  database:\n    schemaPath: src/generated/prisma-client/prisma.graphql\n    extensions:\n      prisma: prisma/prisma.yml\n```\n\n**To update the configuration for the new GraphQL CLI** you need to rename the file to `.graphqlrc.yml`, and then update the file as follows:\n\n`.graphqlrc.yml`\n```yaml\nprojects:\n  app:\n    schema: src/schema.graphql\n  database:\n    schema: prisma/prisma.yml\n    extensions:\n      codegen:\n        generates:\n          ./src/generated/prisma-client/prisma.graphql:\n            plugins:\n              - schema-ast\n```\n\nYou can directly point to your `prisma.yml` file instead of the URL endpoint.\n\nBefore running the GraphQL CLI command to use this new configuration, make sure you have installed the `@graphql-cli/codegen` and `@graphql-codegen/schema-ast` plugins using:\n```sh\nyarn add @graphql-cli/codegen @graphql-codegen/schema-ast --dev\n```\n\nNow you can run `graphql codegen --project database` for generating your `prisma.graphql` file.\n\nYou will also need to update your `prisma.yml` file if you're using `graphql get-schema` with Prisma:\n```yaml\n...\n## Ensures Prisma client is re-generated after a datamodel change.\nhooks:\n  post-deploy:\n    - graphql codegen --project database # instead of graphql get-schema\n    - prisma generate\n```\n"
  },
  {
    "path": "website/docs/serve.md",
    "content": "---\nid: serve\ntitle: serve\nsidebar_label: serve\n---\n\nServes a full featured [GraphQL CRUD](https://graphqlcrud.org/) API with subscriptions and data synchronization running in just a few seconds without writing a single line of code - all you need is a data model `.graphql` file.\n\nGraphQL Serve is a CLI tool that leverages the power of Graphback to generate a codeless Node.js GraphQL API complete with schema and CRUD resolvers and an in-memory MongoDB database.  \n\n### Installation\n\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\n<Tabs\n  defaultValue=\"yarn\"\n  values={[\n    {label: 'yarn', value: 'yarn'},\n    {label: 'npm', value: 'npm'},\n  ]}\n>\n  <TabItem value=\"yarn\">\n\n  ```\n  yarn global add @graphql-cli/serve\n  ```\n\n  </TabItem>\n\n  <TabItem value=\"npm\">\n\n  ```\n  npm i -g @graphql-cli/serve\n  ```\n\n  </TabItem>\n</Tabs>\n\n### Usage\n\nThe bare minimum you need is a GraphQL file with your data models. Create a file called `Note.graphql` and add the following:\n\n```graphql\n\"\"\" @model \"\"\"\ntype Note {\n  _id: GraphbackObjectID!\n  title: String!\n  description: String\n  likes: Int\n}\n\nscalar GraphbackObjectID\n```\n\nThe `@model` annotation indicates that `Note` is a data model and Graphback will generate resolvers, a CRUD service and data source for it. You can learn how to build more complex data models in [Data Model](https://graphback.dev/docs/model/datamodel#model).\n\n#### Running your codeless GraphQL server\n\nTo start your server, run the following command from the same directory as `Note.graphql`:\n\n```bash\ngraphql serve Note.graphql\n```\n\nThis will start a GraphQL server on a random port using the `Note.graphql` data models we just added.\n\nYou can customise the directory of the data models:\n\n```bash\ngraphql serve ./path/to/models\n```\n\nYou can also specify where to load the data models from with a Glob pattern:\n\n```bash\ngraphql serve ./schema/**/*.graphql\n```\n\nYou can specify which port to start the server on:\n\n```bash\n$ graphql serve ./path/to/models --port 8080\n\nStarting server...\n\nListening at: http://localhost:8080/graphql\n```\n\n### Enable Data Synchronization\n\nGraphQL Serve can also operate on data sync models. Under the hood this uses the [Data Sync](https://graphback.dev/docs/datasync/intro) package. \nTo enable data synchronization, all we need to do is enable datasync capabilities on our models via the `@datasync` annotation.\n\nFor the `Note` model defined above, this would look like: \n\n```graphql\n\"\"\" \n@model\n@datasync \n\"\"\"\ntype Note {\n  _id: GraphbackObjectID!\n  title: String!\n  description: String\n  likes: Int\n}\n\nscalar GraphbackObjectID\n```\n\nOnce we have a model with datasync capabilities, we can run our GraphQL server by enabling data synchronization as shown below:\n\n```bash\ngraphql serve Note.graphql --datasync\n```\n\nConflict resolution strategies for datasync enabled models can be specified via the --conflict option:\n\n```bash\ngraphql serve Note.graphql --datasync --conflict=clientSideWins\n```\n\nThis defaults to ClientSideWins, if unset.\n\nThe TTL for delta tables, can also be set using the --deltaTTL option:\n\n```bash\ngraphql serve Note.graphql --datasync --deltaTTL=172800\n```\n\nThis value defaults to `172800` when unused\n \n\n#### Arguments\n\n| argument | description | default |\n| --- | --- | --- |\n| `Model` | Directory to search for data models | `undefined` |\n\n#### Options\n\n| option | alias | description | default |\n| --- | --- | --- | --- |\n| `--port` | `-p` | Port on which to run the HTTP server | `Random port` |\n| `--datasync` | `--ds` | Enable datasynchronization features | `false` |\n| `--deltaTTL` | N/A | Specify a conflict resolution strategy with --datasync. Choices: `clientSideWins`, `serverSideWins`, `throwOnConflict` | `clientSideWins` |\n| `--conflict` | N/A | Specify a TTL for delta tables with --datasync | `172800` |\n\n\n"
  },
  {
    "path": "website/docs/similar.md",
    "content": "---\nid: similar\ntitle: similar\nsidebar_label: similar\n---\n\nGet a list of similar types in order to find duplicates. See the [official GraphQL Inspector documentation](https://graphql-inspector.com/docs/essentials/similar) for details.\n\n### Installation\n\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\n<Tabs\n  defaultValue=\"yarn\"\n  values={[\n    {label: 'yarn', value: 'yarn'},\n    {label: 'npm', value: 'npm'},\n  ]}\n>\n  <TabItem value=\"yarn\">\n\n  ```\n  yarn global add @graphql-cli/similar\n  ```\n\n  </TabItem>\n\n  <TabItem value=\"npm\">\n\n  ```\n  npm i -g @graphql-cli/similar\n  ```\n\n  </TabItem>\n</Tabs>\n\n### Usage\n\n```\ngraphql similar [SCHEMA]\n```\n\n#### Arguments\n\n| argument | description | default |\n| --- | --- | --- |\n| `SCHEMA` | A pointer to a schema | `schema` property in GraphQL Config file |\n\n#### Options\n\n| option | alias | description | default |\n| --- | --- | --- | --- |\n| `--type` | `-n` | Check only a single type | all types |\n| `--threshold` | `-t` | Threshold of similarity ratio | `0.4` |\n| `--write` | `-w` | Write a file with results | disabled |\n| `--require` | `-r` | Require a module | `[]` |\n| `--token` | `-t` | An access token | `undefined` |\n| `--header` | `-h` | Set HTTP header (`--header 'Auth: Basic 123'`) | `undefined` |\n"
  },
  {
    "path": "website/docs/validate.md",
    "content": "---\nid: validate\ntitle: validate\nsidebar_label: validate\n---\n\nValidates documents against a schema and looks for deprecated usage.. See the [official GraphQL Inspector documentation](https://graphql-inspector.com/docs/essentials/validate) for details.\n\n### Installation\n\nimport Tabs from '@theme/Tabs';\nimport TabItem from '@theme/TabItem';\n\n<Tabs\n  defaultValue=\"yarn\"\n  values={[\n    {label: 'yarn', value: 'yarn'},\n    {label: 'npm', value: 'npm'},\n  ]}\n>\n  <TabItem value=\"yarn\">\n\n  ```\n  yarn global add @graphql-cli/validate\n  ```\n\n  </TabItem>\n\n  <TabItem value=\"npm\">\n\n  ```\n  npm i -g @graphql-cli/validate\n  ```\n\n  </TabItem>\n</Tabs>\n\n### Usage\n\n```\ngraphql validate [DOCUMENTS] [SCHEMA]\n```\n\n#### Arguments\n\n| argument | description | default |\n| --- | --- | --- |\n| `DOCUMENTS` | A glob pattern that points to GraphQL Documents / Operations | `documents` property in GraphQL Config file |\n| `SCHEMA` | A pointer to a schema | `schema` property in GraphQL Config file |\n\n#### Options\n\n| option | alias | description | default |\n| --- | --- | --- | --- |\n| `--deprecated` | `-d` | Fail on deprecated usage | `false` |\n| `--noStrictFragments` |   | Do not fail on duplicated fragment names | `false` |\n| `--apollo` |   | Support Apollo directives (@client and @connection) | `false` |\n| `--keepClientFields` |   | Keeps the fields with @client, but removes @client directive from them - works only with combination of `--apollo` | `false` |\n| `--maxDepth` |   | Fail when operation depth exceeds maximum depth  | `undefined` |\n| `--require` | `-r` | Require a module | `[]` |\n| `--token` | `-t` | An access token | `undefined` |\n| `--header` | `-h` | Set HTTP header (`--header 'Auth: Basic 123'`) | `undefined` |\n"
  },
  {
    "path": "website/docusaurus.config.js",
    "content": "module.exports = {\n  title: 'GraphQL CLI',\n  tagline: '📟 Command line tool for common GraphQL development workflows',\n\n  url: 'https://graphql-cli.com',\n  baseUrl: '/',\n  favicon: 'img/logo.ico',\n\n  organizationName: 'urigo',\n  projectName: 'graphql-cli',\n\n  themeConfig: {\n    colorMode: {\n      disableSwitch: true,\n    },\n    image: 'img/logo.png',\n    navbar: {\n      title: 'GraphQL CLI',\n      logo: {\n        alt: 'GraphQL CLI Logo',\n        src: 'img/logo.png',\n      },\n      items: [\n        {\n          to: '/introduction',\n          label: 'Documentation',\n          position: 'right',\n        },\n        {\n          href: 'https://github.com/urigo/graphql-cli',\n          label: 'GitHub',\n          position: 'right',\n        },\n      ],\n    },\n    footer: {\n      style: 'dark',\n      copyright: `Copyright © ${new Date().getFullYear()} The Guild. All rights reserved.`,\n      links: [\n        {\n          title: 'Docs',\n          items: [\n            {\n              label: 'Introduction',\n              to: 'introduction',\n            },\n          ],\n        },\n        {\n          title: 'Community',\n          items: [\n            {\n              label: 'Discord',\n              href: 'https://discord.gg/xud7bH9',\n            },\n            {\n              label: 'Other projects',\n              href: 'https://github.com/the-guild-org/Stack',\n            },\n            {\n              label: 'Mailing List',\n              href: 'https://upscri.be/19qjhi',\n            },\n            {\n              label: 'Community Meetings',\n              href: 'https://github.com/the-guild-org/community-meetings',\n            },\n          ],\n        },\n        {\n          title: 'Social',\n          items: [\n            {\n              label: 'Blog',\n              href: 'https://the-guild.dev/blog',\n            },\n            {\n              label: 'GitHub',\n              href: 'https://github.com/urigo/graphql-cli',\n            },\n            {\n              label: 'Twitter',\n              href: 'https://twitter.com/TheGuildDev',\n            },\n            {\n              label: 'LinkedIn',\n              href: 'https://www.linkedin.com/company/the-guild-software',\n            },\n          ],\n        },\n      ],\n    },\n    prism: {\n      theme: require('prism-react-renderer/themes/dracula'),\n    },\n  },\n  scripts: ['/js/light-mode-by-default.js'],\n  customFields: {\n    algolia: {\n      appId: process.env.NEXT_PUBLIC_ALGOLIA_APP_ID,\n      searchApiKey: process.env.NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY,\n      indexName: process.env.NEXT_PUBLIC_ALGOLIA_INDEX_NAME,\n    },\n  },\n  presets: [\n    [\n      require.resolve('@docusaurus/preset-classic'),\n      {\n        docs: {\n          path: 'docs',\n          routeBasePath: '/',\n          include: ['**/*.md', '**/*.mdx'],\n          sidebarPath: require.resolve('./sidebars.js'),\n          editUrl: 'https://github.com/urigo/graphql-cli/edit/master/website/',\n        },\n        theme: {\n          customCss: require.resolve('./src/css/custom.css'),\n        },\n        sitemap: {\n          // cacheTime: 600 * 1001, // 600 sec - cache purge period\n          changefreq: 'weekly',\n          priority: 0.5,\n        },\n      },\n    ],\n  ],\n};\n"
  },
  {
    "path": "website/package.json",
    "content": "{\n  \"name\": \"website\",\n  \"version\": \"4.1.0\",\n  \"private\": true,\n  \"scripts\": {\n    \"start\": \"docusaurus start\",\n    \"build\": \"docusaurus build\",\n    \"swizzle\": \"docusaurus swizzle\",\n    \"deploy\": \"docusaurus deploy\",\n    \"algolia-sync\": \"ts-node scripts/algolia-ci.ts\"\n  },\n  \"dependencies\": {\n    \"@docusaurus/core\": \"^2.0.0-beta.0\",\n    \"@guild-docs/algolia\": \"0.0.6-alpha-1bcf597.0\",\n    \"@docusaurus/preset-classic\": \"^2.0.0-beta.0\",\n    \"clsx\": \"^1.1.1\",\n    \"react\": \"^17.0.0\",\n    \"react-dom\": \"^17.0.0\",\n    \"styled-components\": \"5.3.3\",\n    \"the-guild-components\": \"1.5.3\"\n  },\n  \"browserslist\": {\n    \"production\": [\n      \">0.2%\",\n      \"not dead\",\n      \"not op_mini all\"\n    ],\n    \"development\": [\n      \"last 1 chrome version\",\n      \"last 1 firefox version\",\n      \"last 1 safari version\"\n    ]\n  }\n}"
  },
  {
    "path": "website/scripts/algolia-ci.ts",
    "content": "import { indexToAlgolia } from '@guild-docs/algolia';\nimport { resolve } from 'path';\nimport * as sidebars from '../sidebars';\n\nindexToAlgolia({\n  docusaurus: {\n    sidebars,\n  },\n  // needed because GraphQL CLI has a weird routing config with content at `/`\n  postProcessor: (objects) =>\n    objects.map((o) => ({\n      ...o,\n      url: o.url.replace('docs/', ''),\n    })),\n  source: 'CLI',\n  domain: process.env.SITE_URL!,\n  lockfilePath: resolve(__dirname, '../algolia-lockfile.json'),\n  dryMode: process.env.ALGOLIA_DRY_RUN === 'true',\n});\n"
  },
  {
    "path": "website/sidebars.js",
    "content": "module.exports = {\n  docs: {\n    'Getting Started': [\n      'introduction',\n    ],\n    'Commands': [\n      'codegen',\n      'coverage',\n      'diff',\n      'discover',\n      'generate',\n      'init',\n      'introspect',\n      'serve',\n      'similar',\n      'validate',\n    ],\n    'Recipes': [\n      'migration',\n      'custom-commands',\n    ],\n  },\n};\n"
  },
  {
    "path": "website/src/css/custom.css",
    "content": ":root {\n  --ifm-color-primary: #8c0082;\n  --ifm-color-primary-dark: #8c0082;\n  --ifm-color-primary-darker: #8c0082;\n  --ifm-color-primary-darkest: #8c0082;\n  --ifm-color-primary-light: #8c0082;\n  --ifm-color-primary-lighter: #8c0082;\n  --ifm-color-primary-lightest: #8c0082;\n\n  --ifm-color-secondary: #bfc7d5;\n  --ifm-footer-link-hover-color: #fff;\n}\n\na {\n  transition: all 0.2s ease 0s;\n}\n\nbutton {\n  --ifm-color-content: #fff;\n}\n\ntd > code {\n  white-space: nowrap;\n}"
  },
  {
    "path": "website/src/pages/index.js",
    "content": "import React from 'react';\nimport {Redirect} from '@docusaurus/router';\n\nfunction Home() {\n  return <Redirect to=\"/introduction\" />;\n}\n\nexport default Home;\n"
  },
  {
    "path": "website/src/pages/styles.module.css",
    "content": "/* stylelint-disable docusaurus/copyright-header */\n/**\n * CSS files with the .module.css suffix will be treated as CSS modules\n * and scoped locally.\n */\n\n.heroBanner {\n  padding: 4rem 0;\n  text-align: center;\n  position: relative;\n  overflow: hidden;\n}\n\n@media screen and (max-width: 966px) {\n  .heroBanner {\n    padding: 2rem;\n  }\n}\n\n.buttons {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.features {\n  display: flex;\n  align-items: center;\n  padding: 2rem 0;\n  width: 100%;\n}\n\n.featureImage {\n  height: 200px;\n  width: 200px;\n}\n"
  },
  {
    "path": "website/src/theme/Root.js",
    "content": "import React from 'react';\nimport BrowserOnly from '@docusaurus/BrowserOnly';\nimport { ThemeProvider, Header } from 'the-guild-components';\n\n// Default implementation, that you can customize\nfunction Root({ children }) {\n  return (\n    <>\n      <BrowserOnly>\n        {() => (\n          <ThemeProvider>\n            <Header themeSwitch activeLink={'/open-source'} accentColor=\"var(--ifm-color-primary)\" />\n          </ThemeProvider>\n        )}\n      </BrowserOnly>\n      {children}\n    </>\n  );\n}\n\nexport default Root;\n"
  },
  {
    "path": "website/static/CNAME",
    "content": "www.graphql-cli.com\n"
  },
  {
    "path": "website/static/js/light-mode-by-default.js",
    "content": "if (!localStorage.getItem('theme')) {\n  localStorage.setItem('theme', 'light')\n}"
  }
]