[
  {
    "path": ".devcontainer/Dockerfile",
    "content": "# Update VARIANT in devcontainer.json to pick a Dart version\nARG VARIANT=2\nFROM google/dart:${VARIANT}\n\n# [Option] Install zsh\nARG INSTALL_ZSH=\"true\"\n# [Option] Upgrade OS packages to their latest versions\nARG UPGRADE_PACKAGES=\"false\"\n\n# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.\nARG USERNAME=vscode\nARG USER_UID=1000\nARG USER_GID=$USER_UID\nCOPY library-scripts/*.sh /tmp/library-scripts/\nRUN apt-get update \\\n    && /bin/bash /tmp/library-scripts/common-debian.sh \"${INSTALL_ZSH}\" \"${USERNAME}\" \"${USER_UID}\" \"${USER_GID}\" \"${UPGRADE_PACKAGES}\" \\\n    && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts\n\n# Add bin location to path\nENV PUB_CACHE=\"/usr/local/share/pub-cache\"\nENV PATH=\"${PATH}:${PUB_CACHE}/bin\"\nRUN mkdir -p ${PUB_CACHE} \\\n    && chown ${USERNAME}:root ${PUB_CACHE} \\\n    && echo \"if [ \\\"\\$(stat -c '%U' ${PUB_CACHE})\\\" != \\\"${USERNAME}\\\" ]; then sudo chown -R ${USER_UID}:root ${PUB_CACHE}; fi\" \\\n    | tee -a /root/.bashrc /root/.zshrc /home/${USERNAME}/.bashrc >> /home/${USERNAME}/.zshrc\n\n# [Optional] Uncomment this section to install additional OS packages.\n# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \\\n#     && apt-get -y install --no-install-recommends <your-package-list-here>"
  },
  {
    "path": ".devcontainer/devcontainer.json",
    "content": "{\n\t\"name\": \"Dart\",\n\t\"build\": {\n\t\t\"dockerfile\": \"Dockerfile\",\n\t\t// Update VARIANT to pick a Dart version\n\t\t\"args\": {\n\t\t\t\"VARIANT\": \"2\",\n\t\t},\n\t},\n\t// Set *default* container specific settings.json values on container create.\n\t\"settings\": {\n\t\t\"editor.formatOnSave\": true,\n\t\t\"terminal.integrated.shell.linux\": \"/usr/bin/zsh\",\n\t\t\"editor.fontLigatures\": true,\n\t\t\"workbench.colorTheme\": \"Default Dark+\",\n\t\t\"editor.fontFamily\": \"'Jetbrains Mono', Menlo, Monaco, 'Courier New', monospace\",\n\t},\n\t// Add the IDs of extensions you want installed when the container is created.\n\t\"extensions\": [\n\t\t\"dart-code.dart-code\",\n\t\t\"dart-code.flutter\",\n\t\t\"redhat.vscode-yaml\",\n\t\t\"luanpotter.dart-import\",\n\t\t\"jeroen-meijer.pubspec-assist\",\n\t\t\"kumar-harsh.graphql-for-vscode\",\n\t],\n\t// Use 'forwardPorts' to make a list of ports inside the container available locally.\n\t// \"forwardPorts\": [],\n\t// Use 'postCreateCommand' to run commands after the container is created.\n\t// \"postCreateCommand\": \"uname -a\",\n\t// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.\n\t// \"remoteUser\": \"vscode\"\n}"
  },
  {
    "path": ".devcontainer/library-scripts/README.md",
    "content": "# Warning: Folder contents may be replaced\n\nThe contents of this folder will be automatically replaced with a file of the same name in the [vscode-dev-containers](https://github.com/microsoft/vscode-dev-containers) repository's [script-library folder](https://github.com/microsoft/vscode-dev-containers/tree/master/script-library) whenever the repository is packaged.\n\nTo retain your edits, move the file to a different location. You may also delete the files if they are not needed."
  },
  {
    "path": ".devcontainer/library-scripts/common-debian.sh",
    "content": "#!/usr/bin/env bash\n#-------------------------------------------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.\n#-------------------------------------------------------------------------------------------------------------\n#\n# Docs: https://github.com/microsoft/vscode-dev-containers/blob/master/script-library/docs/common.md\n#\n# Syntax: ./common-debian.sh [install zsh flag] [username] [user UID] [user GID] [upgrade packages flag] [install Oh My *! flag]\n\nINSTALL_ZSH=${1:-\"true\"}\nUSERNAME=${2:-\"automatic\"}\nUSER_UID=${3:-\"automatic\"}\nUSER_GID=${4:-\"automatic\"}\nUPGRADE_PACKAGES=${5:-\"true\"}\nINSTALL_OH_MYS=${6:-\"true\"}\n\nset -e\n\nif [ \"$(id -u)\" -ne 0 ]; then\n    echo -e 'Script must be run as root. Use sudo, su, or add \"USER root\" to your Dockerfile before running this script.'\n    exit 1\nfi\n\n# If in automatic mode, determine if a user already exists, if not use vscode\nif [ \"${USERNAME}\" = \"auto\" ] || [ \"${USERNAME}\" = \"automatic\" ]; then\n    USERNAME=\"\"\n    POSSIBLE_USERS=(\"vscode\" \"node\" \"codespace\" \"$(awk -v val=1000 -F \":\" '$3==val{print $1}' /etc/passwd)\")\n    for CURRENT_USER in ${POSSIBLE_USERS[@]}; do\n        if id -u ${CURRENT_USER} > /dev/null 2>&1; then\n            USERNAME=${CURRENT_USER}\n            break\n        fi\n    done\n    if [ \"${USERNAME}\" = \"\" ]; then\n        USERNAME=vscode\n    fi\nelif [ \"${USERNAME}\" = \"none\" ]; then\n    USERNAME=root\n    USER_UID=0\n    USER_GID=0\nfi\n\n# Load markers to see which steps have already run\nMARKER_FILE=\"/usr/local/etc/vscode-dev-containers/common\"\nif [ -f \"${MARKER_FILE}\" ]; then\n    echo \"Marker file found:\"\n    cat \"${MARKER_FILE}\"\n    source \"${MARKER_FILE}\"\nfi\n\n# Ensure apt is in non-interactive to avoid prompts\nexport DEBIAN_FRONTEND=noninteractive\n\n# Function to call apt-get if needed\napt-get-update-if-needed()\n{\n    if [ ! -d \"/var/lib/apt/lists\" ] || [ \"$(ls /var/lib/apt/lists/ | wc -l)\" = \"0\" ]; then\n        echo \"Running apt-get update...\"\n        apt-get update\n    else\n        echo \"Skipping apt-get update.\"\n    fi\n}\n\n# Run install apt-utils to avoid debconf warning then verify presence of other common developer tools and dependencies\nif [ \"${PACKAGES_ALREADY_INSTALLED}\" != \"true\" ]; then\n    apt-get-update-if-needed\n\n    PACKAGE_LIST=\"apt-utils \\\n        git \\\n        openssh-client \\\n        gnupg2 \\\n        iproute2 \\\n        procps \\\n        lsof \\\n        htop \\\n        net-tools \\\n        psmisc \\\n        curl \\\n        wget \\\n        rsync \\\n        ca-certificates \\\n        unzip \\\n        zip \\\n        nano \\\n        vim-tiny \\\n        less \\\n        jq \\\n        lsb-release \\\n        apt-transport-https \\\n        dialog \\\n        libc6 \\\n        libgcc1 \\\n        libgssapi-krb5-2 \\\n        libicu[0-9][0-9] \\\n        liblttng-ust0 \\\n        libstdc++6 \\\n        zlib1g \\\n        locales \\\n        sudo \\\n        ncdu \\\n        man-db\"\n\n    # Install libssl1.1 if available\n    if [[ ! -z $(apt-cache --names-only search ^libssl1.1$) ]]; then\n        PACKAGE_LIST=\"${PACKAGE_LIST}       libssl1.1\"\n    fi\n    \n    # Install appropriate version of libssl1.0.x if available\n    LIBSSL=$(dpkg-query -f '${db:Status-Abbrev}\\t${binary:Package}\\n' -W 'libssl1\\.0\\.?' 2>&1 || echo '')\n    if [ \"$(echo \"$LIBSSL\" | grep -o 'libssl1\\.0\\.[0-9]:' | uniq | sort | wc -l)\" -eq 0 ]; then\n        if [[ ! -z $(apt-cache --names-only search ^libssl1.0.2$) ]]; then\n            # Debian 9\n            PACKAGE_LIST=\"${PACKAGE_LIST}       libssl1.0.2\"\n        elif [[ ! -z $(apt-cache --names-only search ^libssl1.0.0$) ]]; then\n            # Ubuntu 18.04, 16.04, earlier\n            PACKAGE_LIST=\"${PACKAGE_LIST}       libssl1.0.0\"\n        fi\n    fi\n\n    echo \"Packages to verify are installed: ${PACKAGE_LIST}\"\n    apt-get -y install --no-install-recommends ${PACKAGE_LIST} 2> >( grep -v 'debconf: delaying package configuration, since apt-utils is not installed' >&2 )\n        \n    PACKAGES_ALREADY_INSTALLED=\"true\"\nfi\n\n# Get to latest versions of all packages\nif [ \"${UPGRADE_PACKAGES}\" = \"true\" ]; then\n    apt-get-update-if-needed\n    apt-get -y upgrade --no-install-recommends\n    apt-get autoremove -y\nfi\n\n# Ensure at least the en_US.UTF-8 UTF-8 locale is available.\n# Common need for both applications and things like the agnoster ZSH theme.\nif [ \"${LOCALE_ALREADY_SET}\" != \"true\" ] && ! grep -o -E '^\\s*en_US.UTF-8\\s+UTF-8' /etc/locale.gen > /dev/null; then\n    echo \"en_US.UTF-8 UTF-8\" >> /etc/locale.gen \n    locale-gen\n    LOCALE_ALREADY_SET=\"true\"\nfi\n\n# Create or update a non-root user to match UID/GID.\nif id -u ${USERNAME} > /dev/null 2>&1; then\n    # User exists, update if needed\n    if [ \"${USER_GID}\" != \"automatic\" ] && [ \"$USER_GID\" != \"$(id -G $USERNAME)\" ]; then \n        groupmod --gid $USER_GID $USERNAME \n        usermod --gid $USER_GID $USERNAME\n    fi\n    if [ \"${USER_UID}\" != \"automatic\" ] && [ \"$USER_UID\" != \"$(id -u $USERNAME)\" ]; then \n        usermod --uid $USER_UID $USERNAME\n    fi\nelse\n    # Create user\n    if [ \"${USER_GID}\" = \"automatic\" ]; then\n        groupadd $USERNAME\n    else\n        groupadd --gid $USER_GID $USERNAME\n    fi\n    if [ \"${USER_UID}\" = \"automatic\" ]; then \n        useradd -s /bin/bash --gid $USERNAME -m $USERNAME\n    else\n        useradd -s /bin/bash --uid $USER_UID --gid $USERNAME -m $USERNAME\n    fi\nfi\n\n# Add add sudo support for non-root user\nif [ \"${USERNAME}\" != \"root\" ] && [ \"${EXISTING_NON_ROOT_USER}\" != \"${USERNAME}\" ]; then\n    echo $USERNAME ALL=\\(root\\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\n    chmod 0440 /etc/sudoers.d/$USERNAME\n    EXISTING_NON_ROOT_USER=\"${USERNAME}\"\nfi\n\n# ** Shell customization section **\nif [ \"${USERNAME}\" = \"root\" ]; then \n    USER_RC_PATH=\"/root\"\nelse\n    USER_RC_PATH=\"/home/${USERNAME}\"\nfi\n\n# .bashrc/.zshrc snippet\nRC_SNIPPET=\"$(cat << EOF\nexport USER=\\$(whoami)\n\nexport PATH=\\$PATH:\\$HOME/.local/bin\nEOF\n)\"\n\n# code shim, it fallbacks to code-insiders if code is not available\ncat << 'EOF' > /usr/local/bin/code\n#!/bin/sh\n\nget_in_path_except_current() {\n  which -a \"$1\" | grep -v \"$0\" | head -1\n}\n\ncode=\"$(get_in_path_except_current code)\"\n\nif [ -n \"$code\" ]; then\n  exec \"$code\" \"$@\"\nelif [ \"$(command -v code-insiders)\" ]; then\n  exec code-insiders \"$@\"\nelse\n  echo \"code or code-insiders is not installed\" >&2\n  exit 127\nfi\nEOF\nchmod +x /usr/local/bin/code\n\n# Codespaces themes - partly inspired by https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/robbyrussell.zsh-theme\nCODESPACES_BASH=\"$(cat \\\n<<EOF\n#!/usr/bin/env bash\nprompt() {\n    if [ \"\\$?\" != \"0\" ]; then\n        local arrow_color=\\${bold_red}\n    else\n        local arrow_color=\\${reset_color}\n    fi\n    if [ ! -z \"\\${GITHUB_USER}\" ]; then\n        local USERNAME=\"@\\${GITHUB_USER}\"\n    else\n        local USERNAME=\"\\\\u\"\n    fi\n    local cwd=\"\\$(pwd | sed \"s|^\\${HOME}|~|\")\"\n    PS1=\"\\${green}\\${USERNAME} \\${arrow_color}➜\\${reset_color} \\${bold_blue}\\${cwd}\\${reset_color} \\$(scm_prompt_info)\\${white}$ \\${reset_color}\"\n}\nSCM_THEME_PROMPT_PREFIX=\"\\${reset_color}\\${cyan}(\\${bold_red}\"\nSCM_THEME_PROMPT_SUFFIX=\"\\${reset_color} \"\nSCM_THEME_PROMPT_DIRTY=\" \\${bold_yellow}✗\\${reset_color}\\${cyan})\"\nSCM_THEME_PROMPT_CLEAN=\"\\${reset_color}\\${cyan})\"\nSCM_GIT_SHOW_MINIMAL_INFO=\"true\"\nsafe_append_prompt_command prompt\nEOF\n)\"\nCODESPACES_ZSH=\"$(cat \\\n<<EOF\nprompt() {\n    if [ ! -z \"\\${GITHUB_USER}\" ]; then\n        local USERNAME=\"@\\${GITHUB_USER}\"\n    else\n        local USERNAME=\"%n\"\n    fi\n    PROMPT=\"%{\\$fg[green]%}\\${USERNAME} %(?:%{\\$reset_color%}➜ :%{\\$fg_bold[red]%}➜ )\"\n    PROMPT+='%{\\$fg_bold[blue]%}%~%{\\$reset_color%} \\$(git_prompt_info)%{\\$fg[white]%}$ %{\\$reset_color%}'\n}\nZSH_THEME_GIT_PROMPT_PREFIX=\"%{\\$fg_bold[cyan]%}(%{\\$fg_bold[red]%}\"\nZSH_THEME_GIT_PROMPT_SUFFIX=\"%{\\$reset_color%} \"\nZSH_THEME_GIT_PROMPT_DIRTY=\" %{\\$fg_bold[yellow]%}✗%{\\$fg_bold[cyan]%})\"\nZSH_THEME_GIT_PROMPT_CLEAN=\"%{\\$fg_bold[cyan]%})\"\nprompt\nEOF\n)\"\n\n# Adapted Oh My Zsh! install step to work with both \"Oh Mys\" rather than relying on an installer script\n# See https://github.com/ohmyzsh/ohmyzsh/blob/master/tools/install.sh for offical script.\ninstall-oh-my()\n{\n    local OH_MY=$1\n    local OH_MY_INSTALL_DIR=\"${USER_RC_PATH}/.oh-my-${OH_MY}\"\n    local TEMPLATE=\"${OH_MY_INSTALL_DIR}/templates/$2\"\n    local OH_MY_GIT_URL=$3\n    local USER_RC_FILE=\"${USER_RC_PATH}/.${OH_MY}rc\"\n\n    if [ -d \"${OH_MY_INSTALL_DIR}\" ] || [ \"${INSTALL_OH_MYS}\" != \"true\" ]; then\n        return 0\n    fi\n\n    umask g-w,o-w\n    mkdir -p ${OH_MY_INSTALL_DIR}\n    git clone --depth=1 \\\n        -c core.eol=lf \\\n        -c core.autocrlf=false \\\n        -c fsck.zeroPaddedFilemode=ignore \\\n        -c fetch.fsck.zeroPaddedFilemode=ignore \\\n        -c receive.fsck.zeroPaddedFilemode=ignore \\\n        ${OH_MY_GIT_URL} ${OH_MY_INSTALL_DIR} 2>&1\n    echo -e \"$(cat \"${TEMPLATE}\")\\nDISABLE_AUTO_UPDATE=true\\nDISABLE_UPDATE_PROMPT=true\" > ${USER_RC_FILE}\n    if [ \"${OH_MY}\" = \"bash\" ]; then\n        sed -i -e 's/OSH_THEME=.*/OSH_THEME=\"codespaces\"/g' ${USER_RC_FILE}\n        mkdir -p ${OH_MY_INSTALL_DIR}/custom/themes/codespaces\n        echo \"${CODESPACES_BASH}\" > ${OH_MY_INSTALL_DIR}/custom/themes/codespaces/codespaces.theme.sh\n    else\n        sed -i -e 's/ZSH_THEME=.*/ZSH_THEME=\"codespaces\"/g' ${USER_RC_FILE}\n        mkdir -p ${OH_MY_INSTALL_DIR}/custom/themes\n        echo \"${CODESPACES_ZSH}\" > ${OH_MY_INSTALL_DIR}/custom/themes/codespaces.zsh-theme\n    fi\n    # Shrink git while still enabling updates\n    cd ${OH_MY_INSTALL_DIR} \n    git repack -a -d -f --depth=1 --window=1\n\n    if [ \"${USERNAME}\" != \"root\" ]; then\n        cp -rf ${USER_RC_FILE} ${OH_MY_INSTALL_DIR} /root\n        chown -R ${USERNAME}:${USERNAME} ${USER_RC_PATH}\n    fi\n}\n\nif [ \"${RC_SNIPPET_ALREADY_ADDED}\" != \"true\" ]; then\n    echo \"${RC_SNIPPET}\" >> /etc/bash.bashrc\n    RC_SNIPPET_ALREADY_ADDED=\"true\"\nfi\ninstall-oh-my bash bashrc.osh-template https://github.com/ohmybash/oh-my-bash\n\n# Optionally install and configure zsh and Oh My Zsh!\nif [ \"${INSTALL_ZSH}\" = \"true\" ]; then\n    if ! type zsh > /dev/null 2>&1; then\n        apt-get-update-if-needed\n        apt-get install -y zsh\n    fi\n    if [ \"${ZSH_ALREADY_INSTALLED}\" != \"true\" ]; then\n        echo \"${RC_SNIPPET}\" >> /etc/zsh/zshrc\n        ZSH_ALREADY_INSTALLED=\"true\"\n    fi\n    install-oh-my zsh zshrc.zsh-template https://github.com/ohmyzsh/ohmyzsh\nfi\n\n# Write marker file\nmkdir -p \"$(dirname \"${MARKER_FILE}\")\"\necho -e \"\\\n    PACKAGES_ALREADY_INSTALLED=${PACKAGES_ALREADY_INSTALLED}\\n\\\n    LOCALE_ALREADY_SET=${LOCALE_ALREADY_SET}\\n\\\n    EXISTING_NON_ROOT_USER=${EXISTING_NON_ROOT_USER}\\n\\\n    RC_SNIPPET_ALREADY_ADDED=${RC_SNIPPET_ALREADY_ADDED}\\n\\\n    ZSH_ALREADY_INSTALLED=${ZSH_ALREADY_INSTALLED}\" > \"${MARKER_FILE}\"\n\necho \"Done!\"\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug-report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: bug\nassignees: ''\n\n---\n\n**Before reporting a bug, please test the beta branch!**\n\n## Bug description\nPlease describe what happened wrong and the expected behaviour/output.\n\n## Specs\nArtemis version: [e.g. 6.0.3-beta.1]\n<details>\n<summary>build.yaml:</summary>\n  \n```yaml\n# Please paste your `build.yaml` file\n```\n</details>\n<details>\n<summary>Artemis output:</summary>\n  \n```bash\n# Please paste the output of\n$ flutter pub run build_runner build --verbose\n#or\n$ pub run build_runner build --verbose\n```\n</details>\n<details>\n<summary>GraphQL schema:</summary>\n\n```graphql\n# If possible, please paste your GraphQL schema file,\n# or a minimum reproducible schema of the bug.\n```\n</details>\n<details>\n<summary>GraphQL query:</summary>\n\n```graphql\n# If possible, please paste your GraphQL query file,\n# or a minimum reproducible query of the bug.\n```\n</details>\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "content": "**Make sure you're opening this pull request pointing to beta branch!**\n\n## What does this PR do/solve?\n"
  },
  {
    "path": ".github/workflows/pull_request.yaml",
    "content": "on: pull_request\n\nname: CI\n\njobs:\n  check-version-and-changelog:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: comigor/actions/check-version-and-changelog@master\n        with:\n          repo_token: ${{ github.token }}\n          base_ref: ${{ github.base_ref }}\n  lint:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: dart-lang/setup-dart@v1.3\n        with:\n          sdk: stable\n      - id: install\n        name: Install dependencies\n        run: dart pub get\n      - name: Check formatting\n        if: always() && steps.install.outcome == 'success'\n        run: dart format --set-exit-if-changed .\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: dart-lang/setup-dart@v1.3\n        with:\n          sdk: stable\n      - id: install\n        name: Install dependencies\n        run: dart pub get\n      - name: Test\n        if: always() && steps.install.outcome == 'success'\n        run: dart test\n  analyze:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: dart-lang/setup-dart@v1.3\n        with:\n          sdk: stable\n      - id: install\n        name: Install dependencies\n        run: dart pub get\n      - name: Analyze\n        if: always() && steps.install.outcome == 'success'\n        run: dart analyze\n"
  },
  {
    "path": ".github/workflows/push.yaml",
    "content": "on:\n  push:\n    branches:\n      - master\n      - beta\n\nname: CI\n\njobs:\n  lint:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: dart-lang/setup-dart@v1.3\n        with:\n          sdk: stable\n      - id: install\n        name: Install dependencies\n        run: dart pub get\n      - name: Check formatting\n        if: always() && steps.install.outcome == 'success'\n        run: dart format --set-exit-if-changed .\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: dart-lang/setup-dart@v1.3\n        with:\n          sdk: stable\n      - id: install\n        name: Install dependencies\n        run: dart pub get\n      - name: Test\n        if: always() && steps.install.outcome == 'success'\n        run: dart test\n  analyze:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: dart-lang/setup-dart@v1.3\n        with:\n          sdk: stable\n      - id: install\n        name: Install dependencies\n        run: dart pub get\n      - name: Analyze\n        if: always() && steps.install.outcome == 'success'\n        run: dart analyze\n  create-tag-and-release:\n    needs:\n      - lint\n      - test\n      - analyze\n    runs-on: ubuntu-latest\n    if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta'\n    steps:\n      - uses: actions/checkout@master\n      - id: check_version_and_changelog\n        name: Check if version on pubspec.yaml was changed and if there's an entry for this new version on CHANGELOG\n        uses: comigor/actions/check-version-and-changelog@master\n        with:\n          base_ref: \"${{ github.ref }}\"\n      - name: Push tag\n        uses: anothrNick/github-tag-action@master\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n          CUSTOM_TAG: \"v${{ steps.check_version_and_changelog.outputs.package_version }}\"\n      - name: Create release\n        uses: actions/create-release@v1\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        with:\n          tag_name: \"v${{ steps.check_version_and_changelog.outputs.package_version }}\"\n          release_name: \"Release v${{ steps.check_version_and_changelog.outputs.package_version }}\"\n  deploy:\n    needs: create-tag-and-release\n    runs-on: ubuntu-latest\n    if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta'\n    steps:\n      - uses: actions/checkout@master\n      - uses: dart-lang/setup-dart@v1.3\n        with:\n          sdk: stable\n      - id: install\n        name: Install dependencies\n        run: dart pub get\n      - name: Publish to pub.dev\n        run: |\n          mkdir -p ~/.config/dart\n          echo '${{ secrets.PUB_CREDENTIALS }}' > ~/.config/dart/pub-credentials.json\n          dart pub publish --force\n"
  },
  {
    "path": ".gitignore",
    "content": "\n# Created by https://www.gitignore.io/api/dart,macos\n\n### Dart ###\n# See https://www.dartlang.org/guides/libraries/private-files\n\n# Files and directories created by pub\n.dart_tool/\n.packages\n.fvm\nbuild/\n# If you're building an application, you may want to check-in your pubspec.lock\n/pubspec.lock\n\n# Directory created by dartdoc\n# If you don't generate documentation locally you can remove this line.\ndoc/api/\n\n# Avoid committing generated Javascript files:\n*.dart.js\n*.info.json      # Produced by the --dump-info flag.\n*.js             # When generated by dart2js. Don't specify *.js if your\n                 # project includes source files written in JavaScript.\n*.js_\n*.js.deps\n*.js.map\n\n### macOS ###\n# General\n.DS_Store\n.AppleDouble\n.LSOverride\n\n# Icon must end with two \\r\nIcon\n\n# Thumbnails\n._*\n\n# Files that might appear in the root of a volume\n.DocumentRevisions-V100\n.fseventsd\n.Spotlight-V100\n.TemporaryItems\n.Trashes\n.VolumeIcon.icns\n.com.apple.timemachine.donotpresent\n\n# Directories potentially created on remote AFP share\n.AppleDB\n.AppleDesktop\nNetwork Trash Folder\nTemporary Items\n.apdisk\n\n\n# End of https://www.gitignore.io/api/dart,macos\n\n.idea\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# CHANGELOG\n\n## 7.13.1\n\n- Move `beta` version out of beta for pub.dev awareness\n\n## 7.13.0-beta.3\n\n- Add discontinuation notice\n\n## 7.13.0-beta.2\n\n- readme fix\n\n## 7.13.0-beta.1\n\n- package update\n\n## 7.12.0-beta.1\n\n- package update\n\n## 7.11.0-beta.1\n\n- actions/checkout@v3 update\n\n## 7.11.0-beta\n\n- package update\n\n## 7.10.0-beta.4\n\n- fix pipeline quoting issues\n\n## 7.10.0-beta.3\n\n- fix pipeline path, again\n\n## 7.10.0-beta.2\n\n- fix pipeline path\n\n## 7.10.0-beta.1\n\n- update workflows to use official community actions\n\n## 7.10.0-beta\n\n- package update\n\n## 7.9.0-beta\n\n- common fragments overlap fix\n\n## 7.8.0-beta\n\n- package update\n\n## 7.7.0-beta\n\n- package update\n\n## 7.6.1-beta\n\n- operation name constant\n\n## 7.6.2-beta\n\n- generate_queries flag to signify if query documents and operation names should be generated\n\n## 7.6.1-beta\n\n- operation name constant\n\n## 7.6.0-beta\n\n- package updates\n\n## 7.5.0-beta\n\n- there is no need to use `fragments_glob` any more just specify the glob which will include all your graphql docs\n\n## 7.4.0-beta\n\n- allow using file fragments and common fragments at the same time\n\n## 7.3.3-beta\n\n- fix https://github.com/comigor/artemis/issues/373\n\n## 7.3.2-beta\n\n- performance improvements-2\n\n## 7.3.1-beta\n\n- performance improvements\n\n## 7.3.0-beta\n\n- package update\n\n## 7.2.6-beta\n\n- Fix README\n\n## 7.2.5-beta\n\n- Format some files to improve `pana` score\n\n## 7.2.4-beta\n\n- package update\n\n## 7.2.3-beta\n\n- Update examples and make sure they all work\n\n## 7.2.2-beta\n\n- Add throwable errors for missing root object and used query fragments\n\n## 7.2.1-beta\n\n- Update package to use official Dart lint\n  following [this guide](https://github.com/dart-lang/lints#migrating-from-packagepedantic)\n\n## 7.2.0-beta.0\n\n- package update\n\n## 7.1.1-beta.1\n\n- support of `fragments_glob` at schema level\n\n## 7.1.0-beta.2\n\n- fix for https://github.com/comigor/artemis/issues/341\n\n## 7.1.0-beta.1\n\n- duplicated $$typename fix\n\n## 7.1.0-beta.0\n\n**BREAKING CHANGE**\n\n- changed the naming of scalar mappers\n\n## 7.0.0-beta.17\n\n- example indentaion fix\n\n## 7.0.0-beta.16\n\n- lazy canonical visitors\n\n## 7.0.0-beta.15\n\n- Update build_runner version in examples\n- Update Pokemon API in pokemon example\n- Update WebSocketLink in hasura example\n\n## 7.0.0-beta.14\n\n- Support gql context in client's execute and stream methods\n\n## 7.0.0-beta.13\n\n- fix for https://github.com/comigor/artemis/issues/177\n\n## 7.0.0-beta.12\n\n- package update\n\n## 7.0.0-beta.11\n\n- document generation fix for https://github.com/comigor/artemis/issues/307\n\n## 7.0.0-beta.10\n\n- union generation fix for https://github.com/comigor/artemis/issues/284\n\n## 7.0.0-beta.9\n\n- nullable scalar_mapping types\n\n## 7.0.0-beta.8\n\n- packages update\n\n## 7.0.0-beta.7\n\n- config file error handling\n\n## 7.0.0-beta.6\n\n- packages update\n\n## 7.0.0-beta.5\n\n- github example fix\n- pokemon example fix\n- hasura example fix\n- graphbrainz example fix\n\n## 7.0.0-beta.4\n\n- packages update\n- null-safe tests\n\n## 7.0.0-beta.3\n\n- document generated in separate variable for easier usage\n\n## 7.0.0-beta.2\n\n- package nnbd migraion\n\n## 7.0.0-beta.1\n\n**MAJOR BREAKING CHANGE**\n\n- Code generated by Artemis is now nnbd-compliant\n\n## 6.20.1-beta.2\n\n- Add codespaces folder\n\n## 6.20.1-beta.1\n\n- Allow for auto generated response and inputs to extend JsonSerializable\n\n## 6.19.3-beta.1\n\n- bugfix of append typename - common fragments\n\n## 6.19.2-beta.1\n\n- bugfix of append typename\n\n## 6.19.1-beta.1\n\n- Append typename flag\n\n## 6.18.2\n\n- Merging beta into master\n\n## 6.18.1-beta.1\n\n- add unknownEnumValue on list enums https://github.com/comigor/artemis/issues/246\n\n## 6.17.3\n\n- Add test case, warning to README, fix CI pipeline\n\n## 6.17.2\n\n- Update dependencies versions\n\n## 6.17.1-beta.1\n\n- package updates and one test fix\n\n## 6.16.1-beta.1\n\n- simple naming schema fix https://github.com/comigor/artemis/issues/226\n\n## 6.15.1-beta.1\n\n- Override annotation fix\n\n## 6.14.1-beta.1\n\n- Package updates\n\n## 6.13.1-beta.1\n\n- input underscore bugfix https://github.com/comigor/artemis/issues/223\n\n## 6.12.3-beta.2\n\n- Subscription test added\n\n## 6.12.3-beta.1\n\n- Readme fix\n\n## 6.12.2-beta.1\n\n- Fixed `ignore_for_file` documentation.\n\n## 6.12.1-beta.1\n\n- Added `ignore_for_file` option to ignore linter rules on generated files.\n\n## 6.11.1-beta.1\n\n- improved canonical types handling\n\n## 6.10.1-beta.1\n\n- Package updates\n\n## 6.9.2-beta.1\n\n- Fixed `toJson() doesn't remove \"kw$\" prefix`\n\n## 6.8.2-beta.1\n\n- test fix\n\n## 6.8.1-beta.1\n\n- fix for multiple schema_mapping\n\n## 6.7.2-beta.1\n\n- analyzer and linter warnings fix\n\n## 6.7.1-beta.1\n\n- uppercase keyword fix\n\n## 6.6.4-beta.1\n\n- pubspec fix\n\n## 6.6.3-beta.1\n\n- test fix\n\n## 6.6.2-beta.1\n\n- nnbd preparation\n\n## 6.6.1-beta.1\n\n- allow multiple operations per file\n\n## 6.5.2-beta.1\n\n- performance improvements - scan schema for canonical types only once\n\n## 6.5.1-beta.1\n\n- enum name pascal casing.\n\n## 6.5.0-beta.1\n\n- Add deprecated annotations in fields.\n\n## 6.4.4-beta.1\n\n- Build type name recursively, considering casing changes.\n\n## 6.4.3-beta.1\n\n- Mass package update\n\n## 6.3.3-beta.1\n\n- Centralize naming transformations; make types PascalCase and fields camelCase.\n\n## 6.3.2-beta.1\n\n- Recursively consider input lists.\n\n## 6.3.1-beta.1\n\n- Do not throw on unused scalars.\n\n## 6.3.0-beta.1\n\n**MAJOR BREAKING CHANGE**\n\n- all starting underscores are replaced with $\n- `__typename` field replaced with `$$typename`\n- enums are named according to Dart spec\n- fields similar to Dart keywords are prefixed with `kw$`\n\n## 6.2.1-beta.1\n\n- Check for more error causes and throw, explaining the error.\n\n## 6.2.0-beta.1\n\n**MAJOR BREAKING CHANGE**\n\nWe've found a regression on `6.1.0-beta.1`, which sends Enums as camelCase to\nthe server, when they should be sent as SCREAMING_SNAKE_CASE.\n\n- Reverts `6.1.0-beta.1`.\n\n## 6.1.1-beta.2\n\n- Improve actions and check pipeline output.\n\n## 6.1.1-beta.1\n\n- Short-circuit input object generation on recursive detection\n\n## 6.1.0-beta.1\n\n**MAJOR BREAKING CHANGE**\n\n- Convert enum casing to camel case.\n\n## 6.0.11-beta.1\n\n- Convert `ClassProperty` annotation item to `List<String>`.\n\n## 6.0.10-beta.1\n\n- Duplication bug fix\n\n## 6.0.9-beta.1\n\n- Added the exception for the case when `fragment_glob` leads to query files fragments ignore.\n\n## 6.0.8-beta.1\n\n- Adapt Artemis to subscriptions and create an example\n\n## 6.0.7-beta.1\n\n- Fix for the interfaces which uses fragments from fragments_glob\n\n## 6.0.6-beta.1\n\n- Hide build logs under `--verbose` flag\n\n## 6.0.5-beta.1\n\n- Include coercers annotations on custom scalars on input objects.\n\n## 6.0.4-beta.1\n\n- Properly consider \"sub-fragments\" on class generation.\n\n## 6.0.3-beta.1\n\n- Fix generation of custom scalars and its functions.\n\n## 6.0.2-beta.1\n\n- Fix invalid reference to class on Query generations.\n\n## 6.0.1-beta.1\n\n- End forwarder file with a newline.\n\n## 6.0.0-beta.1\n\n**MAJOR BREAKING CHANGE**\n\n- Generate canonical objects (enums and input objects) with their original\n  names on GraphQL. Fragments are also generated with their own names (plus the `Mixin` prefix, for now).\n- Make it possible to select a naming scheme to be used for generate the class\n  names. `pathedWithTypes` is the default for retrocompatibility, where the names\n  of previous types are used as prefix of the next class. This can generate\n  duplication on certain schemas. With `pathedWithFields`, the names of previous\n  fields are used as prefix of the next class and with `simple`, only the actual\n  GraphQL class nameis considered. See discussion on [#90][pr-90] and [#96][pr-96]\n  for more information.\n\n## 5.1.0\n\n- Add `.graphql.` to outputted files path, in a non-breaking change way: a\n  \"forwarder\" file will be generated to make it retro-compatible when a\n  configurated output doesn't end with `.graphql.dart`.\n\n## 5.0.4\n\n- Update CI to include beta branch.\n\n## 5.0.3\n\n- Update examples to match latest changes.\n\n## 5.0.2\n\n- Use default names for query/mutation root when SDL does not declare `schema`.\n\n## 5.0.1\n\n- Fix generation of recursive input objects introduced by 5.0.0.\n\n## 5.0.0\n\n**MAJOR BREAKING CHANGE**\n\nIn this version we moved from `json` to `graphql` (SDL) schema parsing.\nThis allowed us to get rid off ±1200 lines of code which makes the  \nproject support much easier. The test files with schema definitions\nbecame more clear and human readable.\n\nIf you already have your schema in SDL format, just point to it in `build.yaml`.\nIf not, use this [snippet][introspection-to-sdl-snippet]\n(from [this Apollo article][apollo-3-ways-schema]) or online helpers like\n[this one][introspection-to-sdl-online] to convert from one to another.\n\n## 4.0.2\n\n- Only add unknownEnumValue on non-list enums\n- Consider all classes to include reference to meta package\n\n## 4.0.1\n\n- Look at mutation root when generating a mutation\n\n## 4.0.0\n\n**MAJOR BREAKING CHANGE**\n\nThis version completely refactors how Artemis generate code (by finally\nusing the implementation of visitor pattern provided by `gql`). On top of that,\nI've decided to do other major breaking changes to make code cleaner and more\nmaintainable. Listed:\n\n- `add_query_prefix` doesn't exist anymore (it's now the default to generate\n  classes with its \"path\" from the query), e.g., this query's `city` field will\n  be typed as `CityName$QueryRoot$User$Address$City`:\n  ```graphql\n  query city_name {\n    user {\n      address {\n        city {\n          name\n        }\n      }\n    }\n  }\n  ```\n  This change was also done to tip users to NOT use those generated queries\n  directly on their code, to avoid coupling them to your business logic.\n- `custom_parser_import` was moved to inside a ScalarMap, and\n  `use_custom_parser` was removed.\n- `resolve_type_field` option was renamed to `type_name_field`, as `__typename`\n  is the correct field name (by GraphQL spec).\n- Classes generated for mutation will have a `Mutation` suffix, as queries\n  already have `Query` suffix.\n- Change pre-generation data classes constructors to named parameters, so if\n  you're using `GraphQLQueryBuilder.onBuild`, it will break.\n\nAnd also:\n\n- Add more logs and errors while generating code, to help debugging.\n- Add more/refactor tests.\n- Add a GitHub example.\n\nTODO:\n\n- [ ] re-add more logs\n- [ ] clean options (?)\n- [ ] prefix every class with `$` (?)\n- [ ] refactor class naming variables\n- [ ] review readme and changelog\n\n## 3.2.1\n\n- Fix unknown enum: add prefix\n\n## 3.2.0\n\n- Make enums loose. When unknown values are provided into an enum, it will fall back to a custom `ARTEMIS_UNKNOWN` value\n  avoiding breaking/crashing the client.\n\n## 3.1.0\n\n- Allow to dispose `ArtemisClient` underlining http client when possible\n\n## 3.0.0\n\n- BREAKING: Marks non nullable input field as `@required` [#68][pr-68]\n\n## 2.2.2\n\n- Make lists as input objects work again\n\n## 2.2.1\n\n- Display error on types not found on schema\n\n## 2.2.0+1\n\n- Add \"Articles and videos\" category on README\n\n## 2.2.0\n\n- Share fragments between queries and schemas (see `fragments_glob`) [#65][pr-65]\n\n## 2.1.4\n\n- Add missing prefix to generated enums\n\n## 2.1.3\n\n- Bump equatable/gql suite, refine GitHub actions\n\n## 2.1.2\n\n- Bump json_serializable/json_annotation\n\n## 2.1.1\n\n- Properly consider Union types on generation\n\n## 2.1.0+1\n\n- Fix GitHub actions deploy pipeline\n- Make sure artemis depends on json_annotation\n\n## 2.1.0\n\n- Generate fragments as mixins\n\n## 2.0.7+1\n\n- README updates\n\n## 2.0.7\n\n- Add missing prefix to interfaces\n\n## 2.0.6\n\n- Perserve the query name casing\n\n## 2.0.5\n\n- Bump `gql` package\n\n## 2.0.4\n\n- Bump `gql` package\n\n## 2.0.3\n\n- Generate every field of input objects\n\n## 2.0.2\n\n- Support `__schema` key under the data field or on root of `schema.json`.\n\n## 2.0.1\n\n- Loosen up dependencies to make it work again with Flutter `beta` channel\n\n## 2.0.0\n\n- BREAKING: move `GraphQLError` to `package:gql`. If you don't use it, or just\n  reference it indirectly, it will not be breaking, but a major will be bumped\n  anyway, just for sure.\n- Upgrade `package:gql` to version `0.7.4`\n- Build GQL AST into generated Dart code instead of the raw string\n- Use `Link` from `package:gql/link` as the execution interface of `ArtemisClient`\n- Use `package:gql_dedupe_link` and `package:gql_http_link` as the default links\n\n## 1.0.4\n\n- Add a test to guarantee query inputs can be lists\n\n## 1.0.3\n\n- Disable implicit casts\n- Avoid double-parsing the source string\n\n## 1.0.2\n\n- Differentiate lists from named types when looping through variables\n- Consider nullable operation name when defining query name\n\n## 1.0.1\n\n- Upgrade `gql` to version `0.2.0` to get rid of direct dependency on `source_span`\n  and for better parsing errors.\n- Filter for `SchemaMap` with `output` when generating code\n\n## 1.0.0\n\n- Breaking: Add required `output` option to `SchemaMap`\n- Make Artemis a `$lib$` synthetic generator\n- Add `add_query_prefix` option to `SchemaMap`\n\n## 0.7.0\n\n- Make generated classes a mixin of `Equatable`, meaning they can be easily comparable with `==`\n\n## 0.6.1\n\n- Include pubspec.lock files of examples\n\n## 0.6.0\n\n- Replace `graphql_parser` with `gql` package\n\n## 0.5.1\n\n- Add most documentation\n- Increase pana grade (health and maintenance)\n- Fix some stuff related to importing http on client\n\n## 0.5.0\n\n- Start using `code_builder` to better generate Dart code\n\n## 0.4.0\n\n- Allow scalar mappings to include imports for types\n\n## 0.3.2\n\n- Decode HTTP response as UTF-8 on execute helper.\n\n## 0.3.1\n\n- Export common used files on default package route (`package:artemis/artemis.dart`)\n- Use single schemaMap globbing stream to make sure only one schema will be found\n- Add missing changelog\n- Test new github actions\n\n## 0.3.0 BREAKING\n\n- Add new generators to GraphQLQuery and QueryArguments\n- Fix toJson() on JsonSerializable classes (for nested entities)\n- [BREAKING] Remove the `execute*` functions generations, to use instead the generic `ArtemisClient` class\n  that should receive a GraphQLQuery generated subclass.\n\n## 0.2.1\n\nSet HTTP headers only when using default HTTP client.\n\n## 0.2.0 BREAKING\n\nCompletely overhaul how this works.\n\nArtemis won't generate a full schema typing anymore. Instead, it will use the schema to generate typings from a specific\nquery or mutation. It will also create helper functions to execute those queries. See [README][readme] for more info.\n\nThis is totally a breaking change but as this library is still on alpha, I should keep it under 1.0.\n\n## 0.1.3\n\n- Make objects that implement interfaces override resolveType\n\n## 0.1.2\n\n- Improve package score\n\n## 0.1.1\n\n- Enable tests on pipeline\n\n## 0.1.0\n\n- \"Fix\" json_serializable dependency\n- Add tests\n- Generate union types as inheritance\n- Generate interface types as implementation\n- Make generated code choose inheritance\n\n## 0.0.1\n\n- First release\n- No tests\n- No documentation\n- Parse complex GraphQL schemas (incorrectly, now I know)\n- Parse all GraphQL types types (union, interface, enum, input object, object, scalar, list, non null)\n- Consider custom scalars\n- Not even compile from scratch\n- Lot of bugs\n\n[readme]: ./README.md\n\n[pr-65]: https://github.com/comigor/artemis/pull/65\n\n[pr-68]: https://github.com/comigor/artemis/pull/68\n\n[apollo-3-ways-schema]: https://blog.apollographql.com/three-ways-to-represent-your-graphql-schema-a41f4175100d#:~:text=Introspection%20query%20result%20to%20SDL\n\n[introspection-to-sdl-snippet]: https://gist.github.com/stubailo/041999ba5b8b15cede60b93ff9a38f53\n\n[introspection-to-sdl-online]: https://codesandbox.io/s/graphql-introspection-sdl-svlx2\n\n[pr-90]: https://github.com/comigor/artemis/pull/90\n\n[pr-96]: https://github.com/comigor/artemis/pull/96\n"
  },
  {
    "path": "FUNDING.yml",
    "content": "github: comigor\npatreon: comigor\ncustom: ['https://www.blockchain.com/btc/payment_request?address=1M1NJGg4SE7eaGUPUxQmqT9U1NhNYzW22J', 'https://api.qrserver.com/v1/create-qr-code/?data=xrb%3Anano_1jbe6nohyhpswj8gea8d7bpdd1ixxcmf3haj7gcrwzfweiwrmwuh33gpu1q3']\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2018 Igor Borges\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": "<!-- @formatter:off -->\n\n<p align=\"center\">\n  <img src=\"https://user-images.githubusercontent.com/735858/58768495-8ecbd600-8572-11e9-9321-4fa5ce4ea007.png\" height=\"200\">\n  <h1><b>Artemis</b></h1>\n</p>\n\n<!-- **Build dart types from GraphQL schemas and queries** -->\n\n## Notice\n\nArtemis has been [discontinued](https://github.com/gql-dart/ferry/issues/541).\n\nFor alternatives, take a look at the [Ferry](https://pub.dev/packages/ferry) project, featuring code generation for data types, customizable network layer (using `gql_link`), cache, data store connections, refetching + pagination support and more.\n\nAlso check out [graphql](https://pub.dev/packages/graphql), with features closely matching the current Artemis state: fully-featured client (for Dart and Flutter) with persistence, type generation (with [graphql_codegen](https://pub.dev/packages/graphql_codegen)), cache, and more.\n\nUsers and community are also invited to join the [GraphQL Dart](https://discord.gg/Pu8AMajSd) Discord to discuss migration approaches and ask for support.\n\nThanks to all contributors and users that made this project possible.\n\n<details>\n  <summary>To check out the old README, click here.</summary>\n\n<!-- Badges -->\n[![View at pub.dev][pub-badge]][pub-link]\n[![Test][actions-badge]][actions-link]\n[![PRs Welcome][prs-badge]][prs-link]\n[![Star on GitHub][github-star-badge]][github-star-link]\n[![Fork on GitHub][github-forks-badge]][github-forks-link]\n[![Discord][discord-badge]][discord-link]\n\n[pub-badge]: https://img.shields.io/pub/v/artemis?style=for-the-badge\n[pub-link]: https://pub.dev/packages/artemis\n\n[actions-badge]: https://img.shields.io/github/workflow/status/comigor/artemis/test?style=for-the-badge\n[actions-link]: https://github.com/comigor/artemis/actions\n\n[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge\n[prs-link]: https://github.com/comigor/artemis/issues\n\n[github-star-badge]: https://img.shields.io/github/stars/comigor/artemis.svg?style=for-the-badge&logo=github&logoColor=ffffff\n[github-star-link]: https://github.com/comigor/artemis/stargazers\n\n[github-forks-badge]: https://img.shields.io/github/forks/comigor/artemis.svg?style=for-the-badge&logo=github&logoColor=ffffff\n[github-forks-link]: https://github.com/comigor/artemis/network/members\n\n[discord-badge]: https://img.shields.io/discord/559455668810153989.svg?style=for-the-badge&logo=discord&logoColor=ffffff\n[discord-link]: https://discord.gg/2Y4wdE4\n\nCheck the [**beta**](https://github.com/comigor/artemis/tree/beta) branch for the bleeding edge (and breaking) stuff.\n\nArtemis is a code generator that looks for `schema.graphql` (GraphQL SDL - Schema Definition Language) and `*.graphql` files and builds `.graphql.dart` files typing that query, based on the schema. That's similar to what [Apollo](https://github.com/apollographql/apollo-client) does (Artemis is his sister anyway).\n\n---\n\n## **Installation**\nAdd the following to your `pubspec.yaml` file to be able to do code generation:\n```yaml\ndev_dependencies:\n  artemis: '>=7.0.0 <8.0.0'\n  build_runner: ^2.1.4\n  json_serializable: ^6.0.1\n```\nThe generated code uses the following packages in run-time:\n```yaml\ndependencies:\n  artemis: '>=8.0.0 <8.0.0' # only if you're using ArtemisClient!\n  json_annotation: ^4.3.0\n  equatable: ^2.0.3\n  gql: ^0.13.1-alpha\n```\n\nThen run:\n```shell\ndart pub get\n```\nor\n```shell\nflutter pub get\n```\n\nNow Artemis will generate the API files for you by running:\n```shell\ndart run build_runner build\n```\nor\n```shell\nflutter pub run build_runner build\n```\n\n## **Configuration**\nArtemis offers some configuration options to generate code. All options should be included on `build.yaml` file on the root of the project:\n```yaml\ntargets:\n  $default:\n    builders:\n      artemis:\n        options:\n          # custom configuration options!\n```\n\n> ⚠️ Make sure your configuration file is called `build.yaml` (with `.yaml` extension, not `.yml`)!\n\n| Option | Default value | Description |\n| - | - | - |\n| `generate_helpers` | `true` | If Artemis should generate query/mutation helper GraphQLQuery subclasses. |\n| `scalar_mapping` | `[]` | Mapping of GraphQL and Dart types. See [Custom scalars](#custom-scalars). |\n| `schema_mapping` | `[]` | Mapping of queries and which schemas they will use for code generation. See [Schema mapping](#schema-mapping). |\n| `fragments_glob` | `null` | Import path to the file implementing fragments for all queries mapped in schema_mapping. If it's assigned, fragments defined in schema_mapping will be ignored. |\n| `ignore_for_file` | `[]`  | The linter rules to ignore for artemis generated files. |\n| `generate_queries` | `true` | If Artemis should generate query documents and operation names. If you are using Artemis with `graphql` library it is useful to have those queries and operation names generated but without Atremis specific classes to exclude Artemis from dependancies |\n\nIt's important to remember that, by default, [build](https://github.com/dart-lang/build) will follow [Dart's package layout conventions](https://dart.dev/tools/pub/package-layout), meaning that only some folders will be considered to parse the input files. So, if you want to reference files from a folder other than `lib/`, make sure you've included it on `sources`:\n```yaml\ntargets:\n  $default:\n    sources:\n      - lib/**\n      - graphql/**\n      - data/**\n      - schema.graphql\n```\n\n### **Schema mapping**\nBy default, Artemis won't generate anything. That's because your queries/mutations should be linked to GraphQL schemas. To configure it, you need to point a `schema_mapping` to the path of those queries and schemas:\n\n```yaml\ntargets:\n  $default:\n    builders:\n      artemis:\n        options:\n          schema_mapping:\n            - output: lib/graphql_api.graphql.dart\n              schema: lib/my_graphql_schema.graphql\n              queries_glob: lib/**.graphql\n```\n\nEach `SchemaMap` is configured this way:\n\n| Option | Default value | Description |\n| - | - | - |\n| `output` | | Relative path to output the generated code. It should end with `.graphql.dart` or else the generator will need to generate one more file. |\n| `schema` | | Relative path to the GraphQL schema. |\n| `queries_glob` | | Glob that selects all query files to be used with this schema. |\n| `naming_scheme` | `pathedWithTypes` | The naming scheme to be used on generated classes names. `pathedWithTypes` is the default for retrocompatibility, where the names of previous types are used as prefix of the next class. This can generate duplication on certain schemas. With `pathedWithFields`, the names of previous fields are used as prefix of the next class and with `simple`, only the actual GraphQL class nameis considered. |\n| `type_name_field` | `__typename` | The name of the field used to differentiate interfaces and union types (commonly `__typename` or `__resolveType`). Note that `__typename` field are not added automatically to the query. If you want interface/union type resolution, you need to manually add it there or set `append_type_name` to `true`. |\n| `append_type_name` | `false` | Appends `type_name_field` value to the query selections set. |\n| `fragments_glob` | `null` | Import path to the file implementing fragments for all queries mapped in schema_mapping. |\n\nSee [examples](./example) for more information and configuration options.\n\n### **Custom scalars**\n\nIf your schema uses custom scalars, they must be defined on `build.yaml`. If it needs a custom parser (to decode from/to json), the `custom_parser_import` path must be set and the file must implement both `fromGraphQL___ToDart___` and `fromDart___ToGraphQL___` constant functions.\n\n`___ToDart___` and `___ToGraphQL___` should be named including nullability, here is an example:\n\n* `file: Upload` => `fromGraphQLUploadNullableToDartMultipartFileNullable`\nand `fromDartMultipartFileNullableToGraphQLUploadNullable`\n* `file: Upload!` => `fromGraphQLUploadToDartMultipartFile` and `fromDartMultipartFileToGraphQLUpload`\n* `file: [Upload]` => `fromGraphQLListNullableUploadNullableToDartListNullableMultipartFileNullable`\nand `fromDartListNullableMultipartFileNullableToGraphQLListNullableUploadNullable`\n* `file: [Upload]!` => `fromGraphQLListUploadNullableToDartListMultipartFileNullable`\nand `fromDartListMultipartFileNullableToGraphQLListUploadNullable`\n* `file: [Upload!]!` => `fromGraphQLListUploadToDartListMultipartFile` and `fromDartListMultipartFileToGraphQLListUpload`\n\n```yaml\ntargets:\n  $default:\n    builders:\n      artemis:\n        options:\n          scalar_mapping:\n            - custom_parser_import: 'package:graphbrainz_example/coercers.dart'\n              graphql_type: Date\n              dart_type: DateTime\n```\n\nIf your custom scalar needs to import Dart libraries, you can provide it in the config as well:\n\n```yaml\ntargets:\n  $default:\n    builders:\n      artemis:\n        options:\n          scalar_mapping:\n            - custom_parser_import: 'package:graphbrainz_example/coercers.dart'\n              graphql_type: BigDecimal\n              dart_type:\n                name: Decimal\n                imports:\n                  - 'package:decimal/decimal.dart'\n```\n\nEach `ScalarMap` is configured this way:\n\n| Option | Default value | Description |\n| - | - | - |\n| `graphql_type` |  | The GraphQL custom scalar name on schema. |\n| `dart_type` |  | The Dart type this custom scalar should be converted from/to. |\n| `custom_parser_import` | `null` | Import path to the file implementing coercer functions for custom scalars. See [Custom scalars](#custom-scalars). |\n\nSee [examples](./example) for more information and configuration options.\n\n## **Articles and videos**\n\n1. [Ultimate toolchain to work with GraphQL in Flutter](https://medium.com/@v.ditsyak/ultimate-toolchain-to-work-with-graphql-in-flutter-13aef79c6484)\n2. [Awesome GraphQL](https://github.com/chentsulin/awesome-graphql)\n\n## **ArtemisClient**\nIf you have `generate_helpers`, Artemis will create a subclass of `GraphQLQuery` for you, this class can be used\nin conjunction with `ArtemisClient`.\n\n```dart\nfinal client = ArtemisClient('/graphql');\nfinal gitHubReposQuery = MyGitHubReposQuery();\nfinal response = await client.execute(gitHubReposQuery);\n```\n\n`ArtemisClient` adds type-awareness around `Link` from [`package:gql/link`](https://pub.dev/packages/gql).\nYou can create `ArtemisClient` from any `Link` using `ArtemisClient.fromLink`.\n \nCheck the [examples](./example) to see how to use it in details.\n\n</details>\n"
  },
  {
    "path": "analysis_options.yaml",
    "content": "# https://github.com/dart-lang/lints#migrating-from-packagepedantic\ninclude: package:lints/recommended.yaml\n\nanalyzer:\n  exclude:\n    - example/**/*.dart\n  language:\n    strict-casts: true\nlinter:\n  rules:\n    overridden_fields: false\n"
  },
  {
    "path": "build.yaml",
    "content": "builders:\n  artemis:\n    import: 'package:artemis/builder.dart'\n    builder_factories: ['graphQLQueryBuilder']\n    build_extensions: {'$lib$': ['.graphql.dart']}\n    auto_apply: dependents\n    build_to: source\n    applies_builders: ['json_serializable']\n    runs_before: ['json_serializable']\n"
  },
  {
    "path": "example/.gitignore",
    "content": "/*\n!/pokemon\n!/graphbrainz\n!/github\n!/hasura"
  },
  {
    "path": "example/README.md",
    "content": "# **Examples**\n\nThis folder contains some examples on how to use artemis.\n\n## [**pokemon**](./pokemon)\n\nA simple example, showing [Pokémon GraphQL](https://graphql-pokemon.now.sh/) schema generation.\n\n## [**graphqbrainz**](./graphbrainz)\n\nA more complex example, for [graphbrainz](https://graphbrainz.herokuapp.com) (a MusicBrainz GraphQL server). Featuring union types, interfaces and custom scalars.\n\n## [**github**](./github)\n\nEven simpler example, for [GitHub GraphQL API](https://graphbrainz.herokuapp.com). I didn't commit the schema because it's too big (~3MB), so provide your own if you're running the example: https://github.com/octokit/graphql-schema\n\n## [**hasura**](./hasura)\n\nThis example uses a simple [Hasura](https://hasura.io/) server (with tables schema defined [in this file](./hasura/hasura.sql)), as an example of how to use Artemis with subscriptions.\n"
  },
  {
    "path": "example/github/.gitignore",
    "content": "github.schema.json\ngithub.schema.graphql"
  },
  {
    "path": "example/github/build.yaml",
    "content": "targets:\n  $default:\n    sources:\n      - lib/**\n      - github.schema.graphql\n    builders:\n      artemis:\n        options:\n          scalar_mapping:\n            - graphql_type: GitObjectID\n              dart_type: String\n            - graphql_type: URI\n              dart_type: String\n            - graphql_type: GitRefname\n              dart_type: String\n            - graphql_type: DateTime\n              dart_type: DateTime\n          schema_mapping:\n            - schema: github.schema.graphql\n              queries_glob: lib/graphql/search_repositories.graphql\n              output: lib/graphql/search_repositories.dart\n"
  },
  {
    "path": "example/github/lib/graphql/search_repositories.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\nexport 'search_repositories.graphql.dart';\n"
  },
  {
    "path": "example/github/lib/graphql/search_repositories.graphql",
    "content": "query search_repositories($query: String!) {\n  search(first: 10, type: REPOSITORY, query: $query) {\n    nodes {\n      __typename\n      ... on Repository {\n        name\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "example/github/lib/graphql/search_repositories.graphql.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n// @dart = 2.12\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'search_repositories.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SearchRepositories$Query$SearchResultItemConnection$SearchResultItem$Repository\n    extends SearchRepositories$Query$SearchResultItemConnection$SearchResultItem\n    with EquatableMixin {\n  SearchRepositories$Query$SearchResultItemConnection$SearchResultItem$Repository();\n\n  factory SearchRepositories$Query$SearchResultItemConnection$SearchResultItem$Repository.fromJson(\n          Map<String, dynamic> json) =>\n      _$SearchRepositories$Query$SearchResultItemConnection$SearchResultItem$RepositoryFromJson(\n          json);\n\n  late String name;\n\n  @override\n  List<Object?> get props => [name];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$SearchRepositories$Query$SearchResultItemConnection$SearchResultItem$RepositoryToJson(\n          this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SearchRepositories$Query$SearchResultItemConnection$SearchResultItem\n    extends JsonSerializable with EquatableMixin {\n  SearchRepositories$Query$SearchResultItemConnection$SearchResultItem();\n\n  factory SearchRepositories$Query$SearchResultItemConnection$SearchResultItem.fromJson(\n      Map<String, dynamic> json) {\n    switch (json['__typename'].toString()) {\n      case r'Repository':\n        return SearchRepositories$Query$SearchResultItemConnection$SearchResultItem$Repository\n            .fromJson(json);\n      default:\n    }\n    return _$SearchRepositories$Query$SearchResultItemConnection$SearchResultItemFromJson(\n        json);\n  }\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [$$typename];\n  @override\n  Map<String, dynamic> toJson() {\n    switch ($$typename) {\n      case r'Repository':\n        return (this\n                as SearchRepositories$Query$SearchResultItemConnection$SearchResultItem$Repository)\n            .toJson();\n      default:\n    }\n    return _$SearchRepositories$Query$SearchResultItemConnection$SearchResultItemToJson(\n        this);\n  }\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SearchRepositories$Query$SearchResultItemConnection\n    extends JsonSerializable with EquatableMixin {\n  SearchRepositories$Query$SearchResultItemConnection();\n\n  factory SearchRepositories$Query$SearchResultItemConnection.fromJson(\n          Map<String, dynamic> json) =>\n      _$SearchRepositories$Query$SearchResultItemConnectionFromJson(json);\n\n  List<SearchRepositories$Query$SearchResultItemConnection$SearchResultItem?>?\n      nodes;\n\n  @override\n  List<Object?> get props => [nodes];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$SearchRepositories$Query$SearchResultItemConnectionToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SearchRepositories$Query extends JsonSerializable with EquatableMixin {\n  SearchRepositories$Query();\n\n  factory SearchRepositories$Query.fromJson(Map<String, dynamic> json) =>\n      _$SearchRepositories$QueryFromJson(json);\n\n  late SearchRepositories$Query$SearchResultItemConnection search;\n\n  @override\n  List<Object?> get props => [search];\n  @override\n  Map<String, dynamic> toJson() => _$SearchRepositories$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SearchRepositoriesArguments extends JsonSerializable with EquatableMixin {\n  SearchRepositoriesArguments({required this.query});\n\n  @override\n  factory SearchRepositoriesArguments.fromJson(Map<String, dynamic> json) =>\n      _$SearchRepositoriesArgumentsFromJson(json);\n\n  late String query;\n\n  @override\n  List<Object?> get props => [query];\n  @override\n  Map<String, dynamic> toJson() => _$SearchRepositoriesArgumentsToJson(this);\n}\n\nfinal SEARCH_REPOSITORIES_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n      type: OperationType.query,\n      name: NameNode(value: 'search_repositories'),\n      variableDefinitions: [\n        VariableDefinitionNode(\n            variable: VariableNode(name: NameNode(value: 'query')),\n            type:\n                NamedTypeNode(name: NameNode(value: 'String'), isNonNull: true),\n            defaultValue: DefaultValueNode(value: null),\n            directives: [])\n      ],\n      directives: [],\n      selectionSet: SelectionSetNode(selections: [\n        FieldNode(\n            name: NameNode(value: 'search'),\n            alias: null,\n            arguments: [\n              ArgumentNode(\n                  name: NameNode(value: 'first'),\n                  value: IntValueNode(value: '10')),\n              ArgumentNode(\n                  name: NameNode(value: 'type'),\n                  value: EnumValueNode(name: NameNode(value: 'REPOSITORY'))),\n              ArgumentNode(\n                  name: NameNode(value: 'query'),\n                  value: VariableNode(name: NameNode(value: 'query')))\n            ],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FieldNode(\n                  name: NameNode(value: 'nodes'),\n                  alias: null,\n                  arguments: [],\n                  directives: [],\n                  selectionSet: SelectionSetNode(selections: [\n                    FieldNode(\n                        name: NameNode(value: '__typename'),\n                        alias: null,\n                        arguments: [],\n                        directives: [],\n                        selectionSet: null),\n                    InlineFragmentNode(\n                        typeCondition: TypeConditionNode(\n                            on: NamedTypeNode(\n                                name: NameNode(value: 'Repository'),\n                                isNonNull: false)),\n                        directives: [],\n                        selectionSet: SelectionSetNode(selections: [\n                          FieldNode(\n                              name: NameNode(value: 'name'),\n                              alias: null,\n                              arguments: [],\n                              directives: [],\n                              selectionSet: null)\n                        ]))\n                  ]))\n            ]))\n      ]))\n]);\n\nclass SearchRepositoriesQuery extends GraphQLQuery<SearchRepositories$Query,\n    SearchRepositoriesArguments> {\n  SearchRepositoriesQuery({required this.variables});\n\n  @override\n  final DocumentNode document = SEARCH_REPOSITORIES_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = 'search_repositories';\n\n  @override\n  final SearchRepositoriesArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  SearchRepositories$Query parse(Map<String, dynamic> json) =>\n      SearchRepositories$Query.fromJson(json);\n}\n"
  },
  {
    "path": "example/github/lib/graphql/search_repositories.graphql.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n// @dart=2.12\n\npart of 'search_repositories.graphql.dart';\n\n// **************************************************************************\n// JsonSerializableGenerator\n// **************************************************************************\n\nSearchRepositories$Query$SearchResultItemConnection$SearchResultItem$Repository\n    _$SearchRepositories$Query$SearchResultItemConnection$SearchResultItem$RepositoryFromJson(\n            Map<String, dynamic> json) =>\n        SearchRepositories$Query$SearchResultItemConnection$SearchResultItem$Repository()\n          ..$$typename = json['__typename'] as String?\n          ..name = json['name'] as String;\n\nMap<String, dynamic>\n    _$SearchRepositories$Query$SearchResultItemConnection$SearchResultItem$RepositoryToJson(\n            SearchRepositories$Query$SearchResultItemConnection$SearchResultItem$Repository\n                instance) =>\n        <String, dynamic>{\n          '__typename': instance.$$typename,\n          'name': instance.name,\n        };\n\nSearchRepositories$Query$SearchResultItemConnection$SearchResultItem\n    _$SearchRepositories$Query$SearchResultItemConnection$SearchResultItemFromJson(\n            Map<String, dynamic> json) =>\n        SearchRepositories$Query$SearchResultItemConnection$SearchResultItem()\n          ..$$typename = json['__typename'] as String?;\n\nMap<String, dynamic>\n    _$SearchRepositories$Query$SearchResultItemConnection$SearchResultItemToJson(\n            SearchRepositories$Query$SearchResultItemConnection$SearchResultItem\n                instance) =>\n        <String, dynamic>{\n          '__typename': instance.$$typename,\n        };\n\nSearchRepositories$Query$SearchResultItemConnection\n    _$SearchRepositories$Query$SearchResultItemConnectionFromJson(\n            Map<String, dynamic> json) =>\n        SearchRepositories$Query$SearchResultItemConnection()\n          ..nodes = (json['nodes'] as List<dynamic>?)\n              ?.map((e) => e == null\n                  ? null\n                  : SearchRepositories$Query$SearchResultItemConnection$SearchResultItem\n                      .fromJson(e as Map<String, dynamic>))\n              .toList();\n\nMap<String, dynamic>\n    _$SearchRepositories$Query$SearchResultItemConnectionToJson(\n            SearchRepositories$Query$SearchResultItemConnection instance) =>\n        <String, dynamic>{\n          'nodes': instance.nodes?.map((e) => e?.toJson()).toList(),\n        };\n\nSearchRepositories$Query _$SearchRepositories$QueryFromJson(\n        Map<String, dynamic> json) =>\n    SearchRepositories$Query()\n      ..search = SearchRepositories$Query$SearchResultItemConnection.fromJson(\n          json['search'] as Map<String, dynamic>);\n\nMap<String, dynamic> _$SearchRepositories$QueryToJson(\n        SearchRepositories$Query instance) =>\n    <String, dynamic>{\n      'search': instance.search.toJson(),\n    };\n\nSearchRepositoriesArguments _$SearchRepositoriesArgumentsFromJson(\n        Map<String, dynamic> json) =>\n    SearchRepositoriesArguments(\n      query: json['query'] as String,\n    );\n\nMap<String, dynamic> _$SearchRepositoriesArgumentsToJson(\n        SearchRepositoriesArguments instance) =>\n    <String, dynamic>{\n      'query': instance.query,\n    };\n"
  },
  {
    "path": "example/github/lib/main.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\n\nimport 'package:artemis/artemis.dart';\nimport 'package:http/http.dart' as http;\n\nimport 'graphql/search_repositories.dart';\n\nclass AuthenticatedClient extends http.BaseClient {\n  final http.Client _inner = http.Client();\n\n  Future<http.StreamedResponse> send(http.BaseRequest request) {\n    request.headers['Authorization'] =\n        'Bearer ${Platform.environment['GITHUB_TOKEN']}';\n    return _inner.send(request);\n  }\n}\n\nFuture<void> main() async {\n  final client = ArtemisClient(\n    'https://api.github.com/graphql',\n    httpClient: AuthenticatedClient(),\n  );\n\n  final query = SearchRepositoriesQuery(\n    variables: SearchRepositoriesArguments(query: 'flutter'),\n  );\n\n  final response = await client.execute(query);\n\n  (response.data?.search.nodes ?? [])\n      .whereType<\n          SearchRepositories$Query$SearchResultItemConnection$SearchResultItem$Repository>()\n      .map((r) => r.name)\n      .forEach(print);\n}\n"
  },
  {
    "path": "example/github/pubspec.yaml",
    "content": "name: github_example\nversion: 0.0.1\n\nenvironment:\n  sdk: \">=2.12.0 <3.0.0\"\n\ndependencies:\n  http:\n\ndev_dependencies:\n  test:\n  build_runner:\n  json_serializable:\n  lints: ^1.0.1\n  artemis:\n    path: ../../.\n"
  },
  {
    "path": "example/graphbrainz/build.yaml",
    "content": "targets:\n  $default:\n    sources:\n      - lib/**\n    builders:\n      artemis:\n        options:\n          schema_mapping:\n            - schema: lib/graphbrainz.schema.graphql\n              queries_glob: lib/queries/ed_sheeran.query.graphql\n              output: lib/queries/ed_sheeran.query.dart\n          custom_parser_import: 'package:graphbrainz_example/coercers.dart'\n          scalar_mapping:\n            - graphql_type: Date\n              dart_type: DateTime\n              use_custom_parser: true\n            - graphql_type: Time\n              dart_type: DateTime\n              use_custom_parser: true\n            - graphql_type: DiscID\n              dart_type: String\n            - graphql_type: MBID\n              dart_type: String\n            - graphql_type: ASIN\n              dart_type: String\n            - graphql_type: IPI\n              dart_type: String\n            - graphql_type: ISNI\n              dart_type: String\n            - graphql_type: ISRC\n              dart_type: String\n            - graphql_type: URLString\n              dart_type: String\n            - graphql_type: Degrees\n              dart_type: double\n            - graphql_type: Locale\n              dart_type: String\n"
  },
  {
    "path": "example/graphbrainz/lib/coercers.dart",
    "content": "import 'package:intl/intl.dart';\n\nfinal dateFormatter = DateFormat('yyyy-MM-dd');\nfinal timeFormatter = DateFormat('HH:mm:ss');\n\nDateTime fromGraphQLDateToDartDateTime(String date) => DateTime.parse(date);\nString fromDartDateTimeToGraphQLDate(DateTime date) =>\n    dateFormatter.format(date);\nDateTime fromGraphQLTimeToDartDateTime(String time) =>\n    DateTime.parse('1970-01-01T${time}Z');\nString fromDartDateTimeToGraphQLTime(DateTime date) =>\n    timeFormatter.format(date);\n"
  },
  {
    "path": "example/graphbrainz/lib/graphbrainz.schema.graphql",
    "content": "\"\"\"\n[Aliases](https://musicbrainz.org/doc/Aliases) are variant names\nthat are mostly used as search help: if a search matches an entity’s alias, the\nentity will be given as a result – even if the actual name wouldn’t be.\n\"\"\"\ntype Alias {\n  \"\"\"The aliased name of the entity.\"\"\"\n  name: String\n\n  \"\"\"\n  The string to use for the purpose of ordering by name (for\n  example, by moving articles like ‘the’ to the end or a person’s last name to\n  the front).\n  \"\"\"\n  sortName: String\n\n  \"\"\"\n  The locale (language and/or country) in which the alias is\n  used.\n  \"\"\"\n  locale: Locale\n\n  \"\"\"\n  Whether this is the main alias for the entity in the\n  specified locale (this could mean the most recent or the most common).\n  \"\"\"\n  primary: Boolean\n\n  \"\"\"\n  The type or purpose of the alias – whether it is a variant,\n  search hint, etc.\n  \"\"\"\n  type: String\n\n  \"\"\"\n  The MBID associated with the value of the `type`\n  field.\n  \"\"\"\n  typeID: MBID\n}\n\n\"\"\"\n[Areas](https://musicbrainz.org/doc/Area) are geographic regions\nor settlements (countries, cities, or the like).\n\"\"\"\ntype Area implements Node & Entity {\n  \"\"\"The ID of an object\"\"\"\n  id: ID!\n\n  \"\"\"The MBID of the entity.\"\"\"\n  mbid: MBID!\n\n  \"\"\"The official name of the entity.\"\"\"\n  name: String\n\n  \"\"\"\n  The string to use for the purpose of ordering by name (for\n  example, by moving articles like ‘the’ to the end or a person’s last name to\n  the front).\n  \"\"\"\n  sortName: String\n\n  \"\"\"A comment used to help distinguish identically named entitites.\"\"\"\n  disambiguation: String\n\n  \"\"\"\n  [Aliases](https://musicbrainz.org/doc/Aliases) are used to store\n  alternate names or misspellings.\n  \"\"\"\n  aliases: [Alias]\n\n  \"\"\"\n  [ISO 3166 codes](https://en.wikipedia.org/wiki/ISO_3166) are\n  the codes assigned by ISO to countries and subdivisions.\n  \"\"\"\n  isoCodes(\n    \"\"\"\n    Specify the particular ISO standard codes to retrieve.\n    Available ISO standards are 3166-1, 3166-2, and 3166-3.\n    \"\"\"\n    standard: String = \"3166-1\"\n  ): [String]\n\n  \"\"\"\n  The type of area (country, city, etc. – see the [possible\n  values](https://musicbrainz.org/doc/Area)).\n  \"\"\"\n  type: String\n\n  \"\"\"\n  The MBID associated with the value of the `type`\n  field.\n  \"\"\"\n  typeID: MBID\n\n  \"\"\"A list of artists linked to this entity.\"\"\"\n  artists(after: String, first: Int): ArtistConnection\n\n  \"\"\"A list of events linked to this entity.\"\"\"\n  events(after: String, first: Int): EventConnection\n\n  \"\"\"A list of labels linked to this entity.\"\"\"\n  labels(after: String, first: Int): LabelConnection\n\n  \"\"\"A list of places linked to this entity.\"\"\"\n  places(after: String, first: Int): PlaceConnection\n\n  \"\"\"A list of releases linked to this entity.\"\"\"\n  releases(\n    \"\"\"Filter by one or more release group types.\"\"\"\n    type: [ReleaseGroupType]\n\n    \"\"\"Filter by one or more release statuses.\"\"\"\n    status: [ReleaseStatus]\n    after: String\n    first: Int\n  ): ReleaseConnection\n\n  \"\"\"Relationships between this entity and other entitites.\"\"\"\n  relationships: Relationships\n\n  \"\"\"A list of collections containing this entity.\"\"\"\n  collections(after: String, first: Int): CollectionConnection\n\n  \"\"\"A list of tags linked to this entity.\"\"\"\n  tags(after: String, first: Int): TagConnection\n\n  \"\"\"\n  Chart data available for this area on [Last.fm](https://www.last.fm/), if\n  the area represents a country with an [ISO 3166 code](https://en.wikipedia.org/wiki/ISO_3166).\n  This field is provided by the Last.fm extension.\n  \"\"\"\n  lastFM: LastFMCountry\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype AreaConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [AreaEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the\n  `edges` field).\n  \"\"\"\n  nodes: [Area]\n\n  \"\"\"\n  A count of the total number of items in this connection,\n  ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype AreaEdge {\n  \"\"\"The item at the end of the edge\"\"\"\n  node: Area\n\n  \"\"\"A cursor for use in pagination\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The relevancy score (0–100) assigned by the search engine, if\n  these results were found through a search.\n  \"\"\"\n  score: Int\n}\n\n\"\"\"\nAn [artist](https://musicbrainz.org/doc/Artist) is generally a\nmusician, group of musicians, or other music professional (like a producer or\nengineer). Occasionally, it can also be a non-musical person (like a\nphotographer, an illustrator, or a poet whose writings are set to music), or\neven a fictional character.\n\"\"\"\ntype Artist implements Node & Entity {\n  \"\"\"The ID of an object\"\"\"\n  id: ID!\n\n  \"\"\"The MBID of the entity.\"\"\"\n  mbid: MBID!\n\n  \"\"\"The official name of the entity.\"\"\"\n  name: String\n\n  \"\"\"\n  The string to use for the purpose of ordering by name (for\n  example, by moving articles like ‘the’ to the end or a person’s last name to\n  the front).\n  \"\"\"\n  sortName: String\n\n  \"\"\"A comment used to help distinguish identically named entitites.\"\"\"\n  disambiguation: String\n\n  \"\"\"\n  [Aliases](https://musicbrainz.org/doc/Aliases) are used to store\n  alternate names or misspellings.\n  \"\"\"\n  aliases: [Alias]\n\n  \"\"\"\n  The country with which an artist is primarily identified. It\n  is often, but not always, its birth/formation country.\n  \"\"\"\n  country: String\n\n  \"\"\"\n  The area with which an artist is primarily identified. It\n  is often, but not always, its birth/formation country.\n  \"\"\"\n  area: Area\n\n  \"\"\"\n  The area in which an artist began their career (or where\n  they were born, if the artist is a person).\n  \"\"\"\n  beginArea: Area\n\n  \"\"\"\n  The area in which an artist ended their career (or where\n  they died, if the artist is a person).\n  \"\"\"\n  endArea: Area\n\n  \"\"\"\n  The begin and end dates of the entity’s existence. Its exact\n  meaning depends on the type of entity.\n  \"\"\"\n  lifeSpan: LifeSpan\n\n  \"\"\"\n  Whether a person or character identifies as male, female, or\n  neither. Groups do not have genders.\n  \"\"\"\n  gender: String\n\n  \"\"\"\n  The MBID associated with the value of the `gender`\n  field.\n  \"\"\"\n  genderID: MBID\n\n  \"\"\"Whether an artist is a person, a group, or something else.\"\"\"\n  type: String\n\n  \"\"\"\n  The MBID associated with the value of the `type`\n  field.\n  \"\"\"\n  typeID: MBID\n\n  \"\"\"\n  List of [Interested Parties Information](https://musicbrainz.org/doc/IPI)\n  (IPI) codes for the artist.\n  \"\"\"\n  ipis: [IPI]\n\n  \"\"\"\n  List of [International Standard Name Identifier](https://musicbrainz.org/doc/ISNI)\n  (ISNI) codes for the artist.\n  \"\"\"\n  isnis: [ISNI]\n\n  \"\"\"A list of recordings linked to this entity.\"\"\"\n  recordings(after: String, first: Int): RecordingConnection\n\n  \"\"\"A list of releases linked to this entity.\"\"\"\n  releases(\n    \"\"\"Filter by one or more release group types.\"\"\"\n    type: [ReleaseGroupType]\n\n    \"\"\"Filter by one or more release statuses.\"\"\"\n    status: [ReleaseStatus]\n    after: String\n    first: Int\n  ): ReleaseConnection\n\n  \"\"\"A list of release groups linked to this entity.\"\"\"\n  releaseGroups(\n    \"\"\"Filter by one or more release group types.\"\"\"\n    type: [ReleaseGroupType]\n    after: String\n    first: Int\n  ): ReleaseGroupConnection\n\n  \"\"\"A list of works linked to this entity.\"\"\"\n  works(after: String, first: Int): WorkConnection\n\n  \"\"\"Relationships between this entity and other entitites.\"\"\"\n  relationships: Relationships\n\n  \"\"\"A list of collections containing this entity.\"\"\"\n  collections(after: String, first: Int): CollectionConnection\n\n  \"\"\"The rating users have given to this entity.\"\"\"\n  rating: Rating\n\n  \"\"\"A list of tags linked to this entity.\"\"\"\n  tags(after: String, first: Int): TagConnection\n\n  \"\"\"\n  Images of the artist from [fanart.tv](https://fanart.tv/).\n  This field is provided by the fanart.tv extension.\n  \"\"\"\n  fanArt: FanArtArtist\n\n  \"\"\"\n  Artist images found at MediaWiki URLs in the artist’s URL relationships.\n  Defaults to URL relationships with the type “image”.\n  This field is provided by the MediaWiki extension.\n  \"\"\"\n  mediaWikiImages(\n    \"\"\"\n    The type of URL relationship that will be selected to find images. See\n    the possible [Artist-URL relationship types](https://musicbrainz.org/relationships/artist-url).\n    \"\"\"\n    type: String = \"image\"\n  ): [MediaWikiImage]!\n\n  \"\"\"\n  Data about the artist from [TheAudioDB](http://www.theaudiodb.com/), a good\n  source of biographical information and images.\n  This field is provided by TheAudioDB extension.\n  \"\"\"\n  theAudioDB: TheAudioDBArtist\n\n  \"\"\"Information about the artist on Discogs.\"\"\"\n  discogs: DiscogsArtist\n\n  \"\"\"\n  Data about the artist from [Last.fm](https://www.last.fm/), a good source\n  for measuring popularity via listener and play counts. This field is\n  provided by the Last.fm extension.\n  \"\"\"\n  lastFM: LastFMArtist\n\n  \"\"\"The artist’s entry on Spotify.\"\"\"\n  spotify: SpotifyArtist\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype ArtistConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [ArtistEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the\n  `edges` field).\n  \"\"\"\n  nodes: [Artist]\n\n  \"\"\"\n  A count of the total number of items in this connection,\n  ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"\n[Artist credits](https://musicbrainz.org/doc/Artist_Credits)\nindicate who is the main credited artist (or artists) for releases, release\ngroups, tracks, and recordings, and how they are credited. They consist of\nartists, with (optionally) their names as credited in the specific release,\ntrack, etc., and join phrases between them.\n\"\"\"\ntype ArtistCredit {\n  \"\"\"\n  The entity representing the artist referenced in the\n  credits.\n  \"\"\"\n  artist: Artist\n\n  \"\"\"\n  The name of the artist as credited in the specific release,\n  track, etc.\n  \"\"\"\n  name: String\n\n  \"\"\"\n  Join phrases might include words and/or punctuation to\n  separate artist names as they appear on the release, track, etc.\n  \"\"\"\n  joinPhrase: String\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype ArtistEdge {\n  \"\"\"The item at the end of the edge\"\"\"\n  node: Artist\n\n  \"\"\"A cursor for use in pagination\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The relevancy score (0–100) assigned by the search engine, if\n  these results were found through a search.\n  \"\"\"\n  score: Int\n}\n\n\"\"\"\nAn [Amazon Standard Identification Number](https://musicbrainz.org/doc/ASIN)\n(ASIN) is a 10-character alphanumeric unique identifier assigned by Amazon.com\nand its partners for product identification within the Amazon organization.\n\"\"\"\nscalar ASIN\n\n\"\"\"\nA query for all MusicBrainz entities directly linked to another\nentity.\n\"\"\"\ntype BrowseQuery {\n  \"\"\"Browse area entities linked to the given arguments.\"\"\"\n  areas(\n    \"\"\"The MBID of a collection in which the entity is found.\"\"\"\n    collection: MBID\n    after: String\n    first: Int\n  ): AreaConnection\n\n  \"\"\"Browse artist entities linked to the given arguments.\"\"\"\n  artists(\n    \"\"\"The MBID of an area to which the entity is linked.\"\"\"\n    area: MBID\n\n    \"\"\"The MBID of a collection in which the entity is found.\"\"\"\n    collection: MBID\n\n    \"\"\"The MBID of a recording to which the entity is linked.\"\"\"\n    recording: MBID\n\n    \"\"\"The MBID of a release to which the entity is linked.\"\"\"\n    release: MBID\n\n    \"\"\"The MBID of a release group to which the entity is linked.\"\"\"\n    releaseGroup: MBID\n\n    \"\"\"The MBID of a work to which the entity is linked.\"\"\"\n    work: MBID\n    after: String\n    first: Int\n  ): ArtistConnection\n\n  \"\"\"Browse collection entities linked to the given arguments.\"\"\"\n  collections(\n    \"\"\"The MBID of an area to which the entity is linked.\"\"\"\n    area: MBID\n\n    \"\"\"The MBID of an artist to which the entity is linked.\"\"\"\n    artist: MBID\n\n    \"\"\"The username of the editor who created the collection.\"\"\"\n    editor: String\n\n    \"\"\"The MBID of an event to which the entity is linked.\"\"\"\n    event: MBID\n\n    \"\"\"The MBID of a label to which the entity is linked.\"\"\"\n    label: MBID\n\n    \"\"\"The MBID of a place to which the entity is linked.\"\"\"\n    place: MBID\n\n    \"\"\"The MBID of a recording to which the entity is linked.\"\"\"\n    recording: MBID\n\n    \"\"\"The MBID of a release to which the entity is linked.\"\"\"\n    release: MBID\n\n    \"\"\"The MBID of a release group to which the entity is linked.\"\"\"\n    releaseGroup: MBID\n\n    \"\"\"The MBID of a work to which the entity is linked.\"\"\"\n    work: MBID\n    after: String\n    first: Int\n  ): CollectionConnection\n\n  \"\"\"Browse event entities linked to the given arguments.\"\"\"\n  events(\n    \"\"\"The MBID of an area to which the entity is linked.\"\"\"\n    area: MBID\n\n    \"\"\"The MBID of an artist to which the entity is linked.\"\"\"\n    artist: MBID\n\n    \"\"\"The MBID of a collection in which the entity is found.\"\"\"\n    collection: MBID\n\n    \"\"\"The MBID of a place to which the entity is linked.\"\"\"\n    place: MBID\n    after: String\n    first: Int\n  ): EventConnection\n\n  \"\"\"Browse label entities linked to the given arguments.\"\"\"\n  labels(\n    \"\"\"The MBID of an area to which the entity is linked.\"\"\"\n    area: MBID\n\n    \"\"\"The MBID of a collection in which the entity is found.\"\"\"\n    collection: MBID\n\n    \"\"\"The MBID of a release to which the entity is linked.\"\"\"\n    release: MBID\n    after: String\n    first: Int\n  ): LabelConnection\n\n  \"\"\"Browse place entities linked to the given arguments.\"\"\"\n  places(\n    \"\"\"The MBID of an area to which the entity is linked.\"\"\"\n    area: MBID\n\n    \"\"\"The MBID of a collection in which the entity is found.\"\"\"\n    collection: MBID\n    after: String\n    first: Int\n  ): PlaceConnection\n\n  \"\"\"Browse recording entities linked to the given arguments.\"\"\"\n  recordings(\n    \"\"\"The MBID of an artist to which the entity is linked.\"\"\"\n    artist: MBID\n\n    \"\"\"The MBID of a collection in which the entity is found.\"\"\"\n    collection: MBID\n\n    \"\"\"\n    The [International Standard Recording Code](https://musicbrainz.org/doc/ISRC)\n    (ISRC) of the recording.\n    \"\"\"\n    isrc: ISRC\n\n    \"\"\"The MBID of a release to which the entity is linked.\"\"\"\n    release: MBID\n    after: String\n    first: Int\n  ): RecordingConnection\n\n  \"\"\"Browse release entities linked to the given arguments.\"\"\"\n  releases(\n    \"\"\"The MBID of an area to which the entity is linked.\"\"\"\n    area: MBID\n\n    \"\"\"The MBID of an artist to which the entity is linked.\"\"\"\n    artist: MBID\n\n    \"\"\"The MBID of a collection in which the entity is found.\"\"\"\n    collection: MBID\n\n    \"\"\"\n    A [disc ID](https://musicbrainz.org/doc/Disc_ID)\n    associated with the release.\n    \"\"\"\n    discID: DiscID\n\n    \"\"\"The MBID of a label to which the entity is linked.\"\"\"\n    label: MBID\n\n    \"\"\"The MBID of a recording to which the entity is linked.\"\"\"\n    recording: MBID\n\n    \"\"\"The MBID of a release group to which the entity is linked.\"\"\"\n    releaseGroup: MBID\n\n    \"\"\"The MBID of a track that is included in the release.\"\"\"\n    track: MBID\n\n    \"\"\"\n    The MBID of an artist that appears on a track in the\n    release, but is not included in the credits for the release itself.\n    \"\"\"\n    trackArtist: MBID\n\n    \"\"\"Filter by one or more release group types.\"\"\"\n    type: [ReleaseGroupType]\n\n    \"\"\"Filter by one or more release statuses.\"\"\"\n    status: [ReleaseStatus]\n    after: String\n    first: Int\n  ): ReleaseConnection\n\n  \"\"\"Browse release group entities linked to the given arguments.\"\"\"\n  releaseGroups(\n    \"\"\"The MBID of an artist to which the entity is linked.\"\"\"\n    artist: MBID\n\n    \"\"\"The MBID of a collection in which the entity is found.\"\"\"\n    collection: MBID\n\n    \"\"\"The MBID of a release to which the entity is linked.\"\"\"\n    release: MBID\n\n    \"\"\"Filter by one or more release group types.\"\"\"\n    type: [ReleaseGroupType]\n    after: String\n    first: Int\n  ): ReleaseGroupConnection\n\n  \"\"\"Browse work entities linked to the given arguments.\"\"\"\n  works(\n    \"\"\"The MBID of an artist to which the entity is linked.\"\"\"\n    artist: MBID\n\n    \"\"\"The MBID of a collection in which the entity is found.\"\"\"\n    collection: MBID\n\n    \"\"\"\n    The [International Standard Musical Work Code](https://musicbrainz.org/doc/ISWC)\n    (ISWC) of the work.\n    \"\"\"\n    iswc: ISWC\n    after: String\n    first: Int\n  ): WorkConnection\n}\n\n\"\"\"\n[Collections](https://musicbrainz.org/doc/Collections) are\nlists of entities that users can create.\n\"\"\"\ntype Collection implements Node & Entity {\n  \"\"\"The ID of an object\"\"\"\n  id: ID!\n\n  \"\"\"The MBID of the entity.\"\"\"\n  mbid: MBID!\n\n  \"\"\"The official name of the entity.\"\"\"\n  name: String\n\n  \"\"\"The username of the editor who created the collection.\"\"\"\n  editor: String!\n\n  \"\"\"The type of entity listed in the collection.\"\"\"\n  entityType: String!\n\n  \"\"\"The type of collection.\"\"\"\n  type: String\n\n  \"\"\"\n  The MBID associated with the value of the `type`\n  field.\n  \"\"\"\n  typeID: MBID\n\n  \"\"\"The list of areas found in this collection.\"\"\"\n  areas(after: String, first: Int): AreaConnection\n\n  \"\"\"The list of artists found in this collection.\"\"\"\n  artists(after: String, first: Int): ArtistConnection\n\n  \"\"\"The list of events found in this collection.\"\"\"\n  events(after: String, first: Int): EventConnection\n\n  \"\"\"The list of instruments found in this collection.\"\"\"\n  instruments(after: String, first: Int): InstrumentConnection\n\n  \"\"\"The list of labels found in this collection.\"\"\"\n  labels(after: String, first: Int): LabelConnection\n\n  \"\"\"The list of places found in this collection.\"\"\"\n  places(after: String, first: Int): PlaceConnection\n\n  \"\"\"The list of recordings found in this collection.\"\"\"\n  recordings(after: String, first: Int): RecordingConnection\n\n  \"\"\"The list of releases found in this collection.\"\"\"\n  releases(\n    \"\"\"Filter by one or more release group types.\"\"\"\n    type: [ReleaseGroupType]\n\n    \"\"\"Filter by one or more release statuses.\"\"\"\n    status: [ReleaseStatus]\n    after: String\n    first: Int\n  ): ReleaseConnection\n\n  \"\"\"The list of release groups found in this collection.\"\"\"\n  releaseGroups(\n    \"\"\"Filter by one or more release group types.\"\"\"\n    type: [ReleaseGroupType]\n    after: String\n    first: Int\n  ): ReleaseGroupConnection\n\n  \"\"\"The list of series found in this collection.\"\"\"\n  series(after: String, first: Int): SeriesConnection\n\n  \"\"\"The list of works found in this collection.\"\"\"\n  works(after: String, first: Int): WorkConnection\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype CollectionConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [CollectionEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the\n  `edges` field).\n  \"\"\"\n  nodes: [Collection]\n\n  \"\"\"\n  A count of the total number of items in this connection,\n  ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype CollectionEdge {\n  \"\"\"The item at the end of the edge\"\"\"\n  node: Collection\n\n  \"\"\"A cursor for use in pagination\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The relevancy score (0–100) assigned by the search engine, if\n  these results were found through a search.\n  \"\"\"\n  score: Int\n}\n\n\"\"\"Geographic coordinates described with latitude and longitude.\"\"\"\ntype Coordinates {\n  \"\"\"The north–south position of a point on the Earth’s surface.\"\"\"\n  latitude: Degrees\n\n  \"\"\"The east–west position of a point on the Earth’s surface.\"\"\"\n  longitude: Degrees\n}\n\n\"\"\"\nAn individual piece of album artwork from the [Cover Art Archive](https://musicbrainz.org/doc/Cover_Art_Archive).\n\"\"\"\ntype CoverArtArchiveImage {\n  \"\"\"The Internet Archive’s internal file ID for the image.\"\"\"\n  fileID: String!\n\n  \"\"\"The URL at which the image can be found.\"\"\"\n  image: URLString!\n\n  \"\"\"A set of thumbnails for the image.\"\"\"\n  thumbnails: CoverArtArchiveImageThumbnails!\n\n  \"\"\"Whether this image depicts the “main front” of the release.\"\"\"\n  front: Boolean!\n\n  \"\"\"Whether this image depicts the “main back” of the release.\"\"\"\n  back: Boolean!\n\n  \"\"\"\n  A list of [image types](https://musicbrainz.org/doc/Cover_Art/Types)\n  describing what part(s) of the release the image includes.\n  \"\"\"\n  types: [String]!\n\n  \"\"\"The MusicBrainz edit ID.\"\"\"\n  edit: Int\n\n  \"\"\"Whether the image was approved by the MusicBrainz edit system.\"\"\"\n  approved: Boolean\n\n  \"\"\"A free-text comment left for the image.\"\"\"\n  comment: String\n}\n\n\"\"\"\nThe image sizes that may be requested at the [Cover Art Archive](https://musicbrainz.org/doc/Cover_Art_Archive).\n\"\"\"\nenum CoverArtArchiveImageSize {\n  \"\"\"A maximum dimension of 250px.\"\"\"\n  SMALL\n\n  \"\"\"A maximum dimension of 500px.\"\"\"\n  LARGE\n\n  \"\"\"The image’s original dimensions, with no maximum.\"\"\"\n  FULL\n}\n\n\"\"\"\nURLs for thumbnails of different sizes for a particular piece of cover art.\n\"\"\"\ntype CoverArtArchiveImageThumbnails {\n  \"\"\"\n  The URL of a small version of the cover art, where the maximum dimension is\n  250px.\n  \"\"\"\n  small: URLString\n\n  \"\"\"\n  The URL of a large version of the cover art, where the maximum dimension is\n  500px.\n  \"\"\"\n  large: URLString\n}\n\n\"\"\"\nAn object containing a list of the cover art images for a release obtained\nfrom the [Cover Art Archive](https://musicbrainz.org/doc/Cover_Art_Archive),\nas well as a summary of what artwork is available.\n\"\"\"\ntype CoverArtArchiveRelease {\n  \"\"\"\n  The URL of an image depicting the album cover or “main front” of the release,\n  i.e. the front of the packaging of the audio recording (or in the case of a\n  digital release, the image associated with it in a digital media store).\n  \n  In the MusicBrainz schema, this field is a Boolean value indicating the\n  presence of a front image, whereas here the value is the URL for the image\n  itself if one exists. You can check for null if you just want to determine\n  the presence of an image.\n  \"\"\"\n  front(\n    \"\"\"\n    The size of the image to retrieve. By default, the returned image will\n    have its full original dimensions, but certain thumbnail sizes may be\n    retrieved as well.\n    \"\"\"\n    size: CoverArtArchiveImageSize = FULL\n  ): URLString\n\n  \"\"\"\n  The URL of an image depicting the “main back” of the release, i.e. the back\n  of the packaging of the audio recording.\n  \n  In the MusicBrainz schema, this field is a Boolean value indicating the\n  presence of a back image, whereas here the value is the URL for the image\n  itself. You can check for null if you just want to determine the presence of\n  an image.\n  \"\"\"\n  back(\n    \"\"\"\n    The size of the image to retrieve. By default, the returned image will\n    have its full original dimensions, but certain thumbnail sizes may be\n    retrieved as well.\n    \"\"\"\n    size: CoverArtArchiveImageSize = FULL\n  ): URLString\n\n  \"\"\"\n  A list of images depicting the different sides and surfaces of a release’s\n  media and packaging.\n  \"\"\"\n  images: [CoverArtArchiveImage]!\n\n  \"\"\"Whether there is artwork present for this release.\"\"\"\n  artwork: Boolean!\n\n  \"\"\"The number of artwork images present for this release.\"\"\"\n  count: Int!\n\n  \"\"\"The particular release shown in the returned cover art.\"\"\"\n  release: Release\n}\n\n\"\"\"Year, month (optional), and day (optional) in YYYY-MM-DD format.\"\"\"\nscalar Date\n\n\"\"\"Decimal degrees, used for latitude and longitude.\"\"\"\nscalar Degrees\n\n\"\"\"\nInformation about the physical CD and releases associated with a\nparticular [disc ID](https://musicbrainz.org/doc/Disc_ID).\n\"\"\"\ntype Disc implements Node {\n  \"\"\"The ID of an object\"\"\"\n  id: ID!\n\n  \"\"\"The [disc ID](https://musicbrainz.org/doc/Disc_ID) of this disc.\"\"\"\n  discID: DiscID!\n\n  \"\"\"The number of offsets (tracks) on the disc.\"\"\"\n  offsetCount: Int!\n\n  \"\"\"The sector offset of each track on the disc.\"\"\"\n  offsets: [Int]\n\n  \"\"\"The sector offset of the lead-out (the end of the disc).\"\"\"\n  sectors: Int!\n\n  \"\"\"The list of releases linked to this disc ID.\"\"\"\n  releases(after: String, first: Int): ReleaseConnection\n}\n\n\"\"\"\n[Disc ID](https://musicbrainz.org/doc/Disc_ID) is the code\nnumber which MusicBrainz uses to link a physical CD to a [release](https://musicbrainz.org/doc/Release)\nlisting.\n\nA release may have any number of disc IDs, and a disc ID may be linked to\nmultiple releases. This is because disc ID calculation involves a hash of the\nframe offsets of the CD tracks.\n\nDifferent pressing of a CD often have slightly different frame offsets, and\nhence different disc IDs.\n\nConversely, two different CDs may happen to have exactly the same set of frame\noffsets and hence the same disc ID.\n\"\"\"\nscalar DiscID\n\n\"\"\"An artist on Discogs.\"\"\"\ntype DiscogsArtist {\n  \"\"\"The ID of the artist on Discogs.\"\"\"\n  artistID: ID!\n\n  \"\"\"The name of the artist on Discogs.\"\"\"\n  name: String!\n\n  \"\"\"Commonly found variations of the artist’s name.\"\"\"\n  nameVariations: [String!]!\n\n  \"\"\"\n  The artist’s real name, if the artist is a person who uses a stage name.\n  \"\"\"\n  realName: String\n\n  \"\"\"\n  A list of Discogs artists that represent the same artist under a different\n  alias.\n  \"\"\"\n  aliases: [DiscogsArtist!]!\n\n  \"\"\"The URL of the artist’s page on Discogs.\"\"\"\n  url: URLString!\n\n  \"\"\"Links to the artist’s official pages on different web properties.\"\"\"\n  urls: [URLString!]!\n\n  \"\"\"A biography or description of the artist.\"\"\"\n  profile: String\n\n  \"\"\"A list of images picturing the artist.\"\"\"\n  images: [DiscogsImage!]!\n\n  \"\"\"A list of members, if the artist is a group.\"\"\"\n  members: [DiscogsArtistMember!]!\n\n  \"\"\"\n  A description of the quality and completeness of this artist’s data in the\n  Discogs database.\n  \"\"\"\n  dataQuality: String\n}\n\n\"\"\"A credited artist on a release, track, etc.\"\"\"\ntype DiscogsArtistCredit {\n  \"\"\"The official or common name of the credited artist.\"\"\"\n  name: String\n\n  \"\"\"\n  The artist name as credited on this particular work (the Artist Name\n  Variation, or ANV, in Discogs terms).\n  \"\"\"\n  nameVariation: String\n\n  \"\"\"\n  Join phrases might include words and/or punctuation to separate artist\n  names as they appear on the release, track, etc.\n  \"\"\"\n  joinPhrase: String\n\n  \"\"\"A list of roles the artist had on the work in question.\"\"\"\n  roles: [String!]!\n\n  \"\"\"\n  A list of tracks or track ranges (e.g. “A1 to A4”) on which the artist is\n  credited.\n  \"\"\"\n  tracks: [String!]!\n\n  \"\"\"The artist’s entry on Discogs.\"\"\"\n  artist: DiscogsArtist\n}\n\n\"\"\"A single artist who is a member of a group on Discogs.\"\"\"\ntype DiscogsArtistMember {\n  \"\"\"Whether or not the member is still active in the group.\"\"\"\n  active: Boolean\n\n  \"\"\"The name of the member.\"\"\"\n  name: String!\n\n  \"\"\"The member’s artist information on Discogs.\"\"\"\n  artist: DiscogsArtist\n}\n\n\"\"\"Community statistics regarding an item on Discogs.\"\"\"\ntype DiscogsCommunity {\n  \"\"\"The acceptance status.\"\"\"\n  status: String\n\n  \"\"\"Information about how Discogs users have rated the item.\"\"\"\n  rating: DiscogsRating\n\n  \"\"\"The number of Discogs users who have the item in their collection.\"\"\"\n  haveCount: Int\n\n  \"\"\"The number of Discogs users who want the item.\"\"\"\n  wantCount: Int\n\n  \"\"\"The Discogs users who have contributed to the item’s data.\"\"\"\n  contributors: [DiscogsUser!]!\n\n  \"\"\"The Discogs user who submitted the item.\"\"\"\n  submitter: DiscogsUser\n}\n\n\"\"\"A single image from Discogs.\"\"\"\ntype DiscogsImage {\n  \"\"\"The URL of the image file.\"\"\"\n  url: URLString!\n\n  \"\"\"The image type, primary or secondary.\"\"\"\n  type: DiscogsImageType!\n\n  \"\"\"The image width in pixels.\"\"\"\n  width: Int!\n\n  \"\"\"The image height in pixels.\"\"\"\n  height: Int!\n\n  \"\"\"The URL for a 150x150 thumbnail of the image.\"\"\"\n  thumbnail: URLString\n}\n\n\"\"\"The type of image.\"\"\"\nenum DiscogsImageType {\n  \"\"\"The primary image representing the item.\"\"\"\n  PRIMARY\n\n  \"\"\"A secondary image representing the item.\"\"\"\n  SECONDARY\n}\n\n\"\"\"A label on Discogs.\"\"\"\ntype DiscogsLabel {\n  \"\"\"The ID of the label on Discogs.\"\"\"\n  labelID: ID!\n\n  \"\"\"The name of the label.\"\"\"\n  name: String!\n\n  \"\"\"The URL of the label on Discogs.\"\"\"\n  url: URLString!\n\n  \"\"\"A description of the history of the label.\"\"\"\n  profile: String\n\n  \"\"\"Information on how to contact a representative of the label.\"\"\"\n  contactInfo: String\n\n  \"\"\"The parent label, if this label is a subsidiary.\"\"\"\n  parentLabel: DiscogsLabel\n\n  \"\"\"A list of labels that are subsidiaries of this label.\"\"\"\n  subLabels: [DiscogsLabel!]!\n\n  \"\"\"A list of images associated with the label.\"\"\"\n  images: [DiscogsImage!]!\n\n  \"\"\"\n  A description of the quality and completeness of this label’s data in the\n  Discogs database.\n  \"\"\"\n  dataQuality: String\n}\n\n\"\"\"\nMaster releases group different versions of the same release (for example,\nreleases in different formats, issued in different countries, re-releases,\netc.). The equivalent of a MusicBrainz release group.\n\"\"\"\ntype DiscogsMaster {\n  \"\"\"The ID of the master on Discogs.\"\"\"\n  masterID: ID!\n\n  \"\"\"The title of the master.\"\"\"\n  title: String!\n\n  \"\"\"The URL of the master on Discogs.\"\"\"\n  url: URLString!\n\n  \"\"\"The artists credited on the master.\"\"\"\n  artistCredits: [DiscogsArtistCredit!]!\n\n  \"\"\"The primary musical genres of the master (e.g. “Electronic”).\"\"\"\n  genres: [String!]!\n\n  \"\"\"The primary musical styles of the master (e.g. “Techno”, “Minimal”).\"\"\"\n  styles: [String!]!\n\n  \"\"\"The number of listings the master currently has on the marketplace.\"\"\"\n  forSaleCount: Int\n\n  \"\"\"The lowest price for the master currently found on the marketplace.\"\"\"\n  lowestPrice(\n    \"\"\"\n    The three-letter currency code for which to retrieve the price. Discogs\n    supports USD, GBP, EUR, CAD, AUD, JPY, CHF, MXN, BRL, NZD, SEK, and ZAR.\n    #\n    [NOT YET WORKING]\n    \"\"\"\n    currency: String\n  ): Float\n\n  \"\"\"The year the master was released (most likely its “main” release).\"\"\"\n  year: Int\n\n  \"\"\"The main release from the master.\"\"\"\n  mainRelease: DiscogsRelease\n\n  \"\"\"Images of the master.\"\"\"\n  images: [DiscogsImage!]!\n\n  \"\"\"Music videos from the master.\"\"\"\n  videos: [DiscogsVideo!]!\n\n  \"\"\"\n  A description of the quality and completeness of this master’s data in the\n  Discogs database.\n  \"\"\"\n  dataQuality: String\n}\n\n\"\"\"An aggregated rating on Discogs.\"\"\"\ntype DiscogsRating {\n  \"\"\"The number of users who have contributed to the rating.\"\"\"\n  voteCount: Int!\n\n  \"\"\"The average rating as determined by users.\"\"\"\n  value: Float\n}\n\n\"\"\"A release on Discogs.\"\"\"\ntype DiscogsRelease {\n  \"\"\"The ID of the release on Discogs.\"\"\"\n  releaseID: ID!\n\n  \"\"\"The title of the release.\"\"\"\n  title: String!\n\n  \"\"\"The URL of the release on Discogs.\"\"\"\n  url: URLString!\n\n  \"\"\"The artists credited on the release.\"\"\"\n  artistCredits: [DiscogsArtistCredit!]!\n\n  \"\"\"\n  An additional list of artists who contributed to the release, but are not\n  named in the release’s artists.\n  \"\"\"\n  extraArtistCredits: [DiscogsArtistCredit!]!\n\n  \"\"\"The primary musical genres of the release (e.g. “Electronic”).\"\"\"\n  genres: [String!]!\n\n  \"\"\"The primary musical styles of the release (e.g. “Techno”, “Minimal”).\"\"\"\n  styles: [String!]!\n\n  \"\"\"The number of listings the release currently has on the marketplace.\"\"\"\n  forSaleCount: Int\n\n  \"\"\"The lowest price for the release currently found on the marketplace.\"\"\"\n  lowestPrice(\n    \"\"\"\n    The three-letter currency code for which to retrieve the price. Discogs\n    supports USD, GBP, EUR, CAD, AUD, JPY, CHF, MXN, BRL, NZD, SEK, and ZAR.\n    #\n    [NOT YET WORKING]\n    \"\"\"\n    currency: String\n  ): Float\n\n  \"\"\"The year the release was issued.\"\"\"\n  year: Int\n\n  \"\"\"Notes about the release.\"\"\"\n  notes: String\n\n  \"\"\"The country in which the release was issued.\"\"\"\n  country: String\n\n  \"\"\"The master release on Discogs.\"\"\"\n  master: DiscogsMaster\n\n  \"\"\"The primary thumbnail image for the release.\"\"\"\n  thumbnail: URLString\n\n  \"\"\"Images of the release.\"\"\"\n  images: [DiscogsImage!]!\n\n  \"\"\"Music videos from the release.\"\"\"\n  videos: [DiscogsVideo!]!\n\n  \"\"\"\n  Information about the Discogs community’s contributions to the release’s\n  data.\n  \"\"\"\n  community: DiscogsCommunity\n\n  \"\"\"\n  A description of the quality and completeness of this release’s data in\n  the Discogs database.\n  \"\"\"\n  dataQuality: String\n}\n\n\"\"\"A connection to a list of Discogs releases.\"\"\"\ntype DiscogsReleaseConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [DiscogsReleaseEdge!]!\n\n  \"\"\"\n  A list of nodes in the connection (without going through the `edges` field).\n  \"\"\"\n  nodes: [DiscogsRelease!]!\n\n  \"\"\"\n  A count of the total number of items in this connection, ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a Discogs release connection.\"\"\"\ntype DiscogsReleaseEdge {\n  \"\"\"The release at the end of the edge.\"\"\"\n  node: DiscogsRelease!\n}\n\n\"\"\"A user on Discogs.\"\"\"\ntype DiscogsUser {\n  \"\"\"The user’s username on Discogs.\"\"\"\n  username: String!\n}\n\n\"\"\"A single video linked from Discogs.\"\"\"\ntype DiscogsVideo {\n  \"\"\"The URL of the video.\"\"\"\n  url: URLString!\n\n  \"\"\"The title of the video.\"\"\"\n  title: String\n\n  \"\"\"The video description.\"\"\"\n  description: String\n\n  \"\"\"The duration of the video in milliseconds.\"\"\"\n  duration: Duration\n\n  \"\"\"Whether the video is embeddable.\"\"\"\n  embed: Boolean\n}\n\n\"\"\"A length of time, in milliseconds.\"\"\"\nscalar Duration\n\n\"\"\"An entity in the MusicBrainz schema.\"\"\"\ninterface Entity {\n  \"\"\"The MBID of the entity.\"\"\"\n  mbid: MBID!\n}\n\n\"\"\"\nAn [event](https://musicbrainz.org/doc/Event) refers to an\norganised event which people can attend, and is relevant to MusicBrainz.\nGenerally this means live performances, like concerts and festivals.\n\"\"\"\ntype Event implements Node & Entity {\n  \"\"\"The ID of an object\"\"\"\n  id: ID!\n\n  \"\"\"The MBID of the entity.\"\"\"\n  mbid: MBID!\n\n  \"\"\"The official name of the entity.\"\"\"\n  name: String\n\n  \"\"\"A comment used to help distinguish identically named entitites.\"\"\"\n  disambiguation: String\n\n  \"\"\"\n  [Aliases](https://musicbrainz.org/doc/Aliases) are used to store\n  alternate names or misspellings.\n  \"\"\"\n  aliases: [Alias]\n\n  \"\"\"\n  The begin and end dates of the entity’s existence. Its exact\n  meaning depends on the type of entity.\n  \"\"\"\n  lifeSpan: LifeSpan\n\n  \"\"\"The start time of the event.\"\"\"\n  time: Time\n\n  \"\"\"Whether or not the event took place.\"\"\"\n  cancelled: Boolean\n\n  \"\"\"\n  A list of songs performed, optionally including links to\n  artists and works. See the [setlist documentation](https://musicbrainz.org/doc/Event/Setlist)\n  for syntax and examples.\n  \"\"\"\n  setlist: String\n\n  \"\"\"What kind of event the event is, e.g. concert, festival, etc.\"\"\"\n  type: String\n\n  \"\"\"\n  The MBID associated with the value of the `type`\n  field.\n  \"\"\"\n  typeID: MBID\n\n  \"\"\"Relationships between this entity and other entitites.\"\"\"\n  relationships: Relationships\n\n  \"\"\"A list of collections containing this entity.\"\"\"\n  collections(after: String, first: Int): CollectionConnection\n\n  \"\"\"The rating users have given to this entity.\"\"\"\n  rating: Rating\n\n  \"\"\"A list of tags linked to this entity.\"\"\"\n  tags(after: String, first: Int): TagConnection\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype EventConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [EventEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the\n  `edges` field).\n  \"\"\"\n  nodes: [Event]\n\n  \"\"\"\n  A count of the total number of items in this connection,\n  ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype EventEdge {\n  \"\"\"The item at the end of the edge\"\"\"\n  node: Event\n\n  \"\"\"A cursor for use in pagination\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The relevancy score (0–100) assigned by the search engine, if\n  these results were found through a search.\n  \"\"\"\n  score: Int\n}\n\n\"\"\"\nAn object containing lists of the different types of release group images from\n[fanart.tv](https://fanart.tv/).\n\"\"\"\ntype FanArtAlbum {\n  \"\"\"\n  A list of 1000x1000 JPG images of the cover artwork of the release group.\n  \"\"\"\n  albumCovers: [FanArtImage]\n\n  \"\"\"\n  A list of 1000x1000 PNG images of the physical disc media for the release\n  group, with transparent backgrounds.\n  \"\"\"\n  discImages: [FanArtDiscImage]\n}\n\n\"\"\"\nAn object containing lists of the different types of artist images from\n[fanart.tv](https://fanart.tv/).\n\"\"\"\ntype FanArtArtist {\n  \"\"\"\n  A list of 1920x1080 JPG images picturing the artist, suitable for use as\n  backgrounds.\n  \"\"\"\n  backgrounds: [FanArtImage]\n\n  \"\"\"\n  A list of 1000x185 JPG images containing the artist and their logo or name.\n  \"\"\"\n  banners: [FanArtImage]\n\n  \"\"\"\n  A list of 400x155 PNG images containing the artist’s logo or name, with\n  transparent backgrounds.\n  \"\"\"\n  logos: [FanArtImage]\n\n  \"\"\"\n  A list of 800x310 PNG images containing the artist’s logo or name, with\n  transparent backgrounds.\n  \"\"\"\n  logosHD: [FanArtImage]\n\n  \"\"\"\n  A list of 1000x1000 JPG thumbnail images picturing the artist (usually\n  containing every member of a band).\n  \"\"\"\n  thumbnails: [FanArtImage]\n}\n\n\"\"\"A disc image from [fanart.tv](https://fanart.tv/).\"\"\"\ntype FanArtDiscImage {\n  \"\"\"The ID of the image on fanart.tv.\"\"\"\n  imageID: ID\n\n  \"\"\"The URL of the image.\"\"\"\n  url(\n    \"\"\"The size of the image to retrieve.\"\"\"\n    size: FanArtImageSize = FULL\n  ): URLString\n\n  \"\"\"The number of likes the image has received by fanart.tv users.\"\"\"\n  likeCount: Int\n\n  \"\"\"The disc number.\"\"\"\n  discNumber: Int\n\n  \"\"\"The width and height of the (square) disc image.\"\"\"\n  size: Int\n}\n\n\"\"\"A single image from [fanart.tv](https://fanart.tv/).\"\"\"\ntype FanArtImage {\n  \"\"\"The ID of the image on fanart.tv.\"\"\"\n  imageID: ID\n\n  \"\"\"The URL of the image.\"\"\"\n  url(\n    \"\"\"The size of the image to retrieve.\"\"\"\n    size: FanArtImageSize = FULL\n  ): URLString\n\n  \"\"\"The number of likes the image has received by fanart.tv users.\"\"\"\n  likeCount: Int\n}\n\n\"\"\"\nThe image sizes that may be requested at [fanart.tv](https://fanart.tv/).\n\"\"\"\nenum FanArtImageSize {\n  \"\"\"The image’s full original dimensions.\"\"\"\n  FULL\n\n  \"\"\"A maximum dimension of 200px.\"\"\"\n  PREVIEW\n}\n\n\"\"\"\nAn object containing lists of the different types of label images from\n[fanart.tv](https://fanart.tv/).\n\"\"\"\ntype FanArtLabel {\n  \"\"\"\n  A list of 400x270 PNG images containing the label’s logo. There will\n  usually be a black version, a color version, and a white version, all with\n  transparent backgrounds.\n  \"\"\"\n  logos: [FanArtLabelImage]\n}\n\n\"\"\"A music label image from [fanart.tv](https://fanart.tv/).\"\"\"\ntype FanArtLabelImage {\n  \"\"\"The ID of the image on fanart.tv.\"\"\"\n  imageID: ID\n\n  \"\"\"The URL of the image.\"\"\"\n  url(\n    \"\"\"The size of the image to retrieve.\"\"\"\n    size: FanArtImageSize = FULL\n  ): URLString\n\n  \"\"\"The number of likes the image has received by fanart.tv users.\"\"\"\n  likeCount: Int\n\n  \"\"\"The type of color content in the image (usually “white” or “colour”).\"\"\"\n  color: String\n}\n\n\"\"\"\n[Instruments](https://musicbrainz.org/doc/Instrument) are\ndevices created or adapted to make musical sounds. Instruments are primarily\nused in relationships between two other entities.\n\"\"\"\ntype Instrument implements Node & Entity {\n  \"\"\"The ID of an object\"\"\"\n  id: ID!\n\n  \"\"\"The MBID of the entity.\"\"\"\n  mbid: MBID!\n\n  \"\"\"The official name of the entity.\"\"\"\n  name: String\n\n  \"\"\"A comment used to help distinguish identically named entitites.\"\"\"\n  disambiguation: String\n\n  \"\"\"\n  [Aliases](https://musicbrainz.org/doc/Aliases) are used to store\n  alternate names or misspellings.\n  \"\"\"\n  aliases: [Alias]\n\n  \"\"\"\n  A brief description of the main characteristics of the\n  instrument.\n  \"\"\"\n  description: String\n\n  \"\"\"\n  The type categorises the instrument by the way the sound is\n  created, similar to the [Hornbostel-Sachs](https://en.wikipedia.org/wiki/Hornbostel%E2%80%93Sachs)\n  classification.\n  \"\"\"\n  type: String\n\n  \"\"\"\n  The MBID associated with the value of the `type`\n  field.\n  \"\"\"\n  typeID: MBID\n\n  \"\"\"Relationships between this entity and other entitites.\"\"\"\n  relationships: Relationships\n\n  \"\"\"A list of collections containing this entity.\"\"\"\n  collections(after: String, first: Int): CollectionConnection\n\n  \"\"\"A list of tags linked to this entity.\"\"\"\n  tags(after: String, first: Int): TagConnection\n\n  \"\"\"\n  Instrument images found at MediaWiki URLs in the instrument’s URL\n  relationships. Defaults to URL relationships with the type “image”.\n  This field is provided by the MediaWiki extension.\n  \"\"\"\n  mediaWikiImages(\n    \"\"\"\n    The type of URL relationship that will be selected to find images. See the\n    possible [Instrument-URL relationship types](https://musicbrainz.org/relationships/instrument-url).\n    \"\"\"\n    type: String = \"image\"\n  ): [MediaWikiImage]!\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype InstrumentConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [InstrumentEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the\n  `edges` field).\n  \"\"\"\n  nodes: [Instrument]\n\n  \"\"\"\n  A count of the total number of items in this connection,\n  ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype InstrumentEdge {\n  \"\"\"The item at the end of the edge\"\"\"\n  node: Instrument\n\n  \"\"\"A cursor for use in pagination\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The relevancy score (0–100) assigned by the search engine, if\n  these results were found through a search.\n  \"\"\"\n  score: Int\n}\n\n\"\"\"\nAn [Interested Parties Information](https://musicbrainz.org/doc/IPI)\n(IPI) code is an identifying number assigned by the CISAC database for musical\nrights management.\n\"\"\"\nscalar IPI\n\n\"\"\"\nThe [International Standard Name Identifier](https://musicbrainz.org/doc/ISNI)\n(ISNI) is an ISO standard for uniquely identifying the public identities of\ncontributors to media content.\n\"\"\"\nscalar ISNI\n\n\"\"\"\nThe [International Standard Recording Code](https://musicbrainz.org/doc/ISRC)\n(ISRC) is an identification system for audio and music video recordings. It is\nstandarized by the [IFPI](http://www.ifpi.org/) in ISO 3901:2001 and used by\nIFPI members to assign a unique identifier to every distinct sound recording\nthey release. An ISRC identifies a particular [sound recording](https://musicbrainz.org/doc/Recording),\nnot the song itself. Therefore, different recordings, edits, remixes and\nremasters of the same song will each be assigned their own ISRC. However, note\nthat same recording should carry the same ISRC in all countries/territories.\nSongs are identified by analogous [International Standard Musical Work Codes](https://musicbrainz.org/doc/ISWC)\n(ISWCs).\n\"\"\"\nscalar ISRC\n\n\"\"\"\nThe [International Standard Musical Work Code](https://musicbrainz.org/doc/ISWC)\n(ISWC) is an ISO standard similar to ISBNs for identifying musical works /\ncompositions.\n\"\"\"\nscalar ISWC\n\n\"\"\"\n[Labels](https://musicbrainz.org/doc/Label) represent mostly\n(but not only) imprints. To a lesser extent, a label entity may be created to\nrepresent a record company.\n\"\"\"\ntype Label implements Node & Entity {\n  \"\"\"The ID of an object\"\"\"\n  id: ID!\n\n  \"\"\"The MBID of the entity.\"\"\"\n  mbid: MBID!\n\n  \"\"\"The official name of the entity.\"\"\"\n  name: String\n\n  \"\"\"\n  The string to use for the purpose of ordering by name (for\n  example, by moving articles like ‘the’ to the end or a person’s last name to\n  the front).\n  \"\"\"\n  sortName: String\n\n  \"\"\"A comment used to help distinguish identically named entitites.\"\"\"\n  disambiguation: String\n\n  \"\"\"\n  [Aliases](https://musicbrainz.org/doc/Aliases) are used to store\n  alternate names or misspellings.\n  \"\"\"\n  aliases: [Alias]\n\n  \"\"\"The country of origin for the label.\"\"\"\n  country: String\n\n  \"\"\"The area in which the label is based.\"\"\"\n  area: Area\n\n  \"\"\"\n  The begin and end dates of the entity’s existence. Its exact\n  meaning depends on the type of entity.\n  \"\"\"\n  lifeSpan: LifeSpan\n\n  \"\"\"\n  The [“LC” code](https://musicbrainz.org/doc/Label/Label_Code)\n  of the label.\n  \"\"\"\n  labelCode: Int\n\n  \"\"\"\n  List of [Interested Parties Information](https://musicbrainz.org/doc/IPI)\n  codes for the label.\n  \"\"\"\n  ipis: [IPI]\n\n  \"\"\"\n  A type describing the main activity of the label, e.g.\n  imprint, production, distributor, rights society, etc.\n  \"\"\"\n  type: String\n\n  \"\"\"\n  The MBID associated with the value of the `type`\n  field.\n  \"\"\"\n  typeID: MBID\n\n  \"\"\"A list of releases linked to this entity.\"\"\"\n  releases(\n    \"\"\"Filter by one or more release group types.\"\"\"\n    type: [ReleaseGroupType]\n\n    \"\"\"Filter by one or more release statuses.\"\"\"\n    status: [ReleaseStatus]\n    after: String\n    first: Int\n  ): ReleaseConnection\n\n  \"\"\"Relationships between this entity and other entitites.\"\"\"\n  relationships: Relationships\n\n  \"\"\"A list of collections containing this entity.\"\"\"\n  collections(after: String, first: Int): CollectionConnection\n\n  \"\"\"The rating users have given to this entity.\"\"\"\n  rating: Rating\n\n  \"\"\"A list of tags linked to this entity.\"\"\"\n  tags(after: String, first: Int): TagConnection\n\n  \"\"\"\n  Images of the label from [fanart.tv](https://fanart.tv/).\n  This field is provided by the fanart.tv extension.\n  \"\"\"\n  fanArt: FanArtLabel\n\n  \"\"\"\n  Label images found at MediaWiki URLs in the label’s URL relationships.\n  Defaults to URL relationships with the type “logo”.\n  This field is provided by the MediaWiki extension.\n  \"\"\"\n  mediaWikiImages(\n    \"\"\"\n    The type of URL relationship that will be selected to find images. See the\n    possible [Label-URL relationship types](https://musicbrainz.org/relationships/label-url).\n    \"\"\"\n    type: String = \"logo\"\n  ): [MediaWikiImage]!\n\n  \"\"\"Information about the label on Discogs.\"\"\"\n  discogs: DiscogsLabel\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype LabelConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [LabelEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the\n  `edges` field).\n  \"\"\"\n  nodes: [Label]\n\n  \"\"\"\n  A count of the total number of items in this connection,\n  ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype LabelEdge {\n  \"\"\"The item at the end of the edge\"\"\"\n  node: Label\n\n  \"\"\"A cursor for use in pagination\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The relevancy score (0–100) assigned by the search engine, if\n  these results were found through a search.\n  \"\"\"\n  score: Int\n}\n\n\"\"\"\nAn album on [Last.fm](https://www.last.fm/) corresponding with a MusicBrainz\nRelease.\n\"\"\"\ntype LastFMAlbum {\n  \"\"\"The MBID of the corresponding MusicBrainz release.\"\"\"\n  mbid: MBID\n\n  \"\"\"The title of the album according to [Last.fm](https://www.last.fm/).\"\"\"\n  title: String\n\n  \"\"\"The URL for the album on [Last.fm](https://www.last.fm/).\"\"\"\n  url: URLString!\n\n  \"\"\"An image of the cover artwork of the release.\"\"\"\n  image(\n    \"\"\"The size of the image to retrieve.\"\"\"\n    size: LastFMImageSize\n  ): URLString\n\n  \"\"\"The number of listeners recorded for the album.\"\"\"\n  listenerCount: Float\n\n  \"\"\"The number of plays recorded for the album.\"\"\"\n  playCount: Float\n\n  \"\"\"\n  Historical information written about the album, often available in several\n  languages.\n  \"\"\"\n  description(\n    \"\"\"\n    The two-letter code for the language in which to retrieve the description.\n    \"\"\"\n    lang: String\n  ): LastFMWikiContent\n\n  \"\"\"\n  The artist who released the album. This returns the Last.fm artist info,\n  not the MusicBrainz artist.\n  \"\"\"\n  artist: LastFMArtist\n\n  \"\"\"A list of tags applied to the artist by users, ordered by popularity.\"\"\"\n  topTags(\n    \"\"\"The maximum number of tags to retrieve.\"\"\"\n    first: Int = 25\n\n    \"\"\"The cursor of the edge after which more tags will be retrieved.\"\"\"\n    after: String\n  ): LastFMTagConnection\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype LastFMAlbumConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [LastFMAlbumEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the `edges` field).\n  \"\"\"\n  nodes: [LastFMAlbum]\n\n  \"\"\"\n  A count of the total number of items in this connection, ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype LastFMAlbumEdge {\n  \"\"\"The item at the end of the edge.\"\"\"\n  node: LastFMAlbum\n\n  \"\"\"A cursor for use in pagination.\"\"\"\n  cursor: String!\n}\n\n\"\"\"An artist on [Last.fm](https://www.last.fm/).\"\"\"\ntype LastFMArtist {\n  \"\"\"The MBID of the corresponding MusicBrainz artist.\"\"\"\n  mbid: MBID\n\n  \"\"\"The name of the artist according to [Last.fm](https://www.last.fm/).\"\"\"\n  name: String\n\n  \"\"\"The URL for the artist on [Last.fm](https://www.last.fm/).\"\"\"\n  url: URLString!\n\n  \"\"\"An image of the artist.\"\"\"\n  image(\n    \"\"\"The size of the image to retrieve.\"\"\"\n    size: LastFMImageSize\n  ): URLString\n\n  \"\"\"The number of listeners recorded for the artist.\"\"\"\n  listenerCount: Float\n\n  \"\"\"The number of plays recorded for the artist.\"\"\"\n  playCount: Float\n\n  \"\"\"A list of similar artists.\"\"\"\n  similarArtists(\n    \"\"\"The maximum number of artists to retrieve.\"\"\"\n    first: Int = 25\n\n    \"\"\"The cursor of the edge after which more artists will be retrieved.\"\"\"\n    after: String\n  ): LastFMArtistConnection\n\n  \"\"\"A list of the artist’s most popular albums.\"\"\"\n  topAlbums(\n    \"\"\"The maximum number of albums to retrieve.\"\"\"\n    first: Int = 25\n\n    \"\"\"The cursor of the edge after which more albums will be retrieved.\"\"\"\n    after: String\n  ): LastFMAlbumConnection\n\n  \"\"\"A list of tags applied to the artist by users, ordered by popularity.\"\"\"\n  topTags(\n    \"\"\"The maximum number of tags to retrieve.\"\"\"\n    first: Int = 25\n\n    \"\"\"The cursor of the edge after which more tags will be retrieved.\"\"\"\n    after: String\n  ): LastFMTagConnection\n\n  \"\"\"A list of the artist’s most popular tracks.\"\"\"\n  topTracks(\n    \"\"\"The maximum number of tracks to retrieve.\"\"\"\n    first: Int = 25\n\n    \"\"\"The cursor of the edge after which more tracks will be retrieved.\"\"\"\n    after: String\n  ): LastFMTrackConnection\n\n  \"\"\"A biography of the artist, often available in several languages.\"\"\"\n  biography(\n    \"\"\"\n    The two-letter code for the language in which to retrieve the biography.\n    \"\"\"\n    lang: String\n  ): LastFMWikiContent\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype LastFMArtistConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [LastFMArtistEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the `edges` field).\n  \"\"\"\n  nodes: [LastFMArtist]\n\n  \"\"\"\n  A count of the total number of items in this connection, ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype LastFMArtistEdge {\n  \"\"\"The item at the end of the edge.\"\"\"\n  node: LastFMArtist\n\n  \"\"\"A cursor for use in pagination.\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The artist similarity score (0–1) as determined by [Last.fm](https://www.last.fm/),\n  if this connection is with another artist.\n  \"\"\"\n  matchScore: Float\n}\n\n\"\"\"A query for chart data on [Last.fm](https://www.last.fm/).\"\"\"\ntype LastFMChartQuery {\n  \"\"\"\n  The most popular artists, ordered by popularity. If a country code is\n  given, retrieve the most popular artists in that country.\n  \"\"\"\n  topArtists(\n    \"\"\"\n    A two-letter [ISO 3166 country code](https://en.wikipedia.org/wiki/ISO_3166).\n    \"\"\"\n    country: String\n\n    \"\"\"The maximum number of artists to retrieve.\"\"\"\n    first: Int = 25\n\n    \"\"\"The cursor of the edge after which more artists will be retrieved.\"\"\"\n    after: String\n  ): LastFMArtistConnection\n\n  \"\"\"The most popular tags, ordered by popularity.\"\"\"\n  topTags(\n    \"\"\"The maximum number of tags to retrieve.\"\"\"\n    first: Int = 25\n\n    \"\"\"The cursor of the edge after which more tags will be retrieved.\"\"\"\n    after: String\n  ): LastFMTagConnection\n\n  \"\"\"\n  The most popular tracks, ordered by popularity. If a country code is\n  given, retrieve the most popular tracks in that country.\n  \"\"\"\n  topTracks(\n    \"\"\"\n    A two-letter [ISO 3166 country code](https://en.wikipedia.org/wiki/ISO_3166).\n    \"\"\"\n    country: String\n\n    \"\"\"The maximum number of tracks to retrieve.\"\"\"\n    first: Int = 25\n\n    \"\"\"The cursor of the edge after which more tracks will be retrieved.\"\"\"\n    after: String\n  ): LastFMTrackConnection\n}\n\n\"\"\"\nA country with chart data available on [Last.fm](https://www.last.fm/).\n\"\"\"\ntype LastFMCountry {\n  \"\"\"The top artists in this country, ordered by popularity.\"\"\"\n  topArtists(\n    \"\"\"The maximum number of artists to retrieve.\"\"\"\n    first: Int = 25\n\n    \"\"\"The cursor of the edge after which more artists will be retrieved.\"\"\"\n    after: String\n  ): LastFMArtistConnection\n\n  \"\"\"The top tracks in this country, ordered by popularity.\"\"\"\n  topTracks(\n    \"\"\"The maximum number of tracks to retrieve.\"\"\"\n    first: Int = 25\n\n    \"\"\"The cursor of the edge after which more tracks will be retrieved.\"\"\"\n    after: String\n  ): LastFMTrackConnection\n}\n\n\"\"\"\nThe image sizes that may be requested at [Last.fm](https://www.last.fm/).\n\"\"\"\nenum LastFMImageSize {\n  \"\"\"A maximum dimension of 34px.\"\"\"\n  SMALL\n\n  \"\"\"A maximum dimension of 64px.\"\"\"\n  MEDIUM\n\n  \"\"\"A maximum dimension of 174px.\"\"\"\n  LARGE\n\n  \"\"\"A maximum dimension of 300px.\"\"\"\n  EXTRALARGE\n\n  \"\"\"A maximum dimension of 300px.\"\"\"\n  MEGA\n}\n\n\"\"\"\nThe different types of [Last.fm](https://www.last.fm/) queries that can be\nmade that are not connected to any particular MusicBrainz entity.\n\"\"\"\ntype LastFMQuery {\n  \"\"\"A query for chart data.\"\"\"\n  chart: LastFMChartQuery!\n}\n\n\"\"\"A tag added by users to an entity on [Last.fm](https://www.last.fm/).\"\"\"\ntype LastFMTag {\n  \"\"\"The tag name.\"\"\"\n  name: String!\n\n  \"\"\"The URL for the tag on [Last.fm](https://www.last.fm/).\"\"\"\n  url: URLString!\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype LastFMTagConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [LastFMTagEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the `edges` field).\n  \"\"\"\n  nodes: [LastFMTag]\n\n  \"\"\"\n  A count of the total number of items in this connection, ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype LastFMTagEdge {\n  \"\"\"The item at the end of the edge.\"\"\"\n  node: LastFMTag\n\n  \"\"\"A cursor for use in pagination.\"\"\"\n  cursor: String!\n\n  \"\"\"The number of times the tag has been applied to the item in question.\"\"\"\n  tagCount: Int\n}\n\n\"\"\"\nA track on [Last.fm](https://www.last.fm/) corresponding with a MusicBrainz\nRecording.\n\"\"\"\ntype LastFMTrack {\n  \"\"\"The MBID of the corresponding MusicBrainz recording.\"\"\"\n  mbid: MBID\n\n  \"\"\"The title of the track according to [Last.fm](https://www.last.fm/).\"\"\"\n  title: String\n\n  \"\"\"The URL for the track on [Last.fm](https://www.last.fm/).\"\"\"\n  url: URLString!\n\n  \"\"\"The length of the track.\"\"\"\n  duration: Duration\n\n  \"\"\"The number of listeners recorded for the track.\"\"\"\n  listenerCount: Float\n\n  \"\"\"The number of plays recorded for the track.\"\"\"\n  playCount: Float\n\n  \"\"\"\n  Historical information written about the track, often available in several\n  languages.\n  \"\"\"\n  description(\n    \"\"\"\n    The two-letter code for the language in which to retrieve the description.\n    \"\"\"\n    lang: String\n  ): LastFMWikiContent\n\n  \"\"\"\n  The artist who released the track. This returns the Last.fm artist info,\n  not the MusicBrainz artist.\n  \"\"\"\n  artist: LastFMArtist\n\n  \"\"\"\n  The album on which the track appears. This returns the Last.fm album info,\n  not the MusicBrainz release.\n  \"\"\"\n  album: LastFMAlbum\n\n  \"\"\"A list of similar tracks.\"\"\"\n  similarTracks(\n    \"\"\"The maximum number of tracks to retrieve.\"\"\"\n    first: Int = 25\n\n    \"\"\"The cursor of the edge after which more tracks will be retrieved.\"\"\"\n    after: String\n  ): LastFMTrackConnection\n\n  \"\"\"A list of tags applied to the track by users, ordered by popularity.\"\"\"\n  topTags(\n    \"\"\"The maximum number of tags to retrieve.\"\"\"\n    first: Int = 25\n\n    \"\"\"The cursor of the edge after which more tags will be retrieved.\"\"\"\n    after: String\n  ): LastFMTagConnection\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype LastFMTrackConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [LastFMTrackEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the `edges` field).\n  \"\"\"\n  nodes: [LastFMTrack]\n\n  \"\"\"\n  A count of the total number of items in this connection, ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype LastFMTrackEdge {\n  \"\"\"The item at the end of the edge.\"\"\"\n  node: LastFMTrack\n\n  \"\"\"A cursor for use in pagination.\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The track similarity score (0–1) as determined by [Last.fm](https://www.last.fm/),\n  if this connection is with another track.\n  \"\"\"\n  matchScore: Float\n}\n\n\"\"\"\nBiographical or background information written about an entity on\n[Last.fm](https://www.last.fm/).\n\"\"\"\ntype LastFMWikiContent {\n  \"\"\"A summary of the wiki content, which may contain HTML.\"\"\"\n  summaryHTML: String\n\n  \"\"\"The full wiki content, which may contain HTML.\"\"\"\n  contentHTML: String\n\n  \"\"\"\n  The date the content was published. The data is reformatted from the\n  Last.fm API’s original format into the Date scalar format.\n  \"\"\"\n  publishDate: Date\n\n  \"\"\"\n  The time the content was published. The data is reformatted from the\n  Last.fm API’s original format into the Time scalar format. The API offers\n  no indication as to which time zone the time is in.\n  \"\"\"\n  publishTime: Time\n\n  \"\"\"The URL at which the content was published.\"\"\"\n  url: URLString\n}\n\n\"\"\"\nFields indicating the begin and end date of an entity’s\nlifetime, including whether it has ended (even if the date is unknown).\n\"\"\"\ntype LifeSpan {\n  \"\"\"The start date of the entity’s life span.\"\"\"\n  begin: Date\n\n  \"\"\"The end date of the entity’s life span.\"\"\"\n  end: Date\n\n  \"\"\"Whether or not the entity’s life span has ended.\"\"\"\n  ended: Boolean\n}\n\n\"\"\"Language code, optionally with country and encoding.\"\"\"\nscalar Locale\n\n\"\"\"A lookup of an individual MusicBrainz entity by its MBID.\"\"\"\ntype LookupQuery {\n  \"\"\"Look up a specific area by its MBID.\"\"\"\n  area(\n    \"\"\"The MBID of the entity.\"\"\"\n    mbid: MBID!\n  ): Area\n\n  \"\"\"Look up a specific artist by its MBID.\"\"\"\n  artist(\n    \"\"\"The MBID of the entity.\"\"\"\n    mbid: MBID!\n  ): Artist\n\n  \"\"\"Look up a specific collection by its MBID.\"\"\"\n  collection(\n    \"\"\"The MBID of the entity.\"\"\"\n    mbid: MBID!\n  ): Collection\n\n  \"\"\"Look up a specific physical disc by its disc ID.\"\"\"\n  disc(\n    \"\"\"\n    The [disc ID](https://musicbrainz.org/doc/Disc_ID)\n    of the disc.\n    \"\"\"\n    discID: DiscID!\n  ): Disc\n\n  \"\"\"Look up a specific event by its MBID.\"\"\"\n  event(\n    \"\"\"The MBID of the entity.\"\"\"\n    mbid: MBID!\n  ): Event\n\n  \"\"\"Look up a specific instrument by its MBID.\"\"\"\n  instrument(\n    \"\"\"The MBID of the entity.\"\"\"\n    mbid: MBID!\n  ): Instrument\n\n  \"\"\"Look up a specific label by its MBID.\"\"\"\n  label(\n    \"\"\"The MBID of the entity.\"\"\"\n    mbid: MBID!\n  ): Label\n\n  \"\"\"Look up a specific place by its MBID.\"\"\"\n  place(\n    \"\"\"The MBID of the entity.\"\"\"\n    mbid: MBID!\n  ): Place\n\n  \"\"\"Look up a specific recording by its MBID.\"\"\"\n  recording(\n    \"\"\"The MBID of the entity.\"\"\"\n    mbid: MBID!\n  ): Recording\n\n  \"\"\"Look up a specific release by its MBID.\"\"\"\n  release(\n    \"\"\"The MBID of the entity.\"\"\"\n    mbid: MBID!\n  ): Release\n\n  \"\"\"Look up a specific release group by its MBID.\"\"\"\n  releaseGroup(\n    \"\"\"The MBID of the entity.\"\"\"\n    mbid: MBID!\n  ): ReleaseGroup\n\n  \"\"\"Look up a specific series by its MBID.\"\"\"\n  series(\n    \"\"\"The MBID of the entity.\"\"\"\n    mbid: MBID!\n  ): Series\n\n  \"\"\"Look up a specific URL by its MBID.\"\"\"\n  url(\n    \"\"\"The MBID of the entity.\"\"\"\n    mbid: MBID\n\n    \"\"\"The web address of the URL entity to look up.\"\"\"\n    resource: URLString\n  ): URL\n\n  \"\"\"Look up a specific work by its MBID.\"\"\"\n  work(\n    \"\"\"The MBID of the entity.\"\"\"\n    mbid: MBID!\n  ): Work\n}\n\n\"\"\"\nThe MBID scalar represents MusicBrainz identifiers, which are\n36-character UUIDs.\n\"\"\"\nscalar MBID\n\n\"\"\"\nAn object describing various properties of an image stored on a MediaWiki\nserver. The information comes the [MediaWiki imageinfo API](https://www.mediawiki.org/wiki/API:Imageinfo).\n\"\"\"\ntype MediaWikiImage {\n  \"\"\"The URL of the actual image file.\"\"\"\n  url: URLString!\n\n  \"\"\"The URL of the wiki page describing the image.\"\"\"\n  descriptionURL: URLString\n\n  \"\"\"The user who uploaded the file.\"\"\"\n  user: String\n\n  \"\"\"The size of the file in bytes.\"\"\"\n  size: Int\n\n  \"\"\"The pixel width of the image.\"\"\"\n  width: Int\n\n  \"\"\"The pixel height of the image.\"\"\"\n  height: Int\n\n  \"\"\"The canonical title of the file.\"\"\"\n  canonicalTitle: String\n\n  \"\"\"The image title, brief description, or file name.\"\"\"\n  objectName: String\n\n  \"\"\"A description of the image, potentially containing HTML.\"\"\"\n  descriptionHTML: String\n\n  \"\"\"\n  The original date of creation of the image. May be a description rather than\n  a parseable timestamp, and may contain HTML.\n  \"\"\"\n  originalDateTimeHTML: String\n\n  \"\"\"A list of the categories of the image.\"\"\"\n  categories: [String]!\n\n  \"\"\"The name of the image author, potentially containing HTML.\"\"\"\n  artistHTML: String\n\n  \"\"\"The source of the image, potentially containing HTML.\"\"\"\n  creditHTML: String\n\n  \"\"\"A short human-readable license name.\"\"\"\n  licenseShortName: String\n\n  \"\"\"A web address where the license is described.\"\"\"\n  licenseURL: URLString\n\n  \"\"\"The full list of values in the `extmetadata` field.\"\"\"\n  metadata: [MediaWikiImageMetadata]!\n}\n\n\"\"\"An entry in the `extmetadata` field of a MediaWiki image file.\"\"\"\ntype MediaWikiImageMetadata {\n  \"\"\"The name of the metadata field.\"\"\"\n  name: String!\n\n  \"\"\"\n  The value of the metadata field. All values will be converted to strings.\n  \"\"\"\n  value: String\n\n  \"\"\"The source of the value.\"\"\"\n  source: String\n}\n\n\"\"\"\nA medium is the actual physical medium the audio content is\nstored upon. This means that each CD in a multi-disc release will be entered as\nseparate mediums within the release, and that both sides of a vinyl record or\ncassette will exist on one medium. Mediums have a format (e.g. CD, DVD, vinyl,\ncassette) and can optionally also have a title.\n\"\"\"\ntype Medium {\n  \"\"\"The title of this particular medium.\"\"\"\n  title: String\n\n  \"\"\"\n  The [format](https://musicbrainz.org/doc/Release/Format) of\n  the medium (e.g. CD, DVD, vinyl, cassette).\n  \"\"\"\n  format: String\n\n  \"\"\"\n  The MBID associated with the value of the `format`\n  field.\n  \"\"\"\n  formatID: MBID\n\n  \"\"\"\n  The order of this medium in the release (for example, in a\n  multi-disc release).\n  \"\"\"\n  position: Int\n\n  \"\"\"The number of audio tracks on this medium.\"\"\"\n  trackCount: Int\n\n  \"\"\"A list of physical discs and their disc IDs for this medium.\"\"\"\n  discs: [Disc]\n\n  \"\"\"The list of tracks on the given media.\"\"\"\n  tracks: [Track]\n}\n\n\"\"\"An object with an ID\"\"\"\ninterface Node {\n  \"\"\"The id of the object.\"\"\"\n  id: ID!\n}\n\n\"\"\"Information about pagination in a connection.\"\"\"\ntype PageInfo {\n  \"\"\"When paginating forwards, are there more items?\"\"\"\n  hasNextPage: Boolean!\n\n  \"\"\"When paginating backwards, are there more items?\"\"\"\n  hasPreviousPage: Boolean!\n\n  \"\"\"When paginating backwards, the cursor to continue.\"\"\"\n  startCursor: String\n\n  \"\"\"When paginating forwards, the cursor to continue.\"\"\"\n  endCursor: String\n}\n\n\"\"\"\nA [place](https://musicbrainz.org/doc/Place) is a venue, studio,\nor other place where music is performed, recorded, engineered, etc.\n\"\"\"\ntype Place implements Node & Entity {\n  \"\"\"The ID of an object\"\"\"\n  id: ID!\n\n  \"\"\"The MBID of the entity.\"\"\"\n  mbid: MBID!\n\n  \"\"\"The official name of the entity.\"\"\"\n  name: String\n\n  \"\"\"A comment used to help distinguish identically named entitites.\"\"\"\n  disambiguation: String\n\n  \"\"\"\n  [Aliases](https://musicbrainz.org/doc/Aliases) are used to store\n  alternate names or misspellings.\n  \"\"\"\n  aliases: [Alias]\n\n  \"\"\"\n  The address describes the location of the place using the\n  standard addressing format for the country it is located in.\n  \"\"\"\n  address: String\n\n  \"\"\"\n  The area entity representing the area, such as the city, in\n  which the place is located.\n  \"\"\"\n  area: Area\n\n  \"\"\"The geographic coordinates of the place.\"\"\"\n  coordinates: Coordinates\n\n  \"\"\"\n  The begin and end dates of the entity’s existence. Its exact\n  meaning depends on the type of entity.\n  \"\"\"\n  lifeSpan: LifeSpan\n\n  \"\"\"\n  The type categorises the place based on its primary\n  function.\n  \"\"\"\n  type: String\n\n  \"\"\"\n  The MBID associated with the value of the `type`\n  field.\n  \"\"\"\n  typeID: MBID\n\n  \"\"\"A list of events linked to this entity.\"\"\"\n  events(after: String, first: Int): EventConnection\n\n  \"\"\"Relationships between this entity and other entitites.\"\"\"\n  relationships: Relationships\n\n  \"\"\"A list of collections containing this entity.\"\"\"\n  collections(after: String, first: Int): CollectionConnection\n\n  \"\"\"A list of tags linked to this entity.\"\"\"\n  tags(after: String, first: Int): TagConnection\n\n  \"\"\"\n  Place images found at MediaWiki URLs in the place’s URL relationships.\n  Defaults to URL relationships with the type “image”.\n  This field is provided by the MediaWiki extension.\n  \"\"\"\n  mediaWikiImages(\n    \"\"\"\n    The type of URL relationship that will be selected to find images. See the\n    possible [Place-URL relationship types](https://musicbrainz.org/relationships/place-url).\n    \"\"\"\n    type: String = \"image\"\n  ): [MediaWikiImage]!\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype PlaceConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [PlaceEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the\n  `edges` field).\n  \"\"\"\n  nodes: [Place]\n\n  \"\"\"\n  A count of the total number of items in this connection,\n  ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype PlaceEdge {\n  \"\"\"The item at the end of the edge\"\"\"\n  node: Place\n\n  \"\"\"A cursor for use in pagination\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The relevancy score (0–100) assigned by the search engine, if\n  these results were found through a search.\n  \"\"\"\n  score: Int\n}\n\n\"\"\"\nThe query root, from which multiple types of MusicBrainz\nrequests can be made.\n\"\"\"\ntype Query {\n  \"\"\"Perform a lookup of a MusicBrainz entity by its MBID.\"\"\"\n  lookup: LookupQuery\n\n  \"\"\"Browse all MusicBrainz entities directly linked to another entity.\"\"\"\n  browse: BrowseQuery\n\n  \"\"\"Search for MusicBrainz entities using Lucene query syntax.\"\"\"\n  search: SearchQuery\n\n  \"\"\"Fetches an object given its ID\"\"\"\n  node(\n    \"\"\"The ID of an object\"\"\"\n    id: ID!\n  ): Node\n\n  \"\"\"\n  A query for data on [Last.fm](https://www.last.fm/) that is not connected\n  to any particular MusicBrainz entity. This field is provided by the\n  Last.fm extension.\n  \"\"\"\n  lastFM: LastFMQuery\n  spotify: SpotifyQuery!\n}\n\n\"\"\"\n[Ratings](https://musicbrainz.org/doc/Rating_System) allow users\nto rate MusicBrainz entities. User may assign a value between 1 and 5; these\nvalues are then aggregated by the server to compute an average community rating\nfor the entity.\n\"\"\"\ntype Rating {\n  \"\"\"The number of votes that have contributed to the rating.\"\"\"\n  voteCount: Int!\n\n  \"\"\"The average rating value based on the aggregated votes.\"\"\"\n  value: Float\n}\n\n\"\"\"\nA [recording](https://musicbrainz.org/doc/Recording) is an\nentity in MusicBrainz which can be linked to tracks on releases. Each track must\nalways be associated with a single recording, but a recording can be linked to\nany number of tracks.\n\nA recording represents distinct audio that has been used to produce at least one\nreleased track through copying or mastering. A recording itself is never\nproduced solely through copying or mastering.\n\nGenerally, the audio represented by a recording corresponds to the audio at a\nstage in the production process before any final mastering but after any editing\nor mixing.\n\"\"\"\ntype Recording implements Node & Entity {\n  \"\"\"The ID of an object\"\"\"\n  id: ID!\n\n  \"\"\"The MBID of the entity.\"\"\"\n  mbid: MBID!\n\n  \"\"\"The official title of the entity.\"\"\"\n  title: String\n\n  \"\"\"A comment used to help distinguish identically named entitites.\"\"\"\n  disambiguation: String\n\n  \"\"\"\n  [Aliases](https://musicbrainz.org/doc/Aliases) are used to store\n  alternate names or misspellings.\n  \"\"\"\n  aliases: [Alias]\n\n  \"\"\"The main credited artist(s).\"\"\"\n  artistCredit: [ArtistCredit] @deprecated(reason: \"The `artistCredit` field has been renamed to\\n`artistCredits`, since it is a list of credits and is referred to in the\\nplural form throughout the MusicBrainz documentation. This field is deprecated\\nand will be removed in a major release in the future. Use the equivalent\\n`artistCredits` field.\")\n\n  \"\"\"The main credited artist(s).\"\"\"\n  artistCredits: [ArtistCredit]\n\n  \"\"\"\n  A list of [International Standard Recording Codes](https://musicbrainz.org/doc/ISRC)\n  (ISRCs) for this recording.\n  \"\"\"\n  isrcs: [ISRC]\n\n  \"\"\"\n  An approximation to the length of the recording, calculated\n  from the lengths of the tracks using it.\n  \"\"\"\n  length: Duration\n\n  \"\"\"Whether this is a video recording.\"\"\"\n  video: Boolean\n\n  \"\"\"A list of artists linked to this entity.\"\"\"\n  artists(after: String, first: Int): ArtistConnection\n\n  \"\"\"A list of releases linked to this entity.\"\"\"\n  releases(\n    \"\"\"Filter by one or more release group types.\"\"\"\n    type: [ReleaseGroupType]\n\n    \"\"\"Filter by one or more release statuses.\"\"\"\n    status: [ReleaseStatus]\n    after: String\n    first: Int\n  ): ReleaseConnection\n\n  \"\"\"Relationships between this entity and other entitites.\"\"\"\n  relationships: Relationships\n\n  \"\"\"A list of collections containing this entity.\"\"\"\n  collections(after: String, first: Int): CollectionConnection\n\n  \"\"\"The rating users have given to this entity.\"\"\"\n  rating: Rating\n\n  \"\"\"A list of tags linked to this entity.\"\"\"\n  tags(after: String, first: Int): TagConnection\n\n  \"\"\"\n  Data about the recording from [TheAudioDB](http://www.theaudiodb.com/).\n  This field is provided by TheAudioDB extension.\n  \"\"\"\n  theAudioDB: TheAudioDBTrack\n\n  \"\"\"\n  Data about the recording from [Last.fm](https://www.last.fm/), a good\n  source for measuring popularity via listener and play counts. This field\n  is provided by the Last.fm extension.\n  \"\"\"\n  lastFM: LastFMTrack\n\n  \"\"\"The recording’s entry on Spotify.\"\"\"\n  spotify(\n    \"\"\"\n    The strategies to use to match the recording with a Spotify track, in\n    preferential order.\n    \"\"\"\n    strategy: [SpotifyMatchStrategy!] = [URL, EXTERNALID]\n  ): SpotifyTrack\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype RecordingConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [RecordingEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the\n  `edges` field).\n  \"\"\"\n  nodes: [Recording]\n\n  \"\"\"\n  A count of the total number of items in this connection,\n  ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype RecordingEdge {\n  \"\"\"The item at the end of the edge\"\"\"\n  node: Recording\n\n  \"\"\"A cursor for use in pagination\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The relevancy score (0–100) assigned by the search engine, if\n  these results were found through a search.\n  \"\"\"\n  score: Int\n}\n\n\"\"\"\n[Relationships](https://musicbrainz.org/doc/Relationships) are a\nway to represent all the different ways in which entities are connected to each\nother and to URLs outside MusicBrainz.\n\"\"\"\ntype Relationship {\n  \"\"\"The target entity.\"\"\"\n  target: Entity!\n\n  \"\"\"The direction of the relationship.\"\"\"\n  direction: String!\n\n  \"\"\"The type of entity on the receiving end of the relationship.\"\"\"\n  targetType: String!\n\n  \"\"\"\n  How the source entity was actually credited, if different\n  from its main (performance) name.\n  \"\"\"\n  sourceCredit: String\n\n  \"\"\"\n  How the target entity was actually credited, if different\n  from its main (performance) name.\n  \"\"\"\n  targetCredit: String\n\n  \"\"\"The date on which the relationship became applicable.\"\"\"\n  begin: Date\n\n  \"\"\"The date on which the relationship became no longer applicable.\"\"\"\n  end: Date\n\n  \"\"\"Whether the relationship still applies.\"\"\"\n  ended: Boolean\n\n  \"\"\"\n  Attributes which modify the relationship. There is a [list\n  of all attributes](https://musicbrainz.org/relationship-attributes), but the\n  attributes which are available, and how they should be used, depends on the\n  relationship type.\n  \"\"\"\n  attributes: [String]\n\n  \"\"\"The type of relationship.\"\"\"\n  type: String\n\n  \"\"\"\n  The MBID associated with the value of the `type`\n  field.\n  \"\"\"\n  typeID: MBID\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype RelationshipConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [RelationshipEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the\n  `edges` field).\n  \"\"\"\n  nodes: [Relationship]\n\n  \"\"\"\n  A count of the total number of items in this connection,\n  ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype RelationshipEdge {\n  \"\"\"The item at the end of the edge\"\"\"\n  node: Relationship\n\n  \"\"\"A cursor for use in pagination\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The relevancy score (0–100) assigned by the search engine, if\n  these results were found through a search.\n  \"\"\"\n  score: Int\n}\n\n\"\"\"Lists of entity relationships for each entity type.\"\"\"\ntype Relationships {\n  \"\"\"A list of relationships between these two entity types.\"\"\"\n  areas(\n    \"\"\"Filter by the relationship direction.\"\"\"\n    direction: String\n\n    \"\"\"Filter by the relationship type.\"\"\"\n    type: String\n\n    \"\"\"\n    The MBID associated with the value of the `type`\n    field.\n    \"\"\"\n    typeID: MBID\n    after: String\n    first: Int\n    before: String\n    last: Int\n  ): RelationshipConnection\n\n  \"\"\"A list of relationships between these two entity types.\"\"\"\n  artists(\n    \"\"\"Filter by the relationship direction.\"\"\"\n    direction: String\n\n    \"\"\"Filter by the relationship type.\"\"\"\n    type: String\n\n    \"\"\"\n    The MBID associated with the value of the `type`\n    field.\n    \"\"\"\n    typeID: MBID\n    after: String\n    first: Int\n    before: String\n    last: Int\n  ): RelationshipConnection\n\n  \"\"\"A list of relationships between these two entity types.\"\"\"\n  events(\n    \"\"\"Filter by the relationship direction.\"\"\"\n    direction: String\n\n    \"\"\"Filter by the relationship type.\"\"\"\n    type: String\n\n    \"\"\"\n    The MBID associated with the value of the `type`\n    field.\n    \"\"\"\n    typeID: MBID\n    after: String\n    first: Int\n    before: String\n    last: Int\n  ): RelationshipConnection\n\n  \"\"\"A list of relationships between these two entity types.\"\"\"\n  instruments(\n    \"\"\"Filter by the relationship direction.\"\"\"\n    direction: String\n\n    \"\"\"Filter by the relationship type.\"\"\"\n    type: String\n\n    \"\"\"\n    The MBID associated with the value of the `type`\n    field.\n    \"\"\"\n    typeID: MBID\n    after: String\n    first: Int\n    before: String\n    last: Int\n  ): RelationshipConnection\n\n  \"\"\"A list of relationships between these two entity types.\"\"\"\n  labels(\n    \"\"\"Filter by the relationship direction.\"\"\"\n    direction: String\n\n    \"\"\"Filter by the relationship type.\"\"\"\n    type: String\n\n    \"\"\"\n    The MBID associated with the value of the `type`\n    field.\n    \"\"\"\n    typeID: MBID\n    after: String\n    first: Int\n    before: String\n    last: Int\n  ): RelationshipConnection\n\n  \"\"\"A list of relationships between these two entity types.\"\"\"\n  places(\n    \"\"\"Filter by the relationship direction.\"\"\"\n    direction: String\n\n    \"\"\"Filter by the relationship type.\"\"\"\n    type: String\n\n    \"\"\"\n    The MBID associated with the value of the `type`\n    field.\n    \"\"\"\n    typeID: MBID\n    after: String\n    first: Int\n    before: String\n    last: Int\n  ): RelationshipConnection\n\n  \"\"\"A list of relationships between these two entity types.\"\"\"\n  recordings(\n    \"\"\"Filter by the relationship direction.\"\"\"\n    direction: String\n\n    \"\"\"Filter by the relationship type.\"\"\"\n    type: String\n\n    \"\"\"\n    The MBID associated with the value of the `type`\n    field.\n    \"\"\"\n    typeID: MBID\n    after: String\n    first: Int\n    before: String\n    last: Int\n  ): RelationshipConnection\n\n  \"\"\"A list of relationships between these two entity types.\"\"\"\n  releases(\n    \"\"\"Filter by the relationship direction.\"\"\"\n    direction: String\n\n    \"\"\"Filter by the relationship type.\"\"\"\n    type: String\n\n    \"\"\"\n    The MBID associated with the value of the `type`\n    field.\n    \"\"\"\n    typeID: MBID\n    after: String\n    first: Int\n    before: String\n    last: Int\n  ): RelationshipConnection\n\n  \"\"\"A list of relationships between these two entity types.\"\"\"\n  releaseGroups(\n    \"\"\"Filter by the relationship direction.\"\"\"\n    direction: String\n\n    \"\"\"Filter by the relationship type.\"\"\"\n    type: String\n\n    \"\"\"\n    The MBID associated with the value of the `type`\n    field.\n    \"\"\"\n    typeID: MBID\n    after: String\n    first: Int\n    before: String\n    last: Int\n  ): RelationshipConnection\n\n  \"\"\"A list of relationships between these two entity types.\"\"\"\n  series(\n    \"\"\"Filter by the relationship direction.\"\"\"\n    direction: String\n\n    \"\"\"Filter by the relationship type.\"\"\"\n    type: String\n\n    \"\"\"\n    The MBID associated with the value of the `type`\n    field.\n    \"\"\"\n    typeID: MBID\n    after: String\n    first: Int\n    before: String\n    last: Int\n  ): RelationshipConnection\n\n  \"\"\"A list of relationships between these two entity types.\"\"\"\n  urls(\n    \"\"\"Filter by the relationship direction.\"\"\"\n    direction: String\n\n    \"\"\"Filter by the relationship type.\"\"\"\n    type: String\n\n    \"\"\"\n    The MBID associated with the value of the `type`\n    field.\n    \"\"\"\n    typeID: MBID\n    after: String\n    first: Int\n    before: String\n    last: Int\n  ): RelationshipConnection\n\n  \"\"\"A list of relationships between these two entity types.\"\"\"\n  works(\n    \"\"\"Filter by the relationship direction.\"\"\"\n    direction: String\n\n    \"\"\"Filter by the relationship type.\"\"\"\n    type: String\n\n    \"\"\"\n    The MBID associated with the value of the `type`\n    field.\n    \"\"\"\n    typeID: MBID\n    after: String\n    first: Int\n    before: String\n    last: Int\n  ): RelationshipConnection\n}\n\n\"\"\"\nA [release](https://musicbrainz.org/doc/Release) represents the\nunique release (i.e. issuing) of a product on a specific date with specific\nrelease information such as the country, label, barcode, packaging, etc. If you\nwalk into a store and purchase an album or single, they’re each represented in\nMusicBrainz as one release.\n\"\"\"\ntype Release implements Node & Entity {\n  \"\"\"The ID of an object\"\"\"\n  id: ID!\n\n  \"\"\"The MBID of the entity.\"\"\"\n  mbid: MBID!\n\n  \"\"\"The official title of the entity.\"\"\"\n  title: String\n\n  \"\"\"A comment used to help distinguish identically named entitites.\"\"\"\n  disambiguation: String\n\n  \"\"\"\n  [Aliases](https://musicbrainz.org/doc/Aliases) are used to store\n  alternate names or misspellings.\n  \"\"\"\n  aliases: [Alias]\n\n  \"\"\"The main credited artist(s).\"\"\"\n  artistCredit: [ArtistCredit] @deprecated(reason: \"The `artistCredit` field has been renamed to\\n`artistCredits`, since it is a list of credits and is referred to in the\\nplural form throughout the MusicBrainz documentation. This field is deprecated\\nand will be removed in a major release in the future. Use the equivalent\\n`artistCredits` field.\")\n\n  \"\"\"The main credited artist(s).\"\"\"\n  artistCredits: [ArtistCredit]\n\n  \"\"\"The release events for this release.\"\"\"\n  releaseEvents: [ReleaseEvent]\n\n  \"\"\"\n  The [release date](https://musicbrainz.org/doc/Release/Date)\n  is the date in which a release was made available through some sort of\n  distribution mechanism.\n  \"\"\"\n  date: Date\n\n  \"\"\"The country in which the release was issued.\"\"\"\n  country: String\n\n  \"\"\"\n  The [Amazon Standard Identification Number](https://musicbrainz.org/doc/ASIN)\n  of the release.\n  \"\"\"\n  asin: ASIN\n\n  \"\"\"\n  The [barcode](https://en.wikipedia.org/wiki/Barcode), if the\n  release has one. The most common types found on releases are 12-digit\n  [UPCs](https://en.wikipedia.org/wiki/Universal_Product_Code) and 13-digit\n  [EANs](https://en.wikipedia.org/wiki/International_Article_Number).\n  \"\"\"\n  barcode: String\n\n  \"\"\"The status describes how “official” a release is.\"\"\"\n  status: ReleaseStatus\n\n  \"\"\"\n  The MBID associated with the value of the `status`\n  field.\n  \"\"\"\n  statusID: MBID\n\n  \"\"\"\n  The physical packaging that accompanies the release. See\n  the [list of packaging](https://musicbrainz.org/doc/Release/Packaging) for more\n  information.\n  \"\"\"\n  packaging: String\n\n  \"\"\"\n  The MBID associated with the value of the `packaging`\n  field.\n  \"\"\"\n  packagingID: MBID\n\n  \"\"\"\n  Data quality indicates how good the data for a release is.\n  It is not a mark of how good or bad the music itself is – for that, use\n  [ratings](https://musicbrainz.org/doc/Rating_System).\n  \"\"\"\n  quality: String\n\n  \"\"\"The media on which the release was distributed.\"\"\"\n  media: [Medium]\n\n  \"\"\"A list of artists linked to this entity.\"\"\"\n  artists(after: String, first: Int): ArtistConnection\n\n  \"\"\"A list of labels linked to this entity.\"\"\"\n  labels(after: String, first: Int): LabelConnection\n\n  \"\"\"A list of recordings linked to this entity.\"\"\"\n  recordings(after: String, first: Int): RecordingConnection\n\n  \"\"\"A list of release groups linked to this entity.\"\"\"\n  releaseGroups(\n    \"\"\"Filter by one or more release group types.\"\"\"\n    type: [ReleaseGroupType]\n    after: String\n    first: Int\n  ): ReleaseGroupConnection\n\n  \"\"\"Relationships between this entity and other entitites.\"\"\"\n  relationships: Relationships\n\n  \"\"\"A list of collections containing this entity.\"\"\"\n  collections(after: String, first: Int): CollectionConnection\n\n  \"\"\"A list of tags linked to this entity.\"\"\"\n  tags(after: String, first: Int): TagConnection\n\n  \"\"\"\n  An object containing a list and summary of the cover art images that are\n  present for this release from the [Cover Art Archive](https://musicbrainz.org/doc/Cover_Art_Archive).\n  This field is provided by the Cover Art Archive extension.\n  \"\"\"\n  coverArtArchive: CoverArtArchiveRelease\n\n  \"\"\"Information about the release on Discogs.\"\"\"\n  discogs: DiscogsRelease\n\n  \"\"\"\n  Data about the release from [Last.fm](https://www.last.fm/), a good source\n  for measuring popularity via listener and play counts. This field is\n  provided by the Last.fm extension.\n  \"\"\"\n  lastFM: LastFMAlbum\n\n  \"\"\"The release’s entry on Spotify.\"\"\"\n  spotify(\n    \"\"\"\n    The strategies to use to match the release with a Spotify album, in\n    preferential order.\n    \"\"\"\n    strategy: [SpotifyMatchStrategy!] = [URL, EXTERNALID]\n  ): SpotifyAlbum\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype ReleaseConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [ReleaseEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the\n  `edges` field).\n  \"\"\"\n  nodes: [Release]\n\n  \"\"\"\n  A count of the total number of items in this connection,\n  ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype ReleaseEdge {\n  \"\"\"The item at the end of the edge\"\"\"\n  node: Release\n\n  \"\"\"A cursor for use in pagination\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The relevancy score (0–100) assigned by the search engine, if\n  these results were found through a search.\n  \"\"\"\n  score: Int\n}\n\n\"\"\"\nThe date on which a release was issued in a country/region with\na particular label, catalog number, barcode, and format.\n\"\"\"\ntype ReleaseEvent {\n  area: Area\n  date: Date\n}\n\n\"\"\"\nA [release group](https://musicbrainz.org/doc/Release_Group) is\nused to group several different releases into a single logical entity. Every\nrelease belongs to one, and only one release group.\n\nBoth release groups and releases are “albums” in a general sense, but with an\nimportant difference: a release is something you can buy as media such as a CD\nor a vinyl record, while a release group embraces the overall concept of an\nalbum – it doesn’t matter how many CDs or editions/versions it had.\n\"\"\"\ntype ReleaseGroup implements Node & Entity {\n  \"\"\"The ID of an object\"\"\"\n  id: ID!\n\n  \"\"\"The MBID of the entity.\"\"\"\n  mbid: MBID!\n\n  \"\"\"The official title of the entity.\"\"\"\n  title: String\n\n  \"\"\"A comment used to help distinguish identically named entitites.\"\"\"\n  disambiguation: String\n\n  \"\"\"\n  [Aliases](https://musicbrainz.org/doc/Aliases) are used to store\n  alternate names or misspellings.\n  \"\"\"\n  aliases: [Alias]\n\n  \"\"\"The main credited artist(s).\"\"\"\n  artistCredit: [ArtistCredit] @deprecated(reason: \"The `artistCredit` field has been renamed to\\n`artistCredits`, since it is a list of credits and is referred to in the\\nplural form throughout the MusicBrainz documentation. This field is deprecated\\nand will be removed in a major release in the future. Use the equivalent\\n`artistCredits` field.\")\n\n  \"\"\"The main credited artist(s).\"\"\"\n  artistCredits: [ArtistCredit]\n\n  \"\"\"The date of the earliest release in the group.\"\"\"\n  firstReleaseDate: Date\n\n  \"\"\"\n  The [type](https://musicbrainz.org/doc/Release_Group/Type)\n  of a release group describes what kind of releases the release group represents,\n  e.g. album, single, soundtrack, compilation, etc. A release group can have a\n  “main” type and an unspecified number of additional types.\n  \"\"\"\n  primaryType: ReleaseGroupType\n\n  \"\"\"\n  The MBID associated with the value of the `primaryType`\n  field.\n  \"\"\"\n  primaryTypeID: MBID\n\n  \"\"\"\n  Additional [types](https://musicbrainz.org/doc/Release_Group/Type)\n  that apply to this release group.\n  \"\"\"\n  secondaryTypes: [ReleaseGroupType]\n\n  \"\"\"\n  The MBIDs associated with the values of the `secondaryTypes`\n  field.\n  \"\"\"\n  secondaryTypeIDs: [MBID]\n\n  \"\"\"A list of artists linked to this entity.\"\"\"\n  artists(after: String, first: Int): ArtistConnection\n\n  \"\"\"A list of releases linked to this entity.\"\"\"\n  releases(\n    \"\"\"Filter by one or more release group types.\"\"\"\n    type: [ReleaseGroupType]\n\n    \"\"\"Filter by one or more release statuses.\"\"\"\n    status: [ReleaseStatus]\n    after: String\n    first: Int\n  ): ReleaseConnection\n\n  \"\"\"Relationships between this entity and other entitites.\"\"\"\n  relationships: Relationships\n\n  \"\"\"A list of collections containing this entity.\"\"\"\n  collections(after: String, first: Int): CollectionConnection\n\n  \"\"\"The rating users have given to this entity.\"\"\"\n  rating: Rating\n\n  \"\"\"A list of tags linked to this entity.\"\"\"\n  tags(after: String, first: Int): TagConnection\n\n  \"\"\"\n  The cover art for a release in the release group, obtained from the\n  [Cover Art Archive](https://musicbrainz.org/doc/Cover_Art_Archive). A\n  release in the release group will be chosen as representative of the release\n  group.\n  This field is provided by the Cover Art Archive extension.\n  \"\"\"\n  coverArtArchive: CoverArtArchiveRelease\n\n  \"\"\"\n  Images of the release group from [fanart.tv](https://fanart.tv/).\n  This field is provided by the fanart.tv extension.\n  \"\"\"\n  fanArt: FanArtAlbum\n\n  \"\"\"\n  Data about the release group from [TheAudioDB](http://www.theaudiodb.com/),\n  a good source of descriptive information, reviews, and images.\n  This field is provided by TheAudioDB extension.\n  \"\"\"\n  theAudioDB: TheAudioDBAlbum\n\n  \"\"\"Information about the release group on Discogs.\"\"\"\n  discogs: DiscogsMaster\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype ReleaseGroupConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [ReleaseGroupEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the\n  `edges` field).\n  \"\"\"\n  nodes: [ReleaseGroup]\n\n  \"\"\"\n  A count of the total number of items in this connection,\n  ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype ReleaseGroupEdge {\n  \"\"\"The item at the end of the edge\"\"\"\n  node: ReleaseGroup\n\n  \"\"\"A cursor for use in pagination\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The relevancy score (0–100) assigned by the search engine, if\n  these results were found through a search.\n  \"\"\"\n  score: Int\n}\n\n\"\"\"\nA type used to describe release groups, e.g. album, single, EP,\netc.\n\"\"\"\nenum ReleaseGroupType {\n  \"\"\"\n  An album, perhaps better defined as a “Long Play” (LP)\n  release, generally consists of previously unreleased material (unless this type\n  is combined with secondary types which change that, such as “Compilation”). This\n  includes album re-issues, with or without bonus tracks.\n  \"\"\"\n  ALBUM\n\n  \"\"\"\n  A single typically has one main song and possibly a handful\n  of additional tracks or remixes of the main track. A single is usually named\n  after its main song.\n  \"\"\"\n  SINGLE\n\n  \"\"\"\n  An EP is a so-called “Extended Play” release and often\n  contains the letters EP in the title. Generally an EP will be shorter than a\n  full length release (an LP or “Long Play”) and the tracks are usually exclusive\n  to the EP, in other words the tracks don’t come from a previously issued\n  release. EP is fairly difficult to define; usually it should only be assumed\n  that a release is an EP if the artist defines it as such.\n  \"\"\"\n  EP\n\n  \"\"\"Any release that does not fit any of the other categories.\"\"\"\n  OTHER\n\n  \"\"\"\n  An episodic release that was originally broadcast via radio,\n  television, or the Internet, including podcasts.\n  \"\"\"\n  BROADCAST\n\n  \"\"\"\n  A compilation is a collection of previously released tracks\n  by one or more artists.\n  \"\"\"\n  COMPILATION\n\n  \"\"\"\n  A soundtrack is the musical score to a movie, TV series,\n  stage show, computer game, etc.\n  \"\"\"\n  SOUNDTRACK\n\n  \"\"\"A non-music spoken word release.\"\"\"\n  SPOKENWORD\n\n  \"\"\"\n  An interview release contains an interview, generally with\n  an artist.\n  \"\"\"\n  INTERVIEW\n\n  \"\"\"An audiobook is a book read by a narrator without music.\"\"\"\n  AUDIOBOOK\n\n  \"\"\"A release that was recorded live.\"\"\"\n  LIVE\n\n  \"\"\"\n  A release that was (re)mixed from previously released\n  material.\n  \"\"\"\n  REMIX\n\n  \"\"\"\n  A DJ-mix is a sequence of several recordings played one\n  after the other, each one modified so that they blend together into a continuous\n  flow of music. A DJ mix release requires that the recordings be modified in some\n  manner, and the DJ who does this modification is usually (although not always)\n  credited in a fairly prominent way.\n  \"\"\"\n  DJMIX\n\n  \"\"\"\n  Promotional in nature (but not necessarily free), mixtapes\n  and street albums are often released by artists to promote new artists, or\n  upcoming studio albums by prominent artists. They are also sometimes used to\n  keep fans’ attention between studio releases and are most common in rap & hip\n  hop genres. They are often not sanctioned by the artist’s label, may lack proper\n  sample or song clearances and vary widely in production and recording quality.\n  While mixtapes are generally DJ-mixed, they are distinct from commercial DJ\n  mixes (which are usually deemed compilations) and are defined by having a\n  significant proportion of new material, including original production or\n  original vocals over top of other artists’ instrumentals. They are distinct from\n  demos in that they are designed for release directly to the public and fans, not\n  to labels.\n  \"\"\"\n  MIXTAPE\n\n  \"\"\"\n  A release that was recorded for limited circulation or\n  reference use rather than for general public release.\n  \"\"\"\n  DEMO\n\n  \"\"\"A non-album track (special case).\"\"\"\n  NAT\n}\n\n\"\"\"\nA type used to describe the status of releases, e.g. official,\nbootleg, etc.\n\"\"\"\nenum ReleaseStatus {\n  \"\"\"\n  Any release officially sanctioned by the artist and/or their\n  record company. (Most releases will fit into this category.)\n  \"\"\"\n  OFFICIAL\n\n  \"\"\"\n  A giveaway release or a release intended to promote an\n  upcoming official release, e.g. prerelease albums or releases included with a\n  magazine.\n  \"\"\"\n  PROMOTION\n\n  \"\"\"\n  An unofficial/underground release that was not sanctioned by\n  the artist and/or the record company.\n  \"\"\"\n  BOOTLEG\n\n  \"\"\"\n  A pseudo-release is a duplicate release for\n  translation/transliteration purposes.\n  \"\"\"\n  PSEUDORELEASE\n}\n\n\"\"\"A search for MusicBrainz entities using Lucene query syntax.\"\"\"\ntype SearchQuery {\n  \"\"\"Search for area entities matching the given query.\"\"\"\n  areas(\n    \"\"\"\n    The query terms, in Lucene search syntax. See [examples\n    and search fields](https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2/Search).\n    \"\"\"\n    query: String!\n    after: String\n    first: Int\n  ): AreaConnection\n\n  \"\"\"Search for artist entities matching the given query.\"\"\"\n  artists(\n    \"\"\"\n    The query terms, in Lucene search syntax. See [examples\n    and search fields](https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2/Search).\n    \"\"\"\n    query: String!\n    after: String\n    first: Int\n  ): ArtistConnection\n\n  \"\"\"Search for event entities matching the given query.\"\"\"\n  events(\n    \"\"\"\n    The query terms, in Lucene search syntax. See [examples\n    and search fields](https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2/Search).\n    \"\"\"\n    query: String!\n    after: String\n    first: Int\n  ): EventConnection\n\n  \"\"\"Search for instrument entities matching the given query.\"\"\"\n  instruments(\n    \"\"\"\n    The query terms, in Lucene search syntax. See [examples\n    and search fields](https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2/Search).\n    \"\"\"\n    query: String!\n    after: String\n    first: Int\n  ): InstrumentConnection\n\n  \"\"\"Search for label entities matching the given query.\"\"\"\n  labels(\n    \"\"\"\n    The query terms, in Lucene search syntax. See [examples\n    and search fields](https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2/Search).\n    \"\"\"\n    query: String!\n    after: String\n    first: Int\n  ): LabelConnection\n\n  \"\"\"Search for place entities matching the given query.\"\"\"\n  places(\n    \"\"\"\n    The query terms, in Lucene search syntax. See [examples\n    and search fields](https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2/Search).\n    \"\"\"\n    query: String!\n    after: String\n    first: Int\n  ): PlaceConnection\n\n  \"\"\"Search for recording entities matching the given query.\"\"\"\n  recordings(\n    \"\"\"\n    The query terms, in Lucene search syntax. See [examples\n    and search fields](https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2/Search).\n    \"\"\"\n    query: String!\n    after: String\n    first: Int\n  ): RecordingConnection\n\n  \"\"\"Search for release entities matching the given query.\"\"\"\n  releases(\n    \"\"\"\n    The query terms, in Lucene search syntax. See [examples\n    and search fields](https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2/Search).\n    \"\"\"\n    query: String!\n    after: String\n    first: Int\n  ): ReleaseConnection\n\n  \"\"\"Search for release group entities matching the given query.\"\"\"\n  releaseGroups(\n    \"\"\"\n    The query terms, in Lucene search syntax. See [examples\n    and search fields](https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2/Search).\n    \"\"\"\n    query: String!\n    after: String\n    first: Int\n  ): ReleaseGroupConnection\n\n  \"\"\"Search for series entities matching the given query.\"\"\"\n  series(\n    \"\"\"\n    The query terms, in Lucene search syntax. See [examples\n    and search fields](https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2/Search).\n    \"\"\"\n    query: String!\n    after: String\n    first: Int\n  ): SeriesConnection\n\n  \"\"\"Search for work entities matching the given query.\"\"\"\n  works(\n    \"\"\"\n    The query terms, in Lucene search syntax. See [examples\n    and search fields](https://musicbrainz.org/doc/Development/XML_Web_Service/Version_2/Search).\n    \"\"\"\n    query: String!\n    after: String\n    first: Int\n  ): WorkConnection\n}\n\n\"\"\"\nA [series](https://musicbrainz.org/doc/Series) is a sequence of\nseparate release groups, releases, recordings, works or events with a common\ntheme.\n\"\"\"\ntype Series implements Node & Entity {\n  \"\"\"The ID of an object\"\"\"\n  id: ID!\n\n  \"\"\"The MBID of the entity.\"\"\"\n  mbid: MBID!\n\n  \"\"\"The official name of the entity.\"\"\"\n  name: String\n\n  \"\"\"A comment used to help distinguish identically named entitites.\"\"\"\n  disambiguation: String\n\n  \"\"\"\n  The type primarily describes what type of entity the series\n  contains.\n  \"\"\"\n  type: String\n\n  \"\"\"\n  The MBID associated with the value of the `type`\n  field.\n  \"\"\"\n  typeID: MBID\n\n  \"\"\"Relationships between this entity and other entitites.\"\"\"\n  relationships: Relationships\n\n  \"\"\"A list of collections containing this entity.\"\"\"\n  collections(after: String, first: Int): CollectionConnection\n\n  \"\"\"A list of tags linked to this entity.\"\"\"\n  tags(after: String, first: Int): TagConnection\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype SeriesConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [SeriesEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the\n  `edges` field).\n  \"\"\"\n  nodes: [Series]\n\n  \"\"\"\n  A count of the total number of items in this connection,\n  ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype SeriesEdge {\n  \"\"\"The item at the end of the edge\"\"\"\n  node: Series\n\n  \"\"\"A cursor for use in pagination\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The relevancy score (0–100) assigned by the search engine, if\n  these results were found through a search.\n  \"\"\"\n  score: Int\n}\n\n\"\"\"An album from Spotify.\"\"\"\ntype SpotifyAlbum {\n  \"\"\"\n  The [Spotify ID](https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids)\n  for the album.\n  \"\"\"\n  albumID: ID!\n\n  \"\"\"\n  The [Spotify URI](https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids)\n  for the album.\n  \"\"\"\n  uri: String!\n\n  \"\"\"A link to the Web API endpoint providing full details of the album.\"\"\"\n  href: URLString!\n\n  \"\"\"\n  The name of the album. In case of an album takedown, the value may be empty.\n  \"\"\"\n  title: String\n\n  \"\"\"The type of the album, e.g. “Album”, “Single”, “Compilation”.\"\"\"\n  albumType: ReleaseGroupType!\n\n  \"\"\"The artists of the album.\"\"\"\n  artists: [SpotifyArtist!]!\n\n  \"\"\"\n  The markets in which the album is available: [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)\n  country codes.\n  \n  Note that an album is considered available in a market when at least 1 of its tracks is available in that market.\n  \"\"\"\n  availableMarkets: [String!]!\n\n  \"\"\"The copyright statements of the album.\"\"\"\n  copyrights: [SpotifyCopyright!]!\n\n  \"\"\"Known external IDs for the album.\"\"\"\n  externalIDs: [SpotifyExternalID!]!\n\n  \"\"\"Known external URLs for this album.\"\"\"\n  externalURLs: [SpotifyExternalURL!]!\n\n  \"\"\"\n  A list of the genres used to classify the album. For example: “Prog Rock”,\n  “Post-Grunge”. (If not yet classified, the array is empty.)\n  \"\"\"\n  genres: [String!]!\n\n  \"\"\"The cover art for the album in various sizes, widest first.\"\"\"\n  images: [SpotifyImage!]!\n\n  \"\"\"The label for the album.\"\"\"\n  label: String\n\n  \"\"\"\n  The popularity of the album. The value will be between 0 and 100, with 100\n  being the most popular. The popularity is calculated from the popularity of\n  the album’s individual tracks.\n  \"\"\"\n  popularity: Int!\n\n  \"\"\"\n  The date the album was first released, for example “1981-12-15”. Depending\n  on the precision, the month or day might be missing.\n  \"\"\"\n  releaseDate: Date\n}\n\n\"\"\"An artist from Spotify.\"\"\"\ntype SpotifyArtist {\n  \"\"\"\n  The [Spotify ID](https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids)\n  for the artist.\n  \"\"\"\n  artistID: ID!\n\n  \"\"\"\n  The [Spotify URI](https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids)\n  for the artist.\n  \"\"\"\n  uri: String!\n\n  \"\"\"A link to the Web API endpoint providing full details of the artist.\"\"\"\n  href: URLString!\n\n  \"\"\"The name of the artist.\"\"\"\n  name: String!\n\n  \"\"\"Known external URLs for this artist.\"\"\"\n  externalURLs: [SpotifyExternalURL!]!\n\n  \"\"\"\n  A list of the genres the artist is associated with. For example:\n  “Prog Rock”, “Post-Grunge”. (If not yet classified, the array is empty.)\n  \"\"\"\n  genres: [String!]!\n\n  \"\"\"\n  The popularity of the artist. The value will be between 0 and 100, with 100\n  being the most popular. The artist’s popularity is calculated from the\n  popularity of all the artist’s tracks.\n  \"\"\"\n  popularity: Int!\n\n  \"\"\"Images of the artist in various sizes, widest first.\"\"\"\n  images: [SpotifyImage!]!\n\n  \"\"\"Spotify catalog information about an artist’s top tracks by country.\"\"\"\n  topTracks(\n    \"\"\"\n    An [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)\n    country code.\n    \"\"\"\n    market: String!\n  ): [SpotifyTrack!]!\n\n  \"\"\"\n  Spotify catalog information about artists similar to a given artist.\n  Similarity is based on analysis of the Spotify community’s listening\n  history.\n  \"\"\"\n  relatedArtists: [SpotifyArtist!]!\n}\n\n\"\"\"The audio features of a track from Spotify.\"\"\"\ntype SpotifyAudioFeatures {\n  \"\"\"\n  A confidence measure from 0.0 to 1.0 of whether the track is acoustic. 1.0\n  represents high confidence the track is acoustic.\n  \"\"\"\n  acousticness: Float!\n\n  \"\"\"\n  Danceability describes how suitable a track is for dancing based on a\n  combination of musical elements including tempo, rhythm stability, beat\n  strength, and overall regularity. A value of 0.0 is least danceable and 1.0\n  is most danceable.\n  \"\"\"\n  danceability: Float!\n\n  \"\"\"The duration of the track in milliseconds.\"\"\"\n  duration: Duration!\n\n  \"\"\"\n  Energy is a measure from 0.0 to 1.0 and represents a perceptual measure of\n  intensity and activity. Typically, energetic tracks feel fast, loud, and\n  noisy. For example, death metal has high energy, while a Bach prelude scores\n  low on the scale. Perceptual features contributing to this attribute include\n  dynamic range, perceived loudness, timbre, onset rate, and general entropy.\n  \"\"\"\n  energy: Float!\n\n  \"\"\"\n  Predicts whether a track contains no vocals. “Ooh” and “aah” sounds are\n  treated as instrumental in this context. Rap or spoken word tracks are\n  clearly “vocal”. The closer the instrumentalness value is to 1.0, the\n  greater likelihood the track contains no vocal content. Values above 0.5 are\n  intended to represent instrumental tracks, but confidence is higher as the\n  value approaches 1.0.\n  \"\"\"\n  instrumentalness: Float!\n\n  \"\"\"\n  The key the track is in. Integers map to pitches using standard [Pitch Class\n  notation](https://en.wikipedia.org/wiki/Pitch_class), e.g. 0 = C, 1 = C♯/D♭,\n  2 = D, and so on. See the `keyName` field if you’d prefer the note as a\n  string.\n  \"\"\"\n  key: Int!\n\n  \"\"\"\n  The `key` translated from an integer to a name like “C”. (Only one name\n  will be returned, so enharmonic notes like like C♯/D♭ will just return\n  “C♯”.)\n  \"\"\"\n  keyName: String!\n\n  \"\"\"\n  Detects the presence of an audience in the recording. Higher liveness values\n  represent an increased probability that the track was performed live. A\n  value above 0.8 provides strong likelihood that the track is live.\n  \"\"\"\n  liveness: Float!\n\n  \"\"\"\n  The overall loudness of a track in decibels (dB). Loudness values are\n  averaged across the entire track and are useful for comparing relative\n  loudness of tracks. Loudness is the quality of a sound that is the primary\n  psychological correlate of physical strength (amplitude). Values typical\n  range between -60 and 0 db.\n  \"\"\"\n  loudness: Float!\n\n  \"\"\"\n  Mode indicates the modality (major or minor) of a track, the type of scale\n  from which its melodic content is derived. Major is represented by 1 and\n  minor is 0.\n  \"\"\"\n  mode: SpotifyTrackMode!\n\n  \"\"\"\n  Speechiness detects the presence of spoken words in a track. The more\n  exclusively speech-like the recording (e.g. talk show, audio book, poetry),\n  the closer to 1.0 the attribute value. Values above 0.66 describe tracks\n  that are probably made entirely of spoken words. Values between 0.33 and\n  0.66 describe tracks that may contain both music and speech, either in\n  sections or layered, including such cases as rap music. Values below 0.33\n  most likely represent music and other non-speech-like tracks.\n  \"\"\"\n  speechiness: Float!\n\n  \"\"\"\n  The overall estimated tempo of a track in beats per minute (BPM). In musical\n  terminology, tempo is the speed or pace of a given piece and derives\n  directly from the average beat duration.\n  \"\"\"\n  tempo: Float!\n\n  \"\"\"\n  An estimated overall time signature of a track. The time signature (meter)\n  is a notational convention to specify how many beats are in each bar (or\n  measure).\n  \"\"\"\n  timeSignature: Float!\n\n  \"\"\"\n  A measure from 0.0 to 1.0 describing the musical positiveness conveyed by a\n  track. Tracks with high valence sound more positive (e.g. happy, cheerful,\n  euphoric), while tracks with low valence sound more negative (e.g. sad,\n  depressed, angry).\n  \"\"\"\n  valence: Float!\n}\n\n\"\"\"A copyright statement for an album from Spotify.\"\"\"\ntype SpotifyCopyright {\n  \"\"\"The copyright text.\"\"\"\n  text: String!\n\n  \"\"\"\n  Whether the copyright is for the work itself or the sound recording\n  (performance).\n  \"\"\"\n  type: SpotifyCopyrightType!\n}\n\n\"\"\"The type of copyright.\"\"\"\nenum SpotifyCopyrightType {\n  \"\"\"The copyright.\"\"\"\n  COPYRIGHT\n\n  \"\"\"The sound recording (performance) copyright.\"\"\"\n  PERFORMANCE\n}\n\n\"\"\"A value for identifying an entity with some third party.\"\"\"\ntype SpotifyExternalID {\n  \"\"\"The identifier type, for example “isrc”, “ean”, “upc”.\"\"\"\n  type: String!\n\n  \"\"\"The identifier value.\"\"\"\n  id: String!\n}\n\n\"\"\"A URL for linking to an entity with some third party.\"\"\"\ntype SpotifyExternalURL {\n  \"\"\"The type of the URL, for example “spotify”.\"\"\"\n  type: String!\n\n  \"\"\"An external, public URL to the object.\"\"\"\n  url: URLString!\n}\n\n\"\"\"A single image from Spotify.\"\"\"\ntype SpotifyImage {\n  \"\"\"The source URL of the image.\"\"\"\n  url: URLString!\n\n  \"\"\"The image width in pixels, if known.\"\"\"\n  width: Int\n\n  \"\"\"The image height in pixels, if known.\"\"\"\n  height: Int\n}\n\n\"\"\"Strategies for matching MusicBrainz entities to Spotify entities.\"\"\"\nenum SpotifyMatchStrategy {\n  \"\"\"\n  The entity will be matched by finding an explicit URL relationship that\n  links to Spotify.\n  \"\"\"\n  URL\n\n  \"\"\"\n  The entity will be matched by searching for Spotify entities by some\n  external ID that is known to both MusicBrainz and Spotify, like an ISRC\n  or UPC barcode. Since this can result in multiple Spotify matches, the most\n  popular will be preferred (if possible), or the first.\n  \"\"\"\n  EXTERNALID\n}\n\ntype SpotifyQuery {\n  \"\"\"Track recommendations based on seed entities and various parameters.\"\"\"\n  recommendations(\n    \"\"\"\n    A list of [Spotify IDs](https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids)\n    for seed artists. Up to 5 seed values may be provided in any combination\n    of `seedArtists`, `seedTracks`, and `seedGenres`.\n    \"\"\"\n    seedArtists: [ID!] = []\n\n    \"\"\"\n    A comma separated list of any genres in the set of [available genre seeds](https://developer.spotify.com/documentation/web-api/reference/browse/get-recommendations/#available-genre-seeds).\n    Up to 5 seed values may be provided in any combination of `seedArtists`,\n    `seedTracks`, and `seedGenres`.\n    \"\"\"\n    seedGenres: [ID!] = []\n\n    \"\"\"\n    A list of [Spotify IDs](https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids)\n    for seed tracks. Up to 5 seed values may be provided in any combination\n    of `seedArtists`, `seedTracks`, and `seedGenres`.\n    \"\"\"\n    seedTracks: [ID!] = []\n\n    \"\"\"\n    The target size of the list of recommended tracks. For seeds with\n    unusually small pools or when highly restrictive filtering is applied, it\n    may be impossible to generate the requested number of recommended tracks.\n    Debugging information for such cases is available in the response.\n    \n    Default: 20. Minimum: 1. Maximum: 100.\n    \"\"\"\n    limit: Int\n  ): SpotifyRecommendations!\n}\n\ntype SpotifyRecommendations {\n  tracks: [SpotifyTrack!]!\n}\n\n\"\"\"A track from Spotify.\"\"\"\ntype SpotifyTrack {\n  \"\"\"\n  The [Spotify ID](https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids)\n  for the track.\n  \"\"\"\n  trackID: ID!\n\n  \"\"\"\n  The [Spotify URI](https://developer.spotify.com/documentation/web-api/#spotify-uris-and-ids)\n  for the track.\n  \"\"\"\n  uri: String!\n\n  \"\"\"A link to the Web API endpoint providing full details of the track.\"\"\"\n  href: URLString!\n\n  \"\"\"The name of the track.\"\"\"\n  title: String!\n\n  \"\"\"The audio features of the track.\"\"\"\n  audioFeatures: SpotifyAudioFeatures\n\n  \"\"\"The album on which the track appears.\"\"\"\n  album: SpotifyAlbum\n\n  \"\"\"The artists who performed the track.\"\"\"\n  artists: [SpotifyArtist!]!\n\n  \"\"\"\n  A list of the countries in which the track can be played, identified by\n  their [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)\n  code.\n  \"\"\"\n  availableMarkets: [String!]!\n\n  \"\"\"\n  The disc number (usually `1` unless the album consists of more than one\n  disc).\n  \"\"\"\n  discNumber: Int!\n\n  \"\"\"The track length in milliseconds.\"\"\"\n  duration: Duration!\n\n  \"\"\"Whether or not the track has explicit lyrics, if known.\"\"\"\n  explicit: Boolean\n\n  \"\"\"Known external IDs for the track.\"\"\"\n  externalIDs: [SpotifyExternalID!]!\n\n  \"\"\"Known external URLs for the track.\"\"\"\n  externalURLs: [SpotifyExternalURL!]!\n\n  \"\"\"\n  The popularity of the track. The value will be between 0 and 100, with 100\n  being the most popular.\n  \n  The popularity is calculated by algorithm and is based, in the most part, on\n  the total number of plays the track has had and how recent those plays are.\n  Generally speaking, songs that are being played a lot now will have a higher\n  popularity than songs that were played a lot in the past.\n  \n  Duplicate tracks (e.g. the same track from a single and an album) are rated\n  independently.\n  \n  Artist and album popularity is derived mathematically from track popularity.\n  \n  Note that the popularity value may lag actual popularity by a few days: the\n  value is not updated in real time.\n  \"\"\"\n  popularity: Int!\n\n  \"\"\"A link to a 30 second preview (MP3 format) of the track, if available.\"\"\"\n  previewURL: URLString\n\n  \"\"\"\n  The number of the track. If an album has several discs, the track number is\n  the number on the specified disc.\n  \"\"\"\n  trackNumber: Int!\n\n  \"\"\"A MusicBrainz recording that corresponds to the track.\"\"\"\n  musicBrainz(\n    \"\"\"\n    The strategies to use to match the track with a MusicBrainz recording, in\n    preferential order.\n    \"\"\"\n    strategy: [SpotifyMatchStrategy!] = [URL, EXTERNALID]\n  ): Recording\n}\n\n\"\"\"The potential values for modality (major or minor) of a track.\"\"\"\nenum SpotifyTrackMode {\n  \"\"\"The major scale.\"\"\"\n  MAJOR\n\n  \"\"\"The minor scale.\"\"\"\n  MINOR\n}\n\n\"\"\"\n[Tags](https://musicbrainz.org/tags) are a way to mark entities\nwith extra information – for example, the genres that apply to an artist,\nrelease, or recording.\n\"\"\"\ntype Tag {\n  \"\"\"The tag label.\"\"\"\n  name: String!\n\n  \"\"\"How many times this tag has been applied to the entity.\"\"\"\n  count: Int\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype TagConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [TagEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the\n  `edges` field).\n  \"\"\"\n  nodes: [Tag]\n\n  \"\"\"\n  A count of the total number of items in this connection,\n  ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype TagEdge {\n  \"\"\"The item at the end of the edge\"\"\"\n  node: Tag\n\n  \"\"\"A cursor for use in pagination\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The relevancy score (0–100) assigned by the search engine, if\n  these results were found through a search.\n  \"\"\"\n  score: Int\n}\n\n\"\"\"\nAn album on [TheAudioDB](http://www.theaudiodb.com/) corresponding with a\nMusicBrainz Release Group.\n\"\"\"\ntype TheAudioDBAlbum {\n  \"\"\"TheAudioDB ID of the album.\"\"\"\n  albumID: ID\n\n  \"\"\"TheAudioDB ID of the artist who released the album.\"\"\"\n  artistID: ID\n\n  \"\"\"A description of the album, often available in several languages.\"\"\"\n  description(\n    \"\"\"\n    The two-letter code for the language in which to retrieve the biography.\n    \"\"\"\n    lang: String = \"en\"\n  ): String\n\n  \"\"\"A review of the album.\"\"\"\n  review: String\n\n  \"\"\"The worldwide sales figure.\"\"\"\n  salesCount: Float\n\n  \"\"\"The album’s rating as determined by user votes, out of 10.\"\"\"\n  score: Float\n\n  \"\"\"The number of users who voted to determine the album’s score.\"\"\"\n  scoreVotes: Float\n\n  \"\"\"An image of the physical disc media for the album.\"\"\"\n  discImage(\n    \"\"\"The size of the image to retrieve.\"\"\"\n    size: TheAudioDBImageSize = FULL\n  ): URLString\n\n  \"\"\"An image of the spine of the album packaging.\"\"\"\n  spineImage(\n    \"\"\"The size of the image to retrieve.\"\"\"\n    size: TheAudioDBImageSize = FULL\n  ): URLString\n\n  \"\"\"An image of the front of the album packaging.\"\"\"\n  frontImage(\n    \"\"\"The size of the image to retrieve.\"\"\"\n    size: TheAudioDBImageSize = FULL\n  ): URLString\n\n  \"\"\"An image of the back of the album packaging.\"\"\"\n  backImage(\n    \"\"\"The size of the image to retrieve.\"\"\"\n    size: TheAudioDBImageSize = FULL\n  ): URLString\n\n  \"\"\"The primary musical genre of the album (e.g. “Alternative Rock”).\"\"\"\n  genre: String\n\n  \"\"\"The primary musical mood of the album (e.g. “Sad”).\"\"\"\n  mood: String\n\n  \"\"\"The primary musical style of the album (e.g. “Rock/Pop”).\"\"\"\n  style: String\n\n  \"\"\"\n  A rough description of the primary musical speed of the album (e.g. “Medium”).\n  \"\"\"\n  speed: String\n\n  \"\"\"The primary musical theme of the album (e.g. “In Love”).\"\"\"\n  theme: String\n}\n\n\"\"\"An artist on [TheAudioDB](http://www.theaudiodb.com/).\"\"\"\ntype TheAudioDBArtist {\n  \"\"\"TheAudioDB ID of the artist.\"\"\"\n  artistID: ID\n\n  \"\"\"A biography of the artist, often available in several languages.\"\"\"\n  biography(\n    \"\"\"\n    The two-letter code for the language in which to retrieve the biography.\n    \"\"\"\n    lang: String = \"en\"\n  ): String\n\n  \"\"\"The number of members in the musical group, if applicable.\"\"\"\n  memberCount: Int\n\n  \"\"\"\n  A 1000x185 JPG banner image containing the artist and their logo or name.\n  \"\"\"\n  banner(\n    \"\"\"The size of the image to retrieve.\"\"\"\n    size: TheAudioDBImageSize = FULL\n  ): URLString\n\n  \"\"\"A list of 1280x720 or 1920x1080 JPG images depicting the artist.\"\"\"\n  fanArt(\n    \"\"\"The size of the images to retrieve.\"\"\"\n    size: TheAudioDBImageSize = FULL\n  ): [URLString]!\n\n  \"\"\"\n  A 400x155 PNG image containing the artist’s logo or name, with a transparent\n  background.\n  \"\"\"\n  logo(\n    \"\"\"The size of the image to retrieve.\"\"\"\n    size: TheAudioDBImageSize = FULL\n  ): URLString\n\n  \"\"\"\n  A 1000x1000 JPG thumbnail image picturing the artist (usually containing\n  every member of a band).\n  \"\"\"\n  thumbnail(\n    \"\"\"The size of the image to retrieve.\"\"\"\n    size: TheAudioDBImageSize = FULL\n  ): URLString\n\n  \"\"\"The primary musical genre of the artist (e.g. “Alternative Rock”).\"\"\"\n  genre: String\n\n  \"\"\"The primary musical mood of the artist (e.g. “Sad”).\"\"\"\n  mood: String\n\n  \"\"\"The primary musical style of the artist (e.g. “Rock/Pop”).\"\"\"\n  style: String\n}\n\n\"\"\"\nThe image sizes that may be requested at [TheAudioDB](http://www.theaudiodb.com/).\n\"\"\"\nenum TheAudioDBImageSize {\n  \"\"\"The image’s full original dimensions.\"\"\"\n  FULL\n\n  \"\"\"A maximum dimension of 200px.\"\"\"\n  PREVIEW\n}\n\n\"\"\"\nDetails of a music video associated with a track on [TheAudioDB](http://www.theaudiodb.com/).\n\"\"\"\ntype TheAudioDBMusicVideo {\n  \"\"\"The URL where the music video can be found.\"\"\"\n  url: URLString\n\n  \"\"\"The video production company of the music video.\"\"\"\n  companyName: String\n\n  \"\"\"The director of the music video.\"\"\"\n  directorName: String\n\n  \"\"\"A list of still images from the music video.\"\"\"\n  screenshots(\n    \"\"\"The size of the images to retrieve.\"\"\"\n    size: TheAudioDBImageSize = FULL\n  ): [URLString]!\n\n  \"\"\"\n  The number of views the video has received at the given URL. This will rarely\n  be up to date, so use cautiously.\n  \"\"\"\n  viewCount: Float\n\n  \"\"\"\n  The number of likes the video has received at the given URL. This will rarely\n  be up to date, so use cautiously.\n  \"\"\"\n  likeCount: Float\n\n  \"\"\"\n  The number of dislikes the video has received at the given URL. This will\n  rarely be up to date, so use cautiously.\n  \"\"\"\n  dislikeCount: Float\n\n  \"\"\"\n  The number of comments the video has received at the given URL. This will\n  rarely be up to date, so use cautiously.\n  \"\"\"\n  commentCount: Float\n}\n\n\"\"\"\nA track on [TheAudioDB](http://www.theaudiodb.com/) corresponding with a\nMusicBrainz Recording.\n\"\"\"\ntype TheAudioDBTrack {\n  \"\"\"TheAudioDB ID of the track.\"\"\"\n  trackID: ID\n\n  \"\"\"TheAudioDB ID of the album on which the track appears.\"\"\"\n  albumID: ID\n\n  \"\"\"TheAudioDB ID of the artist who released the track.\"\"\"\n  artistID: ID\n\n  \"\"\"A description of the track.\"\"\"\n  description(\n    \"\"\"\n    The two-letter code for the language in which to retrieve the description.\n    \"\"\"\n    lang: String = \"en\"\n  ): String\n\n  \"\"\"A thumbnail image for the track.\"\"\"\n  thumbnail(\n    \"\"\"The size of the image to retrieve.\"\"\"\n    size: TheAudioDBImageSize = FULL\n  ): URLString\n\n  \"\"\"The track’s rating as determined by user votes, out of 10.\"\"\"\n  score: Float\n\n  \"\"\"The number of users who voted to determine the album’s score.\"\"\"\n  scoreVotes: Float\n\n  \"\"\"The track number of the song on the album.\"\"\"\n  trackNumber: Int\n\n  \"\"\"The official music video for the track.\"\"\"\n  musicVideo: TheAudioDBMusicVideo\n\n  \"\"\"The primary musical genre of the track (e.g. “Alternative Rock”).\"\"\"\n  genre: String\n\n  \"\"\"The primary musical mood of the track (e.g. “Sad”).\"\"\"\n  mood: String\n\n  \"\"\"The primary musical style of the track (e.g. “Rock/Pop”).\"\"\"\n  style: String\n\n  \"\"\"The primary musical theme of the track (e.g. “In Love”).\"\"\"\n  theme: String\n}\n\n\"\"\"A time of day, in 24-hour hh:mm notation.\"\"\"\nscalar Time\n\n\"\"\"\nA track is the way a recording is represented on a particular\n  release (or, more exactly, on a particular medium). Every track has a title\n  (see the guidelines for titles) and is credited to one or more artists.\n\"\"\"\ntype Track implements Entity {\n  \"\"\"The MBID of the entity.\"\"\"\n  mbid: MBID!\n\n  \"\"\"The official title of the entity.\"\"\"\n  title: String\n\n  \"\"\"\n  The track’s position on the overall release (including all\n  tracks from all discs).\n  \"\"\"\n  position: Int\n\n  \"\"\"\n  The track number, which may include information about the\n  disc or side it appears on, e.g. “A1” or “B3”.\n  \"\"\"\n  number: String\n\n  \"\"\"The length of the track.\"\"\"\n  length: Duration\n\n  \"\"\"The recording that appears on the track.\"\"\"\n  recording: Recording\n}\n\n\"\"\"\nA [URL](https://musicbrainz.org/doc/URL) pointing to a resource\nexternal to MusicBrainz, i.e. an official homepage, a site where music can be\nacquired, an entry in another database, etc.\n\"\"\"\ntype URL implements Node & Entity {\n  \"\"\"The ID of an object\"\"\"\n  id: ID!\n\n  \"\"\"The MBID of the entity.\"\"\"\n  mbid: MBID!\n\n  \"\"\"The actual URL string.\"\"\"\n  resource: URLString!\n\n  \"\"\"Relationships between this entity and other entitites.\"\"\"\n  relationships: Relationships\n}\n\n\"\"\"A web address.\"\"\"\nscalar URLString\n\n\"\"\"\nA [work](https://musicbrainz.org/doc/Work) is a distinct\nintellectual or artistic creation, which can be expressed in the form of one or\nmore audio recordings.\n\"\"\"\ntype Work implements Node & Entity {\n  \"\"\"The ID of an object\"\"\"\n  id: ID!\n\n  \"\"\"The MBID of the entity.\"\"\"\n  mbid: MBID!\n\n  \"\"\"The official title of the entity.\"\"\"\n  title: String\n\n  \"\"\"A comment used to help distinguish identically named entitites.\"\"\"\n  disambiguation: String\n\n  \"\"\"\n  [Aliases](https://musicbrainz.org/doc/Aliases) are used to store\n  alternate names or misspellings.\n  \"\"\"\n  aliases: [Alias]\n\n  \"\"\"\n  A list of [ISWCs](https://musicbrainz.org/doc/ISWC) assigned\n  to the work by copyright collecting agencies.\n  \"\"\"\n  iswcs: [String]\n\n  \"\"\"The language in which the work was originally written.\"\"\"\n  language: String\n\n  \"\"\"The type of work.\"\"\"\n  type: String\n\n  \"\"\"\n  The MBID associated with the value of the `type`\n  field.\n  \"\"\"\n  typeID: MBID\n\n  \"\"\"A list of artists linked to this entity.\"\"\"\n  artists(after: String, first: Int): ArtistConnection\n\n  \"\"\"Relationships between this entity and other entitites.\"\"\"\n  relationships: Relationships\n\n  \"\"\"A list of collections containing this entity.\"\"\"\n  collections(after: String, first: Int): CollectionConnection\n\n  \"\"\"The rating users have given to this entity.\"\"\"\n  rating: Rating\n\n  \"\"\"A list of tags linked to this entity.\"\"\"\n  tags(after: String, first: Int): TagConnection\n}\n\n\"\"\"A connection to a list of items.\"\"\"\ntype WorkConnection {\n  \"\"\"Information to aid in pagination.\"\"\"\n  pageInfo: PageInfo!\n\n  \"\"\"A list of edges.\"\"\"\n  edges: [WorkEdge]\n\n  \"\"\"\n  A list of nodes in the connection (without going through the\n  `edges` field).\n  \"\"\"\n  nodes: [Work]\n\n  \"\"\"\n  A count of the total number of items in this connection,\n  ignoring pagination.\n  \"\"\"\n  totalCount: Int\n}\n\n\"\"\"An edge in a connection.\"\"\"\ntype WorkEdge {\n  \"\"\"The item at the end of the edge\"\"\"\n  node: Work\n\n  \"\"\"A cursor for use in pagination\"\"\"\n  cursor: String!\n\n  \"\"\"\n  The relevancy score (0–100) assigned by the search engine, if\n  these results were found through a search.\n  \"\"\"\n  score: Int\n}\n"
  },
  {
    "path": "example/graphbrainz/lib/main.dart",
    "content": "import 'package:artemis/artemis.dart';\n\nimport 'queries/ed_sheeran.query.dart';\n\nvoid main() async {\n  final client = ArtemisClient(\n    'https://graphbrainz.herokuapp.com/',\n  );\n\n  final query = EdSheeranQuery();\n  final query2 = EdSheeranQuery();\n  final response = await client.execute(query);\n  client.dispose();\n\n  print('Equality works: ${query == query2}');\n\n  if (response.hasErrors) {\n    return print('Error: ${response.errors!.map((e) => e.message).toList()}');\n  }\n\n  print(response.data?.node?.$$typename);\n  final edSheeran = response.data?.node as EdSheeran$Query$Node$Artist;\n  print(edSheeran.name);\n  print(edSheeran.lifeSpan?.begin);\n}\n"
  },
  {
    "path": "example/graphbrainz/lib/queries/ed_sheeran.query.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\nexport 'ed_sheeran.query.graphql.dart';\n"
  },
  {
    "path": "example/graphbrainz/lib/queries/ed_sheeran.query.graphql",
    "content": "query ed_sheeran {\n  node(id: \"QXJ0aXN0OmI4YTdjNTFmLTM2MmMtNGRjYi1hMjU5LWJjNmUwMDk1ZjBhNg==\") {\n    __typename\n    id\n    ... on Artist {\n      mbid\n      name\n      releases {\n        nodes {\n          id\n          status\n        }\n      }\n      lifeSpan {\n        begin\n      }\n      spotify {\n        href\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "example/graphbrainz/lib/queries/ed_sheeran.query.graphql.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n// @dart = 2.12\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'ed_sheeran.query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass EdSheeran$Query$Node$Artist$ReleaseConnection$Release\n    extends JsonSerializable with EquatableMixin {\n  EdSheeran$Query$Node$Artist$ReleaseConnection$Release();\n\n  factory EdSheeran$Query$Node$Artist$ReleaseConnection$Release.fromJson(\n          Map<String, dynamic> json) =>\n      _$EdSheeran$Query$Node$Artist$ReleaseConnection$ReleaseFromJson(json);\n\n  late String id;\n\n  @JsonKey(unknownEnumValue: ReleaseStatus.artemisUnknown)\n  ReleaseStatus? status;\n\n  @override\n  List<Object?> get props => [id, status];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$EdSheeran$Query$Node$Artist$ReleaseConnection$ReleaseToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass EdSheeran$Query$Node$Artist$ReleaseConnection extends JsonSerializable\n    with EquatableMixin {\n  EdSheeran$Query$Node$Artist$ReleaseConnection();\n\n  factory EdSheeran$Query$Node$Artist$ReleaseConnection.fromJson(\n          Map<String, dynamic> json) =>\n      _$EdSheeran$Query$Node$Artist$ReleaseConnectionFromJson(json);\n\n  List<EdSheeran$Query$Node$Artist$ReleaseConnection$Release?>? nodes;\n\n  @override\n  List<Object?> get props => [nodes];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$EdSheeran$Query$Node$Artist$ReleaseConnectionToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass EdSheeran$Query$Node$Artist$LifeSpan extends JsonSerializable\n    with EquatableMixin {\n  EdSheeran$Query$Node$Artist$LifeSpan();\n\n  factory EdSheeran$Query$Node$Artist$LifeSpan.fromJson(\n          Map<String, dynamic> json) =>\n      _$EdSheeran$Query$Node$Artist$LifeSpanFromJson(json);\n\n  DateTime? begin;\n\n  @override\n  List<Object?> get props => [begin];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$EdSheeran$Query$Node$Artist$LifeSpanToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass EdSheeran$Query$Node$Artist$SpotifyArtist extends JsonSerializable\n    with EquatableMixin {\n  EdSheeran$Query$Node$Artist$SpotifyArtist();\n\n  factory EdSheeran$Query$Node$Artist$SpotifyArtist.fromJson(\n          Map<String, dynamic> json) =>\n      _$EdSheeran$Query$Node$Artist$SpotifyArtistFromJson(json);\n\n  late String href;\n\n  @override\n  List<Object?> get props => [href];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$EdSheeran$Query$Node$Artist$SpotifyArtistToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass EdSheeran$Query$Node$Artist extends EdSheeran$Query$Node\n    with EquatableMixin {\n  EdSheeran$Query$Node$Artist();\n\n  factory EdSheeran$Query$Node$Artist.fromJson(Map<String, dynamic> json) =>\n      _$EdSheeran$Query$Node$ArtistFromJson(json);\n\n  late String mbid;\n\n  String? name;\n\n  EdSheeran$Query$Node$Artist$ReleaseConnection? releases;\n\n  EdSheeran$Query$Node$Artist$LifeSpan? lifeSpan;\n\n  EdSheeran$Query$Node$Artist$SpotifyArtist? spotify;\n\n  @override\n  List<Object?> get props => [mbid, name, releases, lifeSpan, spotify];\n  @override\n  Map<String, dynamic> toJson() => _$EdSheeran$Query$Node$ArtistToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass EdSheeran$Query$Node extends JsonSerializable with EquatableMixin {\n  EdSheeran$Query$Node();\n\n  factory EdSheeran$Query$Node.fromJson(Map<String, dynamic> json) {\n    switch (json['__typename'].toString()) {\n      case r'Artist':\n        return EdSheeran$Query$Node$Artist.fromJson(json);\n      default:\n    }\n    return _$EdSheeran$Query$NodeFromJson(json);\n  }\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  late String id;\n\n  @override\n  List<Object?> get props => [$$typename, id];\n  @override\n  Map<String, dynamic> toJson() {\n    switch ($$typename) {\n      case r'Artist':\n        return (this as EdSheeran$Query$Node$Artist).toJson();\n      default:\n    }\n    return _$EdSheeran$Query$NodeToJson(this);\n  }\n}\n\n@JsonSerializable(explicitToJson: true)\nclass EdSheeran$Query extends JsonSerializable with EquatableMixin {\n  EdSheeran$Query();\n\n  factory EdSheeran$Query.fromJson(Map<String, dynamic> json) =>\n      _$EdSheeran$QueryFromJson(json);\n\n  EdSheeran$Query$Node? node;\n\n  @override\n  List<Object?> get props => [node];\n  @override\n  Map<String, dynamic> toJson() => _$EdSheeran$QueryToJson(this);\n}\n\nenum ReleaseStatus {\n  @JsonValue('OFFICIAL')\n  official,\n  @JsonValue('PROMOTION')\n  promotion,\n  @JsonValue('BOOTLEG')\n  bootleg,\n  @JsonValue('PSEUDORELEASE')\n  pseudorelease,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n\nfinal ED_SHEERAN_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n      type: OperationType.query,\n      name: NameNode(value: 'ed_sheeran'),\n      variableDefinitions: [],\n      directives: [],\n      selectionSet: SelectionSetNode(selections: [\n        FieldNode(\n            name: NameNode(value: 'node'),\n            alias: null,\n            arguments: [\n              ArgumentNode(\n                  name: NameNode(value: 'id'),\n                  value: StringValueNode(\n                      value:\n                          'QXJ0aXN0OmI4YTdjNTFmLTM2MmMtNGRjYi1hMjU5LWJjNmUwMDk1ZjBhNg==',\n                      isBlock: false))\n            ],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FieldNode(\n                  name: NameNode(value: '__typename'),\n                  alias: null,\n                  arguments: [],\n                  directives: [],\n                  selectionSet: null),\n              FieldNode(\n                  name: NameNode(value: 'id'),\n                  alias: null,\n                  arguments: [],\n                  directives: [],\n                  selectionSet: null),\n              InlineFragmentNode(\n                  typeCondition: TypeConditionNode(\n                      on: NamedTypeNode(\n                          name: NameNode(value: 'Artist'), isNonNull: false)),\n                  directives: [],\n                  selectionSet: SelectionSetNode(selections: [\n                    FieldNode(\n                        name: NameNode(value: 'mbid'),\n                        alias: null,\n                        arguments: [],\n                        directives: [],\n                        selectionSet: null),\n                    FieldNode(\n                        name: NameNode(value: 'name'),\n                        alias: null,\n                        arguments: [],\n                        directives: [],\n                        selectionSet: null),\n                    FieldNode(\n                        name: NameNode(value: 'releases'),\n                        alias: null,\n                        arguments: [],\n                        directives: [],\n                        selectionSet: SelectionSetNode(selections: [\n                          FieldNode(\n                              name: NameNode(value: 'nodes'),\n                              alias: null,\n                              arguments: [],\n                              directives: [],\n                              selectionSet: SelectionSetNode(selections: [\n                                FieldNode(\n                                    name: NameNode(value: 'id'),\n                                    alias: null,\n                                    arguments: [],\n                                    directives: [],\n                                    selectionSet: null),\n                                FieldNode(\n                                    name: NameNode(value: 'status'),\n                                    alias: null,\n                                    arguments: [],\n                                    directives: [],\n                                    selectionSet: null)\n                              ]))\n                        ])),\n                    FieldNode(\n                        name: NameNode(value: 'lifeSpan'),\n                        alias: null,\n                        arguments: [],\n                        directives: [],\n                        selectionSet: SelectionSetNode(selections: [\n                          FieldNode(\n                              name: NameNode(value: 'begin'),\n                              alias: null,\n                              arguments: [],\n                              directives: [],\n                              selectionSet: null)\n                        ])),\n                    FieldNode(\n                        name: NameNode(value: 'spotify'),\n                        alias: null,\n                        arguments: [],\n                        directives: [],\n                        selectionSet: SelectionSetNode(selections: [\n                          FieldNode(\n                              name: NameNode(value: 'href'),\n                              alias: null,\n                              arguments: [],\n                              directives: [],\n                              selectionSet: null)\n                        ]))\n                  ]))\n            ]))\n      ]))\n]);\n\nclass EdSheeranQuery extends GraphQLQuery<EdSheeran$Query, JsonSerializable> {\n  EdSheeranQuery();\n\n  @override\n  final DocumentNode document = ED_SHEERAN_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = 'ed_sheeran';\n\n  @override\n  List<Object?> get props => [document, operationName];\n  @override\n  EdSheeran$Query parse(Map<String, dynamic> json) =>\n      EdSheeran$Query.fromJson(json);\n}\n"
  },
  {
    "path": "example/graphbrainz/lib/queries/ed_sheeran.query.graphql.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n// @dart=2.12\n\npart of 'ed_sheeran.query.graphql.dart';\n\n// **************************************************************************\n// JsonSerializableGenerator\n// **************************************************************************\n\nEdSheeran$Query$Node$Artist$ReleaseConnection$Release\n    _$EdSheeran$Query$Node$Artist$ReleaseConnection$ReleaseFromJson(\n            Map<String, dynamic> json) =>\n        EdSheeran$Query$Node$Artist$ReleaseConnection$Release()\n          ..id = json['id'] as String\n          ..status = _$enumDecodeNullable(\n              _$ReleaseStatusEnumMap, json['status'],\n              unknownValue: ReleaseStatus.artemisUnknown);\n\nMap<String, dynamic>\n    _$EdSheeran$Query$Node$Artist$ReleaseConnection$ReleaseToJson(\n            EdSheeran$Query$Node$Artist$ReleaseConnection$Release instance) =>\n        <String, dynamic>{\n          'id': instance.id,\n          'status': _$ReleaseStatusEnumMap[instance.status],\n        };\n\nK _$enumDecode<K, V>(\n  Map<K, V> enumValues,\n  Object? source, {\n  K? unknownValue,\n}) {\n  if (source == null) {\n    throw ArgumentError(\n      'A value must be provided. Supported values: '\n      '${enumValues.values.join(', ')}',\n    );\n  }\n\n  return enumValues.entries.singleWhere(\n    (e) => e.value == source,\n    orElse: () {\n      if (unknownValue == null) {\n        throw ArgumentError(\n          '`$source` is not one of the supported values: '\n          '${enumValues.values.join(', ')}',\n        );\n      }\n      return MapEntry(unknownValue, enumValues.values.first);\n    },\n  ).key;\n}\n\nK? _$enumDecodeNullable<K, V>(\n  Map<K, V> enumValues,\n  dynamic source, {\n  K? unknownValue,\n}) {\n  if (source == null) {\n    return null;\n  }\n  return _$enumDecode<K, V>(enumValues, source, unknownValue: unknownValue);\n}\n\nconst _$ReleaseStatusEnumMap = {\n  ReleaseStatus.official: 'OFFICIAL',\n  ReleaseStatus.promotion: 'PROMOTION',\n  ReleaseStatus.bootleg: 'BOOTLEG',\n  ReleaseStatus.pseudorelease: 'PSEUDORELEASE',\n  ReleaseStatus.artemisUnknown: 'ARTEMIS_UNKNOWN',\n};\n\nEdSheeran$Query$Node$Artist$ReleaseConnection\n    _$EdSheeran$Query$Node$Artist$ReleaseConnectionFromJson(\n            Map<String, dynamic> json) =>\n        EdSheeran$Query$Node$Artist$ReleaseConnection()\n          ..nodes = (json['nodes'] as List<dynamic>?)\n              ?.map((e) => e == null\n                  ? null\n                  : EdSheeran$Query$Node$Artist$ReleaseConnection$Release\n                      .fromJson(e as Map<String, dynamic>))\n              .toList();\n\nMap<String, dynamic> _$EdSheeran$Query$Node$Artist$ReleaseConnectionToJson(\n        EdSheeran$Query$Node$Artist$ReleaseConnection instance) =>\n    <String, dynamic>{\n      'nodes': instance.nodes?.map((e) => e?.toJson()).toList(),\n    };\n\nEdSheeran$Query$Node$Artist$LifeSpan\n    _$EdSheeran$Query$Node$Artist$LifeSpanFromJson(Map<String, dynamic> json) =>\n        EdSheeran$Query$Node$Artist$LifeSpan()\n          ..begin = json['begin'] == null\n              ? null\n              : DateTime.parse(json['begin'] as String);\n\nMap<String, dynamic> _$EdSheeran$Query$Node$Artist$LifeSpanToJson(\n        EdSheeran$Query$Node$Artist$LifeSpan instance) =>\n    <String, dynamic>{\n      'begin': instance.begin?.toIso8601String(),\n    };\n\nEdSheeran$Query$Node$Artist$SpotifyArtist\n    _$EdSheeran$Query$Node$Artist$SpotifyArtistFromJson(\n            Map<String, dynamic> json) =>\n        EdSheeran$Query$Node$Artist$SpotifyArtist()\n          ..href = json['href'] as String;\n\nMap<String, dynamic> _$EdSheeran$Query$Node$Artist$SpotifyArtistToJson(\n        EdSheeran$Query$Node$Artist$SpotifyArtist instance) =>\n    <String, dynamic>{\n      'href': instance.href,\n    };\n\nEdSheeran$Query$Node$Artist _$EdSheeran$Query$Node$ArtistFromJson(\n        Map<String, dynamic> json) =>\n    EdSheeran$Query$Node$Artist()\n      ..$$typename = json['__typename'] as String?\n      ..id = json['id'] as String\n      ..mbid = json['mbid'] as String\n      ..name = json['name'] as String?\n      ..releases = json['releases'] == null\n          ? null\n          : EdSheeran$Query$Node$Artist$ReleaseConnection.fromJson(\n              json['releases'] as Map<String, dynamic>)\n      ..lifeSpan = json['lifeSpan'] == null\n          ? null\n          : EdSheeran$Query$Node$Artist$LifeSpan.fromJson(\n              json['lifeSpan'] as Map<String, dynamic>)\n      ..spotify = json['spotify'] == null\n          ? null\n          : EdSheeran$Query$Node$Artist$SpotifyArtist.fromJson(\n              json['spotify'] as Map<String, dynamic>);\n\nMap<String, dynamic> _$EdSheeran$Query$Node$ArtistToJson(\n        EdSheeran$Query$Node$Artist instance) =>\n    <String, dynamic>{\n      '__typename': instance.$$typename,\n      'id': instance.id,\n      'mbid': instance.mbid,\n      'name': instance.name,\n      'releases': instance.releases?.toJson(),\n      'lifeSpan': instance.lifeSpan?.toJson(),\n      'spotify': instance.spotify?.toJson(),\n    };\n\nEdSheeran$Query$Node _$EdSheeran$Query$NodeFromJson(\n        Map<String, dynamic> json) =>\n    EdSheeran$Query$Node()\n      ..$$typename = json['__typename'] as String?\n      ..id = json['id'] as String;\n\nMap<String, dynamic> _$EdSheeran$Query$NodeToJson(\n        EdSheeran$Query$Node instance) =>\n    <String, dynamic>{\n      '__typename': instance.$$typename,\n      'id': instance.id,\n    };\n\nEdSheeran$Query _$EdSheeran$QueryFromJson(Map<String, dynamic> json) =>\n    EdSheeran$Query()\n      ..node = json['node'] == null\n          ? null\n          : EdSheeran$Query$Node.fromJson(json['node'] as Map<String, dynamic>);\n\nMap<String, dynamic> _$EdSheeran$QueryToJson(EdSheeran$Query instance) =>\n    <String, dynamic>{\n      'node': instance.node?.toJson(),\n    };\n"
  },
  {
    "path": "example/graphbrainz/pubspec.yaml",
    "content": "name: graphbrainz_example\nversion: 0.0.1\n\nenvironment:\n  sdk: \">=2.12.0 <3.0.0\"\n\ndependencies:\n  http:\n  intl:\n\ndev_dependencies:\n  test:\n  build_runner:\n  json_serializable:\n  lints: ^1.0.1\n  artemis:\n    path: ../../.\n"
  },
  {
    "path": "example/hasura/build.yaml",
    "content": "targets:\n  $default:\n    sources:\n      - lib/**\n      - graphql/**\n      - schema.graphql\n    builders:\n      artemis:\n        options:\n          # fragments_glob: graphql/**.fragment.graphql\n          schema_mapping:\n            - schema: schema.graphql\n              queries_glob: graphql/messages_with_users.graphql\n              output: lib/graphql/messages_with_users.graphql.dart\n"
  },
  {
    "path": "example/hasura/graphql/messages_with_users.graphql",
    "content": "subscription messages_with_users {\n  messages {\n    id\n    message\n    profile {\n      id\n      name\n    }\n  }\n}\n"
  },
  {
    "path": "example/hasura/hasura.sql",
    "content": "CREATE TABLE profile (\n  id INTEGER PRIMARY KEY,\n  name TEXT\n)\n\nCREATE TABLE messages (\n  id INT PRIMARY KEY,\n  message TEXT,\n  profile_id INTEGER REFERENCES profile(id),\n)"
  },
  {
    "path": "example/hasura/lib/graphql/messages_with_users.graphql.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n// @dart = 2.12\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'messages_with_users.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass MessagesWithUsers$SubscriptionRoot$Messages$Profile\n    extends JsonSerializable with EquatableMixin {\n  MessagesWithUsers$SubscriptionRoot$Messages$Profile();\n\n  factory MessagesWithUsers$SubscriptionRoot$Messages$Profile.fromJson(\n          Map<String, dynamic> json) =>\n      _$MessagesWithUsers$SubscriptionRoot$Messages$ProfileFromJson(json);\n\n  late int id;\n\n  late String name;\n\n  @override\n  List<Object?> get props => [id, name];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$MessagesWithUsers$SubscriptionRoot$Messages$ProfileToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass MessagesWithUsers$SubscriptionRoot$Messages extends JsonSerializable\n    with EquatableMixin {\n  MessagesWithUsers$SubscriptionRoot$Messages();\n\n  factory MessagesWithUsers$SubscriptionRoot$Messages.fromJson(\n          Map<String, dynamic> json) =>\n      _$MessagesWithUsers$SubscriptionRoot$MessagesFromJson(json);\n\n  late int id;\n\n  late String message;\n\n  late MessagesWithUsers$SubscriptionRoot$Messages$Profile profile;\n\n  @override\n  List<Object?> get props => [id, message, profile];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$MessagesWithUsers$SubscriptionRoot$MessagesToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass MessagesWithUsers$SubscriptionRoot extends JsonSerializable\n    with EquatableMixin {\n  MessagesWithUsers$SubscriptionRoot();\n\n  factory MessagesWithUsers$SubscriptionRoot.fromJson(\n          Map<String, dynamic> json) =>\n      _$MessagesWithUsers$SubscriptionRootFromJson(json);\n\n  late List<MessagesWithUsers$SubscriptionRoot$Messages> messages;\n\n  @override\n  List<Object?> get props => [messages];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$MessagesWithUsers$SubscriptionRootToJson(this);\n}\n\nfinal MESSAGES_WITH_USERS_SUBSCRIPTION_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n      type: OperationType.subscription,\n      name: NameNode(value: 'messages_with_users'),\n      variableDefinitions: [],\n      directives: [],\n      selectionSet: SelectionSetNode(selections: [\n        FieldNode(\n            name: NameNode(value: 'messages'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FieldNode(\n                  name: NameNode(value: 'id'),\n                  alias: null,\n                  arguments: [],\n                  directives: [],\n                  selectionSet: null),\n              FieldNode(\n                  name: NameNode(value: 'message'),\n                  alias: null,\n                  arguments: [],\n                  directives: [],\n                  selectionSet: null),\n              FieldNode(\n                  name: NameNode(value: 'profile'),\n                  alias: null,\n                  arguments: [],\n                  directives: [],\n                  selectionSet: SelectionSetNode(selections: [\n                    FieldNode(\n                        name: NameNode(value: 'id'),\n                        alias: null,\n                        arguments: [],\n                        directives: [],\n                        selectionSet: null),\n                    FieldNode(\n                        name: NameNode(value: 'name'),\n                        alias: null,\n                        arguments: [],\n                        directives: [],\n                        selectionSet: null)\n                  ]))\n            ]))\n      ]))\n]);\n\nclass MessagesWithUsersSubscription\n    extends GraphQLQuery<MessagesWithUsers$SubscriptionRoot, JsonSerializable> {\n  MessagesWithUsersSubscription();\n\n  @override\n  final DocumentNode document = MESSAGES_WITH_USERS_SUBSCRIPTION_DOCUMENT;\n\n  @override\n  final String operationName = 'messages_with_users';\n\n  @override\n  List<Object?> get props => [document, operationName];\n  @override\n  MessagesWithUsers$SubscriptionRoot parse(Map<String, dynamic> json) =>\n      MessagesWithUsers$SubscriptionRoot.fromJson(json);\n}\n"
  },
  {
    "path": "example/hasura/lib/graphql/messages_with_users.graphql.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n// @dart=2.12\n\npart of 'messages_with_users.graphql.dart';\n\n// **************************************************************************\n// JsonSerializableGenerator\n// **************************************************************************\n\nMessagesWithUsers$SubscriptionRoot$Messages$Profile\n    _$MessagesWithUsers$SubscriptionRoot$Messages$ProfileFromJson(\n            Map<String, dynamic> json) =>\n        MessagesWithUsers$SubscriptionRoot$Messages$Profile()\n          ..id = json['id'] as int\n          ..name = json['name'] as String;\n\nMap<String, dynamic>\n    _$MessagesWithUsers$SubscriptionRoot$Messages$ProfileToJson(\n            MessagesWithUsers$SubscriptionRoot$Messages$Profile instance) =>\n        <String, dynamic>{\n          'id': instance.id,\n          'name': instance.name,\n        };\n\nMessagesWithUsers$SubscriptionRoot$Messages\n    _$MessagesWithUsers$SubscriptionRoot$MessagesFromJson(\n            Map<String, dynamic> json) =>\n        MessagesWithUsers$SubscriptionRoot$Messages()\n          ..id = json['id'] as int\n          ..message = json['message'] as String\n          ..profile =\n              MessagesWithUsers$SubscriptionRoot$Messages$Profile.fromJson(\n                  json['profile'] as Map<String, dynamic>);\n\nMap<String, dynamic> _$MessagesWithUsers$SubscriptionRoot$MessagesToJson(\n        MessagesWithUsers$SubscriptionRoot$Messages instance) =>\n    <String, dynamic>{\n      'id': instance.id,\n      'message': instance.message,\n      'profile': instance.profile.toJson(),\n    };\n\nMessagesWithUsers$SubscriptionRoot _$MessagesWithUsers$SubscriptionRootFromJson(\n        Map<String, dynamic> json) =>\n    MessagesWithUsers$SubscriptionRoot()\n      ..messages = (json['messages'] as List<dynamic>)\n          .map((e) => MessagesWithUsers$SubscriptionRoot$Messages.fromJson(\n              e as Map<String, dynamic>))\n          .toList();\n\nMap<String, dynamic> _$MessagesWithUsers$SubscriptionRootToJson(\n        MessagesWithUsers$SubscriptionRoot instance) =>\n    <String, dynamic>{\n      'messages': instance.messages.map((e) => e.toJson()).toList(),\n    };\n"
  },
  {
    "path": "example/hasura/lib/main.dart",
    "content": "import 'dart:async';\n\nimport 'package:artemis/artemis.dart';\nimport 'package:gql_link/gql_link.dart';\nimport 'package:gql_websocket_link/gql_websocket_link.dart';\n\nimport 'graphql/messages_with_users.graphql.dart';\n\nFuture<void> main() async {\n  final client = ArtemisClient.fromLink(\n    Link.from([\n      WebSocketLink('ws://localhost:8080/v1/graphql', autoReconnect: true),\n    ]),\n  );\n\n  final messagesWithUsers = MessagesWithUsersSubscription();\n\n  client.stream(messagesWithUsers).listen((response) {\n    print(response.data?.messages.last.message);\n  });\n}\n"
  },
  {
    "path": "example/hasura/pubspec.yaml",
    "content": "name: hasura_example\nversion: 0.0.1\n\nenvironment:\n  sdk: \">=2.12.0 <3.0.0\"\n\ndependencies:\n  http:\n  gql_websocket_link:\n\ndev_dependencies:\n  test:\n  lints: ^1.0.1\n  build_runner:\n  json_serializable:\n  artemis:\n    path: ../../.\n"
  },
  {
    "path": "example/hasura/schema.graphql",
    "content": "schema {\n  query: query_root\n  mutation: mutation_root\n  subscription: subscription_root\n}\n\n\"\"\"\nexpression to compare columns of type Int. All fields are combined with logical 'AND'.\n\"\"\"\ninput Int_comparison_exp {\n  _eq: Int\n  _gt: Int\n  _gte: Int\n  _in: [Int!]\n  _is_null: Boolean\n  _lt: Int\n  _lte: Int\n  _neq: Int\n  _nin: [Int!]\n}\n\n\"\"\"\ncolumns and relationships of \"messages\"\n\"\"\"\ntype messages {\n  id: Int!\n  message: String!\n\n  \"\"\"An object relationship\"\"\"\n  profile: profile!\n  profile_id: Int!\n}\n\n\"\"\"\naggregated selection of \"messages\"\n\"\"\"\ntype messages_aggregate {\n  aggregate: messages_aggregate_fields\n  nodes: [messages!]!\n}\n\n\"\"\"\naggregate fields of \"messages\"\n\"\"\"\ntype messages_aggregate_fields {\n  avg: messages_avg_fields\n  count(columns: [messages_select_column!], distinct: Boolean): Int\n  max: messages_max_fields\n  min: messages_min_fields\n  stddev: messages_stddev_fields\n  stddev_pop: messages_stddev_pop_fields\n  stddev_samp: messages_stddev_samp_fields\n  sum: messages_sum_fields\n  var_pop: messages_var_pop_fields\n  var_samp: messages_var_samp_fields\n  variance: messages_variance_fields\n}\n\n\"\"\"\norder by aggregate values of table \"messages\"\n\"\"\"\ninput messages_aggregate_order_by {\n  avg: messages_avg_order_by\n  count: order_by\n  max: messages_max_order_by\n  min: messages_min_order_by\n  stddev: messages_stddev_order_by\n  stddev_pop: messages_stddev_pop_order_by\n  stddev_samp: messages_stddev_samp_order_by\n  sum: messages_sum_order_by\n  var_pop: messages_var_pop_order_by\n  var_samp: messages_var_samp_order_by\n  variance: messages_variance_order_by\n}\n\n\"\"\"\ninput type for inserting array relation for remote table \"messages\"\n\"\"\"\ninput messages_arr_rel_insert_input {\n  data: [messages_insert_input!]!\n  on_conflict: messages_on_conflict\n}\n\n\"\"\"aggregate avg on columns\"\"\"\ntype messages_avg_fields {\n  id: Float\n  profile_id: Float\n}\n\n\"\"\"\norder by avg() on columns of table \"messages\"\n\"\"\"\ninput messages_avg_order_by {\n  id: order_by\n  profile_id: order_by\n}\n\n\"\"\"\nBoolean expression to filter rows from the table \"messages\". All fields are combined with a logical 'AND'.\n\"\"\"\ninput messages_bool_exp {\n  _and: [messages_bool_exp]\n  _not: messages_bool_exp\n  _or: [messages_bool_exp]\n  id: Int_comparison_exp\n  message: String_comparison_exp\n  profile: profile_bool_exp\n  profile_id: Int_comparison_exp\n}\n\n\"\"\"\nunique or primary key constraints on table \"messages\"\n\"\"\"\nenum messages_constraint {\n  \"\"\"unique or primary key constraint\"\"\"\n  messages_pkey\n}\n\n\"\"\"\ninput type for incrementing integer column in table \"messages\"\n\"\"\"\ninput messages_inc_input {\n  id: Int\n  profile_id: Int\n}\n\n\"\"\"\ninput type for inserting data into table \"messages\"\n\"\"\"\ninput messages_insert_input {\n  id: Int\n  message: String\n  profile: profile_obj_rel_insert_input\n  profile_id: Int\n}\n\n\"\"\"aggregate max on columns\"\"\"\ntype messages_max_fields {\n  id: Int\n  message: String\n  profile_id: Int\n}\n\n\"\"\"\norder by max() on columns of table \"messages\"\n\"\"\"\ninput messages_max_order_by {\n  id: order_by\n  message: order_by\n  profile_id: order_by\n}\n\n\"\"\"aggregate min on columns\"\"\"\ntype messages_min_fields {\n  id: Int\n  message: String\n  profile_id: Int\n}\n\n\"\"\"\norder by min() on columns of table \"messages\"\n\"\"\"\ninput messages_min_order_by {\n  id: order_by\n  message: order_by\n  profile_id: order_by\n}\n\n\"\"\"\nresponse of any mutation on the table \"messages\"\n\"\"\"\ntype messages_mutation_response {\n  \"\"\"number of affected rows by the mutation\"\"\"\n  affected_rows: Int!\n\n  \"\"\"data of the affected rows by the mutation\"\"\"\n  returning: [messages!]!\n}\n\n\"\"\"\ninput type for inserting object relation for remote table \"messages\"\n\"\"\"\ninput messages_obj_rel_insert_input {\n  data: messages_insert_input!\n  on_conflict: messages_on_conflict\n}\n\n\"\"\"\non conflict condition type for table \"messages\"\n\"\"\"\ninput messages_on_conflict {\n  constraint: messages_constraint!\n  update_columns: [messages_update_column!]!\n  where: messages_bool_exp\n}\n\n\"\"\"\nordering options when selecting data from \"messages\"\n\"\"\"\ninput messages_order_by {\n  id: order_by\n  message: order_by\n  profile: profile_order_by\n  profile_id: order_by\n}\n\n\"\"\"\nprimary key columns input for table: \"messages\"\n\"\"\"\ninput messages_pk_columns_input {\n  id: Int!\n}\n\n\"\"\"\nselect columns of table \"messages\"\n\"\"\"\nenum messages_select_column {\n  \"\"\"column name\"\"\"\n  id\n\n  \"\"\"column name\"\"\"\n  message\n\n  \"\"\"column name\"\"\"\n  profile_id\n}\n\n\"\"\"\ninput type for updating data in table \"messages\"\n\"\"\"\ninput messages_set_input {\n  id: Int\n  message: String\n  profile_id: Int\n}\n\n\"\"\"aggregate stddev on columns\"\"\"\ntype messages_stddev_fields {\n  id: Float\n  profile_id: Float\n}\n\n\"\"\"\norder by stddev() on columns of table \"messages\"\n\"\"\"\ninput messages_stddev_order_by {\n  id: order_by\n  profile_id: order_by\n}\n\n\"\"\"aggregate stddev_pop on columns\"\"\"\ntype messages_stddev_pop_fields {\n  id: Float\n  profile_id: Float\n}\n\n\"\"\"\norder by stddev_pop() on columns of table \"messages\"\n\"\"\"\ninput messages_stddev_pop_order_by {\n  id: order_by\n  profile_id: order_by\n}\n\n\"\"\"aggregate stddev_samp on columns\"\"\"\ntype messages_stddev_samp_fields {\n  id: Float\n  profile_id: Float\n}\n\n\"\"\"\norder by stddev_samp() on columns of table \"messages\"\n\"\"\"\ninput messages_stddev_samp_order_by {\n  id: order_by\n  profile_id: order_by\n}\n\n\"\"\"aggregate sum on columns\"\"\"\ntype messages_sum_fields {\n  id: Int\n  profile_id: Int\n}\n\n\"\"\"\norder by sum() on columns of table \"messages\"\n\"\"\"\ninput messages_sum_order_by {\n  id: order_by\n  profile_id: order_by\n}\n\n\"\"\"\nupdate columns of table \"messages\"\n\"\"\"\nenum messages_update_column {\n  \"\"\"column name\"\"\"\n  id\n\n  \"\"\"column name\"\"\"\n  message\n\n  \"\"\"column name\"\"\"\n  profile_id\n}\n\n\"\"\"aggregate var_pop on columns\"\"\"\ntype messages_var_pop_fields {\n  id: Float\n  profile_id: Float\n}\n\n\"\"\"\norder by var_pop() on columns of table \"messages\"\n\"\"\"\ninput messages_var_pop_order_by {\n  id: order_by\n  profile_id: order_by\n}\n\n\"\"\"aggregate var_samp on columns\"\"\"\ntype messages_var_samp_fields {\n  id: Float\n  profile_id: Float\n}\n\n\"\"\"\norder by var_samp() on columns of table \"messages\"\n\"\"\"\ninput messages_var_samp_order_by {\n  id: order_by\n  profile_id: order_by\n}\n\n\"\"\"aggregate variance on columns\"\"\"\ntype messages_variance_fields {\n  id: Float\n  profile_id: Float\n}\n\n\"\"\"\norder by variance() on columns of table \"messages\"\n\"\"\"\ninput messages_variance_order_by {\n  id: order_by\n  profile_id: order_by\n}\n\n\"\"\"mutation root\"\"\"\ntype mutation_root {\n  \"\"\"\n  delete data from the table: \"messages\"\n  \"\"\"\n  delete_messages(\n    \"\"\"filter the rows which have to be deleted\"\"\"\n    where: messages_bool_exp!\n  ): messages_mutation_response\n\n  \"\"\"\n  delete single row from the table: \"messages\"\n  \"\"\"\n  delete_messages_by_pk(id: Int!): messages\n\n  \"\"\"\n  delete data from the table: \"profile\"\n  \"\"\"\n  delete_profile(\n    \"\"\"filter the rows which have to be deleted\"\"\"\n    where: profile_bool_exp!\n  ): profile_mutation_response\n\n  \"\"\"\n  delete single row from the table: \"profile\"\n  \"\"\"\n  delete_profile_by_pk(id: Int!): profile\n\n  \"\"\"\n  insert data into the table: \"messages\"\n  \"\"\"\n  insert_messages(\n    \"\"\"the rows to be inserted\"\"\"\n    objects: [messages_insert_input!]!\n\n    \"\"\"on conflict condition\"\"\"\n    on_conflict: messages_on_conflict\n  ): messages_mutation_response\n\n  \"\"\"\n  insert a single row into the table: \"messages\"\n  \"\"\"\n  insert_messages_one(\n    \"\"\"the row to be inserted\"\"\"\n    object: messages_insert_input!\n\n    \"\"\"on conflict condition\"\"\"\n    on_conflict: messages_on_conflict\n  ): messages\n\n  \"\"\"\n  insert data into the table: \"profile\"\n  \"\"\"\n  insert_profile(\n    \"\"\"the rows to be inserted\"\"\"\n    objects: [profile_insert_input!]!\n\n    \"\"\"on conflict condition\"\"\"\n    on_conflict: profile_on_conflict\n  ): profile_mutation_response\n\n  \"\"\"\n  insert a single row into the table: \"profile\"\n  \"\"\"\n  insert_profile_one(\n    \"\"\"the row to be inserted\"\"\"\n    object: profile_insert_input!\n\n    \"\"\"on conflict condition\"\"\"\n    on_conflict: profile_on_conflict\n  ): profile\n\n  \"\"\"\n  update data of the table: \"messages\"\n  \"\"\"\n  update_messages(\n    \"\"\"increments the integer columns with given value of the filtered values\"\"\"\n    _inc: messages_inc_input\n\n    \"\"\"sets the columns of the filtered rows to the given values\"\"\"\n    _set: messages_set_input\n\n    \"\"\"filter the rows which have to be updated\"\"\"\n    where: messages_bool_exp!\n  ): messages_mutation_response\n\n  \"\"\"\n  update single row of the table: \"messages\"\n  \"\"\"\n  update_messages_by_pk(\n    \"\"\"increments the integer columns with given value of the filtered values\"\"\"\n    _inc: messages_inc_input\n\n    \"\"\"sets the columns of the filtered rows to the given values\"\"\"\n    _set: messages_set_input\n    pk_columns: messages_pk_columns_input!\n  ): messages\n\n  \"\"\"\n  update data of the table: \"profile\"\n  \"\"\"\n  update_profile(\n    \"\"\"increments the integer columns with given value of the filtered values\"\"\"\n    _inc: profile_inc_input\n\n    \"\"\"sets the columns of the filtered rows to the given values\"\"\"\n    _set: profile_set_input\n\n    \"\"\"filter the rows which have to be updated\"\"\"\n    where: profile_bool_exp!\n  ): profile_mutation_response\n\n  \"\"\"\n  update single row of the table: \"profile\"\n  \"\"\"\n  update_profile_by_pk(\n    \"\"\"increments the integer columns with given value of the filtered values\"\"\"\n    _inc: profile_inc_input\n\n    \"\"\"sets the columns of the filtered rows to the given values\"\"\"\n    _set: profile_set_input\n    pk_columns: profile_pk_columns_input!\n  ): profile\n}\n\n\"\"\"column ordering options\"\"\"\nenum order_by {\n  \"\"\"in the ascending order, nulls last\"\"\"\n  asc\n\n  \"\"\"in the ascending order, nulls first\"\"\"\n  asc_nulls_first\n\n  \"\"\"in the ascending order, nulls last\"\"\"\n  asc_nulls_last\n\n  \"\"\"in the descending order, nulls first\"\"\"\n  desc\n\n  \"\"\"in the descending order, nulls first\"\"\"\n  desc_nulls_first\n\n  \"\"\"in the descending order, nulls last\"\"\"\n  desc_nulls_last\n}\n\n\"\"\"\ncolumns and relationships of \"profile\"\n\"\"\"\ntype profile {\n  id: Int!\n\n  \"\"\"An array relationship\"\"\"\n  messages(\n    \"\"\"distinct select on columns\"\"\"\n    distinct_on: [messages_select_column!]\n\n    \"\"\"limit the number of rows returned\"\"\"\n    limit: Int\n\n    \"\"\"skip the first n rows. Use only with order_by\"\"\"\n    offset: Int\n\n    \"\"\"sort the rows by one or more columns\"\"\"\n    order_by: [messages_order_by!]\n\n    \"\"\"filter the rows returned\"\"\"\n    where: messages_bool_exp\n  ): [messages!]!\n\n  \"\"\"An aggregated array relationship\"\"\"\n  messages_aggregate(\n    \"\"\"distinct select on columns\"\"\"\n    distinct_on: [messages_select_column!]\n\n    \"\"\"limit the number of rows returned\"\"\"\n    limit: Int\n\n    \"\"\"skip the first n rows. Use only with order_by\"\"\"\n    offset: Int\n\n    \"\"\"sort the rows by one or more columns\"\"\"\n    order_by: [messages_order_by!]\n\n    \"\"\"filter the rows returned\"\"\"\n    where: messages_bool_exp\n  ): messages_aggregate!\n  name: String!\n}\n\n\"\"\"\naggregated selection of \"profile\"\n\"\"\"\ntype profile_aggregate {\n  aggregate: profile_aggregate_fields\n  nodes: [profile!]!\n}\n\n\"\"\"\naggregate fields of \"profile\"\n\"\"\"\ntype profile_aggregate_fields {\n  avg: profile_avg_fields\n  count(columns: [profile_select_column!], distinct: Boolean): Int\n  max: profile_max_fields\n  min: profile_min_fields\n  stddev: profile_stddev_fields\n  stddev_pop: profile_stddev_pop_fields\n  stddev_samp: profile_stddev_samp_fields\n  sum: profile_sum_fields\n  var_pop: profile_var_pop_fields\n  var_samp: profile_var_samp_fields\n  variance: profile_variance_fields\n}\n\n\"\"\"\norder by aggregate values of table \"profile\"\n\"\"\"\ninput profile_aggregate_order_by {\n  avg: profile_avg_order_by\n  count: order_by\n  max: profile_max_order_by\n  min: profile_min_order_by\n  stddev: profile_stddev_order_by\n  stddev_pop: profile_stddev_pop_order_by\n  stddev_samp: profile_stddev_samp_order_by\n  sum: profile_sum_order_by\n  var_pop: profile_var_pop_order_by\n  var_samp: profile_var_samp_order_by\n  variance: profile_variance_order_by\n}\n\n\"\"\"\ninput type for inserting array relation for remote table \"profile\"\n\"\"\"\ninput profile_arr_rel_insert_input {\n  data: [profile_insert_input!]!\n  on_conflict: profile_on_conflict\n}\n\n\"\"\"aggregate avg on columns\"\"\"\ntype profile_avg_fields {\n  id: Float\n}\n\n\"\"\"\norder by avg() on columns of table \"profile\"\n\"\"\"\ninput profile_avg_order_by {\n  id: order_by\n}\n\n\"\"\"\nBoolean expression to filter rows from the table \"profile\". All fields are combined with a logical 'AND'.\n\"\"\"\ninput profile_bool_exp {\n  _and: [profile_bool_exp]\n  _not: profile_bool_exp\n  _or: [profile_bool_exp]\n  id: Int_comparison_exp\n  messages: messages_bool_exp\n  name: String_comparison_exp\n}\n\n\"\"\"\nunique or primary key constraints on table \"profile\"\n\"\"\"\nenum profile_constraint {\n  \"\"\"unique or primary key constraint\"\"\"\n  profile_pkey\n}\n\n\"\"\"\ninput type for incrementing integer column in table \"profile\"\n\"\"\"\ninput profile_inc_input {\n  id: Int\n}\n\n\"\"\"\ninput type for inserting data into table \"profile\"\n\"\"\"\ninput profile_insert_input {\n  id: Int\n  messages: messages_arr_rel_insert_input\n  name: String\n}\n\n\"\"\"aggregate max on columns\"\"\"\ntype profile_max_fields {\n  id: Int\n  name: String\n}\n\n\"\"\"\norder by max() on columns of table \"profile\"\n\"\"\"\ninput profile_max_order_by {\n  id: order_by\n  name: order_by\n}\n\n\"\"\"aggregate min on columns\"\"\"\ntype profile_min_fields {\n  id: Int\n  name: String\n}\n\n\"\"\"\norder by min() on columns of table \"profile\"\n\"\"\"\ninput profile_min_order_by {\n  id: order_by\n  name: order_by\n}\n\n\"\"\"\nresponse of any mutation on the table \"profile\"\n\"\"\"\ntype profile_mutation_response {\n  \"\"\"number of affected rows by the mutation\"\"\"\n  affected_rows: Int!\n\n  \"\"\"data of the affected rows by the mutation\"\"\"\n  returning: [profile!]!\n}\n\n\"\"\"\ninput type for inserting object relation for remote table \"profile\"\n\"\"\"\ninput profile_obj_rel_insert_input {\n  data: profile_insert_input!\n  on_conflict: profile_on_conflict\n}\n\n\"\"\"\non conflict condition type for table \"profile\"\n\"\"\"\ninput profile_on_conflict {\n  constraint: profile_constraint!\n  update_columns: [profile_update_column!]!\n  where: profile_bool_exp\n}\n\n\"\"\"\nordering options when selecting data from \"profile\"\n\"\"\"\ninput profile_order_by {\n  id: order_by\n  messages_aggregate: messages_aggregate_order_by\n  name: order_by\n}\n\n\"\"\"\nprimary key columns input for table: \"profile\"\n\"\"\"\ninput profile_pk_columns_input {\n  id: Int!\n}\n\n\"\"\"\nselect columns of table \"profile\"\n\"\"\"\nenum profile_select_column {\n  \"\"\"column name\"\"\"\n  id\n\n  \"\"\"column name\"\"\"\n  name\n}\n\n\"\"\"\ninput type for updating data in table \"profile\"\n\"\"\"\ninput profile_set_input {\n  id: Int\n  name: String\n}\n\n\"\"\"aggregate stddev on columns\"\"\"\ntype profile_stddev_fields {\n  id: Float\n}\n\n\"\"\"\norder by stddev() on columns of table \"profile\"\n\"\"\"\ninput profile_stddev_order_by {\n  id: order_by\n}\n\n\"\"\"aggregate stddev_pop on columns\"\"\"\ntype profile_stddev_pop_fields {\n  id: Float\n}\n\n\"\"\"\norder by stddev_pop() on columns of table \"profile\"\n\"\"\"\ninput profile_stddev_pop_order_by {\n  id: order_by\n}\n\n\"\"\"aggregate stddev_samp on columns\"\"\"\ntype profile_stddev_samp_fields {\n  id: Float\n}\n\n\"\"\"\norder by stddev_samp() on columns of table \"profile\"\n\"\"\"\ninput profile_stddev_samp_order_by {\n  id: order_by\n}\n\n\"\"\"aggregate sum on columns\"\"\"\ntype profile_sum_fields {\n  id: Int\n}\n\n\"\"\"\norder by sum() on columns of table \"profile\"\n\"\"\"\ninput profile_sum_order_by {\n  id: order_by\n}\n\n\"\"\"\nupdate columns of table \"profile\"\n\"\"\"\nenum profile_update_column {\n  \"\"\"column name\"\"\"\n  id\n\n  \"\"\"column name\"\"\"\n  name\n}\n\n\"\"\"aggregate var_pop on columns\"\"\"\ntype profile_var_pop_fields {\n  id: Float\n}\n\n\"\"\"\norder by var_pop() on columns of table \"profile\"\n\"\"\"\ninput profile_var_pop_order_by {\n  id: order_by\n}\n\n\"\"\"aggregate var_samp on columns\"\"\"\ntype profile_var_samp_fields {\n  id: Float\n}\n\n\"\"\"\norder by var_samp() on columns of table \"profile\"\n\"\"\"\ninput profile_var_samp_order_by {\n  id: order_by\n}\n\n\"\"\"aggregate variance on columns\"\"\"\ntype profile_variance_fields {\n  id: Float\n}\n\n\"\"\"\norder by variance() on columns of table \"profile\"\n\"\"\"\ninput profile_variance_order_by {\n  id: order_by\n}\n\n\"\"\"query root\"\"\"\ntype query_root {\n  \"\"\"\n  fetch data from the table: \"messages\"\n  \"\"\"\n  messages(\n    \"\"\"distinct select on columns\"\"\"\n    distinct_on: [messages_select_column!]\n\n    \"\"\"limit the number of rows returned\"\"\"\n    limit: Int\n\n    \"\"\"skip the first n rows. Use only with order_by\"\"\"\n    offset: Int\n\n    \"\"\"sort the rows by one or more columns\"\"\"\n    order_by: [messages_order_by!]\n\n    \"\"\"filter the rows returned\"\"\"\n    where: messages_bool_exp\n  ): [messages!]!\n\n  \"\"\"\n  fetch aggregated fields from the table: \"messages\"\n  \"\"\"\n  messages_aggregate(\n    \"\"\"distinct select on columns\"\"\"\n    distinct_on: [messages_select_column!]\n\n    \"\"\"limit the number of rows returned\"\"\"\n    limit: Int\n\n    \"\"\"skip the first n rows. Use only with order_by\"\"\"\n    offset: Int\n\n    \"\"\"sort the rows by one or more columns\"\"\"\n    order_by: [messages_order_by!]\n\n    \"\"\"filter the rows returned\"\"\"\n    where: messages_bool_exp\n  ): messages_aggregate!\n\n  \"\"\"fetch data from the table: \"messages\" using primary key columns\"\"\"\n  messages_by_pk(id: Int!): messages\n\n  \"\"\"\n  fetch data from the table: \"profile\"\n  \"\"\"\n  profile(\n    \"\"\"distinct select on columns\"\"\"\n    distinct_on: [profile_select_column!]\n\n    \"\"\"limit the number of rows returned\"\"\"\n    limit: Int\n\n    \"\"\"skip the first n rows. Use only with order_by\"\"\"\n    offset: Int\n\n    \"\"\"sort the rows by one or more columns\"\"\"\n    order_by: [profile_order_by!]\n\n    \"\"\"filter the rows returned\"\"\"\n    where: profile_bool_exp\n  ): [profile!]!\n\n  \"\"\"\n  fetch aggregated fields from the table: \"profile\"\n  \"\"\"\n  profile_aggregate(\n    \"\"\"distinct select on columns\"\"\"\n    distinct_on: [profile_select_column!]\n\n    \"\"\"limit the number of rows returned\"\"\"\n    limit: Int\n\n    \"\"\"skip the first n rows. Use only with order_by\"\"\"\n    offset: Int\n\n    \"\"\"sort the rows by one or more columns\"\"\"\n    order_by: [profile_order_by!]\n\n    \"\"\"filter the rows returned\"\"\"\n    where: profile_bool_exp\n  ): profile_aggregate!\n\n  \"\"\"fetch data from the table: \"profile\" using primary key columns\"\"\"\n  profile_by_pk(id: Int!): profile\n}\n\n\"\"\"\nexpression to compare columns of type String. All fields are combined with logical 'AND'.\n\"\"\"\ninput String_comparison_exp {\n  _eq: String\n  _gt: String\n  _gte: String\n  _ilike: String\n  _in: [String!]\n  _is_null: Boolean\n  _like: String\n  _lt: String\n  _lte: String\n  _neq: String\n  _nilike: String\n  _nin: [String!]\n  _nlike: String\n  _nsimilar: String\n  _similar: String\n}\n\n\"\"\"subscription root\"\"\"\ntype subscription_root {\n  \"\"\"\n  fetch data from the table: \"messages\"\n  \"\"\"\n  messages(\n    \"\"\"distinct select on columns\"\"\"\n    distinct_on: [messages_select_column!]\n\n    \"\"\"limit the number of rows returned\"\"\"\n    limit: Int\n\n    \"\"\"skip the first n rows. Use only with order_by\"\"\"\n    offset: Int\n\n    \"\"\"sort the rows by one or more columns\"\"\"\n    order_by: [messages_order_by!]\n\n    \"\"\"filter the rows returned\"\"\"\n    where: messages_bool_exp\n  ): [messages!]!\n\n  \"\"\"\n  fetch aggregated fields from the table: \"messages\"\n  \"\"\"\n  messages_aggregate(\n    \"\"\"distinct select on columns\"\"\"\n    distinct_on: [messages_select_column!]\n\n    \"\"\"limit the number of rows returned\"\"\"\n    limit: Int\n\n    \"\"\"skip the first n rows. Use only with order_by\"\"\"\n    offset: Int\n\n    \"\"\"sort the rows by one or more columns\"\"\"\n    order_by: [messages_order_by!]\n\n    \"\"\"filter the rows returned\"\"\"\n    where: messages_bool_exp\n  ): messages_aggregate!\n\n  \"\"\"fetch data from the table: \"messages\" using primary key columns\"\"\"\n  messages_by_pk(id: Int!): messages\n\n  \"\"\"\n  fetch data from the table: \"profile\"\n  \"\"\"\n  profile(\n    \"\"\"distinct select on columns\"\"\"\n    distinct_on: [profile_select_column!]\n\n    \"\"\"limit the number of rows returned\"\"\"\n    limit: Int\n\n    \"\"\"skip the first n rows. Use only with order_by\"\"\"\n    offset: Int\n\n    \"\"\"sort the rows by one or more columns\"\"\"\n    order_by: [profile_order_by!]\n\n    \"\"\"filter the rows returned\"\"\"\n    where: profile_bool_exp\n  ): [profile!]!\n\n  \"\"\"\n  fetch aggregated fields from the table: \"profile\"\n  \"\"\"\n  profile_aggregate(\n    \"\"\"distinct select on columns\"\"\"\n    distinct_on: [profile_select_column!]\n\n    \"\"\"limit the number of rows returned\"\"\"\n    limit: Int\n\n    \"\"\"skip the first n rows. Use only with order_by\"\"\"\n    offset: Int\n\n    \"\"\"sort the rows by one or more columns\"\"\"\n    order_by: [profile_order_by!]\n\n    \"\"\"filter the rows returned\"\"\"\n    where: profile_bool_exp\n  ): profile_aggregate!\n\n  \"\"\"fetch data from the table: \"profile\" using primary key columns\"\"\"\n  profile_by_pk(id: Int!): profile\n}\n"
  },
  {
    "path": "example/pokemon/build.yaml",
    "content": "targets:\n  $default:\n    sources:\n      - lib/**\n      - graphql/**\n      - pokemon.schema.graphql\n    builders:\n      artemis:\n        options:\n          fragments_glob: graphql/**.fragment.graphql\n          schema_mapping:\n            - schema: pokemon.schema.graphql\n              queries_glob: graphql/simple_query.query.graphql\n              output: lib/graphql/simple_query.dart\n            - schema: pokemon.schema.graphql\n              queries_glob: graphql/big_query.query.graphql\n              output: lib/graphql/big_query.dart\n            - schema: pokemon.schema.graphql\n              queries_glob: graphql/fragment_query.query.graphql\n              output: lib/graphql/fragment_query.dart\n            - schema: pokemon.schema.graphql\n              queries_glob: graphql/fragments_glob.query.graphql\n              output: lib/graphql/fragments_glob.dart\n"
  },
  {
    "path": "example/pokemon/graphql/big_query.query.graphql",
    "content": "query big_query($quantity: Int!) {\n  charmander: pokemon(name: \"Charmander\") {\n    number\n    types\n  }\n  pokemons(first: $quantity) {\n    number\n    name\n    types\n    evolutions: evolutions {\n      number\n      name\n    }\n  }\n}"
  },
  {
    "path": "example/pokemon/graphql/fragment_query.query.graphql",
    "content": "query fragmentQuery($quantity: Int!) {\n  charmander: pokemon(name: \"Charmander\") {\n    ...PokemonParts\n  }\n  pokemons(first: $quantity) {\n    ...PokemonParts\n    evolutions: evolutions {\n      ...PokemonParts\n    }\n  }\n}"
  },
  {
    "path": "example/pokemon/graphql/fragments_glob.fragment.graphql",
    "content": "fragment Pokemon on Pokemon {\n  \t\tid\n      weight {\n        ...weight\n      }\n      attacks {\n        ...pokemonAttack\n      }\n    \n}\n\nfragment PokemonParts on Pokemon {\n  number\n  name\n  types\n}\n\nfragment weight on PokemonDimension {\n  \tminimum\n}\n\nfragment pokemonAttack on PokemonAttack {\n  special {\n    ...attack\n  }\n}\n\nfragment attack on Attack {\n  name\n}"
  },
  {
    "path": "example/pokemon/graphql/fragments_glob.query.graphql",
    "content": "{\n  pokemon(name: \"Pikachu\") {\n    ...Pokemon\n    evolutions {\n      ...Pokemon\n    }\n  }\n}"
  },
  {
    "path": "example/pokemon/graphql/simple_query.query.graphql",
    "content": "query simple_query {\n  pokemon(name: \"Charmander\") {\n    number\n    types\n  }\n}"
  },
  {
    "path": "example/pokemon/lib/graphql/big_query.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\nexport 'big_query.graphql.dart';\n"
  },
  {
    "path": "example/pokemon/lib/graphql/big_query.graphql.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n// @dart = 2.12\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'big_query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass BigQuery$Query$Charmander extends JsonSerializable with EquatableMixin {\n  BigQuery$Query$Charmander();\n\n  factory BigQuery$Query$Charmander.fromJson(Map<String, dynamic> json) =>\n      _$BigQuery$Query$CharmanderFromJson(json);\n\n  String? number;\n\n  List<String?>? types;\n\n  @override\n  List<Object?> get props => [number, types];\n  @override\n  Map<String, dynamic> toJson() => _$BigQuery$Query$CharmanderToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass BigQuery$Query$Pokemon$Evolutions extends JsonSerializable\n    with EquatableMixin {\n  BigQuery$Query$Pokemon$Evolutions();\n\n  factory BigQuery$Query$Pokemon$Evolutions.fromJson(\n          Map<String, dynamic> json) =>\n      _$BigQuery$Query$Pokemon$EvolutionsFromJson(json);\n\n  String? number;\n\n  String? name;\n\n  @override\n  List<Object?> get props => [number, name];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$BigQuery$Query$Pokemon$EvolutionsToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass BigQuery$Query$Pokemon extends JsonSerializable with EquatableMixin {\n  BigQuery$Query$Pokemon();\n\n  factory BigQuery$Query$Pokemon.fromJson(Map<String, dynamic> json) =>\n      _$BigQuery$Query$PokemonFromJson(json);\n\n  String? number;\n\n  String? name;\n\n  List<String?>? types;\n\n  List<BigQuery$Query$Pokemon$Evolutions?>? evolutions;\n\n  @override\n  List<Object?> get props => [number, name, types, evolutions];\n  @override\n  Map<String, dynamic> toJson() => _$BigQuery$Query$PokemonToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass BigQuery$Query extends JsonSerializable with EquatableMixin {\n  BigQuery$Query();\n\n  factory BigQuery$Query.fromJson(Map<String, dynamic> json) =>\n      _$BigQuery$QueryFromJson(json);\n\n  BigQuery$Query$Charmander? charmander;\n\n  List<BigQuery$Query$Pokemon?>? pokemons;\n\n  @override\n  List<Object?> get props => [charmander, pokemons];\n  @override\n  Map<String, dynamic> toJson() => _$BigQuery$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass BigQueryArguments extends JsonSerializable with EquatableMixin {\n  BigQueryArguments({required this.quantity});\n\n  @override\n  factory BigQueryArguments.fromJson(Map<String, dynamic> json) =>\n      _$BigQueryArgumentsFromJson(json);\n\n  late int quantity;\n\n  @override\n  List<Object?> get props => [quantity];\n  @override\n  Map<String, dynamic> toJson() => _$BigQueryArgumentsToJson(this);\n}\n\nfinal BIG_QUERY_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n      type: OperationType.query,\n      name: NameNode(value: 'big_query'),\n      variableDefinitions: [\n        VariableDefinitionNode(\n            variable: VariableNode(name: NameNode(value: 'quantity')),\n            type: NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true),\n            defaultValue: DefaultValueNode(value: null),\n            directives: [])\n      ],\n      directives: [],\n      selectionSet: SelectionSetNode(selections: [\n        FieldNode(\n            name: NameNode(value: 'pokemon'),\n            alias: NameNode(value: 'charmander'),\n            arguments: [\n              ArgumentNode(\n                  name: NameNode(value: 'name'),\n                  value: StringValueNode(value: 'Charmander', isBlock: false))\n            ],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FieldNode(\n                  name: NameNode(value: 'number'),\n                  alias: null,\n                  arguments: [],\n                  directives: [],\n                  selectionSet: null),\n              FieldNode(\n                  name: NameNode(value: 'types'),\n                  alias: null,\n                  arguments: [],\n                  directives: [],\n                  selectionSet: null)\n            ])),\n        FieldNode(\n            name: NameNode(value: 'pokemons'),\n            alias: null,\n            arguments: [\n              ArgumentNode(\n                  name: NameNode(value: 'first'),\n                  value: VariableNode(name: NameNode(value: 'quantity')))\n            ],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FieldNode(\n                  name: NameNode(value: 'number'),\n                  alias: null,\n                  arguments: [],\n                  directives: [],\n                  selectionSet: null),\n              FieldNode(\n                  name: NameNode(value: 'name'),\n                  alias: null,\n                  arguments: [],\n                  directives: [],\n                  selectionSet: null),\n              FieldNode(\n                  name: NameNode(value: 'types'),\n                  alias: null,\n                  arguments: [],\n                  directives: [],\n                  selectionSet: null),\n              FieldNode(\n                  name: NameNode(value: 'evolutions'),\n                  alias: NameNode(value: 'evolutions'),\n                  arguments: [],\n                  directives: [],\n                  selectionSet: SelectionSetNode(selections: [\n                    FieldNode(\n                        name: NameNode(value: 'number'),\n                        alias: null,\n                        arguments: [],\n                        directives: [],\n                        selectionSet: null),\n                    FieldNode(\n                        name: NameNode(value: 'name'),\n                        alias: null,\n                        arguments: [],\n                        directives: [],\n                        selectionSet: null)\n                  ]))\n            ]))\n      ]))\n]);\n\nclass BigQueryQuery extends GraphQLQuery<BigQuery$Query, BigQueryArguments> {\n  BigQueryQuery({required this.variables});\n\n  @override\n  final DocumentNode document = BIG_QUERY_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = 'big_query';\n\n  @override\n  final BigQueryArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  BigQuery$Query parse(Map<String, dynamic> json) =>\n      BigQuery$Query.fromJson(json);\n}\n"
  },
  {
    "path": "example/pokemon/lib/graphql/big_query.graphql.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n// @dart=2.12\n\npart of 'big_query.graphql.dart';\n\n// **************************************************************************\n// JsonSerializableGenerator\n// **************************************************************************\n\nBigQuery$Query$Charmander _$BigQuery$Query$CharmanderFromJson(\n        Map<String, dynamic> json) =>\n    BigQuery$Query$Charmander()\n      ..number = json['number'] as String?\n      ..types =\n          (json['types'] as List<dynamic>?)?.map((e) => e as String?).toList();\n\nMap<String, dynamic> _$BigQuery$Query$CharmanderToJson(\n        BigQuery$Query$Charmander instance) =>\n    <String, dynamic>{\n      'number': instance.number,\n      'types': instance.types,\n    };\n\nBigQuery$Query$Pokemon$Evolutions _$BigQuery$Query$Pokemon$EvolutionsFromJson(\n        Map<String, dynamic> json) =>\n    BigQuery$Query$Pokemon$Evolutions()\n      ..number = json['number'] as String?\n      ..name = json['name'] as String?;\n\nMap<String, dynamic> _$BigQuery$Query$Pokemon$EvolutionsToJson(\n        BigQuery$Query$Pokemon$Evolutions instance) =>\n    <String, dynamic>{\n      'number': instance.number,\n      'name': instance.name,\n    };\n\nBigQuery$Query$Pokemon _$BigQuery$Query$PokemonFromJson(\n        Map<String, dynamic> json) =>\n    BigQuery$Query$Pokemon()\n      ..number = json['number'] as String?\n      ..name = json['name'] as String?\n      ..types =\n          (json['types'] as List<dynamic>?)?.map((e) => e as String?).toList()\n      ..evolutions = (json['evolutions'] as List<dynamic>?)\n          ?.map((e) => e == null\n              ? null\n              : BigQuery$Query$Pokemon$Evolutions.fromJson(\n                  e as Map<String, dynamic>))\n          .toList();\n\nMap<String, dynamic> _$BigQuery$Query$PokemonToJson(\n        BigQuery$Query$Pokemon instance) =>\n    <String, dynamic>{\n      'number': instance.number,\n      'name': instance.name,\n      'types': instance.types,\n      'evolutions': instance.evolutions?.map((e) => e?.toJson()).toList(),\n    };\n\nBigQuery$Query _$BigQuery$QueryFromJson(Map<String, dynamic> json) =>\n    BigQuery$Query()\n      ..charmander = json['charmander'] == null\n          ? null\n          : BigQuery$Query$Charmander.fromJson(\n              json['charmander'] as Map<String, dynamic>)\n      ..pokemons = (json['pokemons'] as List<dynamic>?)\n          ?.map((e) => e == null\n              ? null\n              : BigQuery$Query$Pokemon.fromJson(e as Map<String, dynamic>))\n          .toList();\n\nMap<String, dynamic> _$BigQuery$QueryToJson(BigQuery$Query instance) =>\n    <String, dynamic>{\n      'charmander': instance.charmander?.toJson(),\n      'pokemons': instance.pokemons?.map((e) => e?.toJson()).toList(),\n    };\n\nBigQueryArguments _$BigQueryArgumentsFromJson(Map<String, dynamic> json) =>\n    BigQueryArguments(\n      quantity: json['quantity'] as int,\n    );\n\nMap<String, dynamic> _$BigQueryArgumentsToJson(BigQueryArguments instance) =>\n    <String, dynamic>{\n      'quantity': instance.quantity,\n    };\n"
  },
  {
    "path": "example/pokemon/lib/graphql/fragment_query.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\nexport 'fragment_query.graphql.dart';\n"
  },
  {
    "path": "example/pokemon/lib/graphql/fragment_query.graphql.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n// @dart = 2.12\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'fragment_query.graphql.g.dart';\n\nmixin PokemonPartsMixin {\n  String? number;\n  String? name;\n  List<String?>? types;\n}\n\n@JsonSerializable(explicitToJson: true)\nclass FragmentQuery$Query$Charmander extends JsonSerializable\n    with EquatableMixin, PokemonPartsMixin {\n  FragmentQuery$Query$Charmander();\n\n  factory FragmentQuery$Query$Charmander.fromJson(Map<String, dynamic> json) =>\n      _$FragmentQuery$Query$CharmanderFromJson(json);\n\n  @override\n  List<Object?> get props => [number, name, types];\n  @override\n  Map<String, dynamic> toJson() => _$FragmentQuery$Query$CharmanderToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass FragmentQuery$Query$Pokemon$Evolutions extends JsonSerializable\n    with EquatableMixin, PokemonPartsMixin {\n  FragmentQuery$Query$Pokemon$Evolutions();\n\n  factory FragmentQuery$Query$Pokemon$Evolutions.fromJson(\n          Map<String, dynamic> json) =>\n      _$FragmentQuery$Query$Pokemon$EvolutionsFromJson(json);\n\n  @override\n  List<Object?> get props => [number, name, types];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$FragmentQuery$Query$Pokemon$EvolutionsToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass FragmentQuery$Query$Pokemon extends JsonSerializable\n    with EquatableMixin, PokemonPartsMixin {\n  FragmentQuery$Query$Pokemon();\n\n  factory FragmentQuery$Query$Pokemon.fromJson(Map<String, dynamic> json) =>\n      _$FragmentQuery$Query$PokemonFromJson(json);\n\n  List<FragmentQuery$Query$Pokemon$Evolutions?>? evolutions;\n\n  @override\n  List<Object?> get props => [number, name, types, evolutions];\n  @override\n  Map<String, dynamic> toJson() => _$FragmentQuery$Query$PokemonToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass FragmentQuery$Query extends JsonSerializable with EquatableMixin {\n  FragmentQuery$Query();\n\n  factory FragmentQuery$Query.fromJson(Map<String, dynamic> json) =>\n      _$FragmentQuery$QueryFromJson(json);\n\n  FragmentQuery$Query$Charmander? charmander;\n\n  List<FragmentQuery$Query$Pokemon?>? pokemons;\n\n  @override\n  List<Object?> get props => [charmander, pokemons];\n  @override\n  Map<String, dynamic> toJson() => _$FragmentQuery$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass FragmentQueryArguments extends JsonSerializable with EquatableMixin {\n  FragmentQueryArguments({required this.quantity});\n\n  @override\n  factory FragmentQueryArguments.fromJson(Map<String, dynamic> json) =>\n      _$FragmentQueryArgumentsFromJson(json);\n\n  late int quantity;\n\n  @override\n  List<Object?> get props => [quantity];\n  @override\n  Map<String, dynamic> toJson() => _$FragmentQueryArgumentsToJson(this);\n}\n\nfinal FRAGMENT_QUERY_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n      type: OperationType.query,\n      name: NameNode(value: 'fragmentQuery'),\n      variableDefinitions: [\n        VariableDefinitionNode(\n            variable: VariableNode(name: NameNode(value: 'quantity')),\n            type: NamedTypeNode(name: NameNode(value: 'Int'), isNonNull: true),\n            defaultValue: DefaultValueNode(value: null),\n            directives: [])\n      ],\n      directives: [],\n      selectionSet: SelectionSetNode(selections: [\n        FieldNode(\n            name: NameNode(value: 'pokemon'),\n            alias: NameNode(value: 'charmander'),\n            arguments: [\n              ArgumentNode(\n                  name: NameNode(value: 'name'),\n                  value: StringValueNode(value: 'Charmander', isBlock: false))\n            ],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FragmentSpreadNode(\n                  name: NameNode(value: 'PokemonParts'), directives: [])\n            ])),\n        FieldNode(\n            name: NameNode(value: 'pokemons'),\n            alias: null,\n            arguments: [\n              ArgumentNode(\n                  name: NameNode(value: 'first'),\n                  value: VariableNode(name: NameNode(value: 'quantity')))\n            ],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FragmentSpreadNode(\n                  name: NameNode(value: 'PokemonParts'), directives: []),\n              FieldNode(\n                  name: NameNode(value: 'evolutions'),\n                  alias: NameNode(value: 'evolutions'),\n                  arguments: [],\n                  directives: [],\n                  selectionSet: SelectionSetNode(selections: [\n                    FragmentSpreadNode(\n                        name: NameNode(value: 'PokemonParts'), directives: [])\n                  ]))\n            ]))\n      ])),\n  FragmentDefinitionNode(\n      name: NameNode(value: 'PokemonParts'),\n      typeCondition: TypeConditionNode(\n          on: NamedTypeNode(\n              name: NameNode(value: 'Pokemon'), isNonNull: false)),\n      directives: [],\n      selectionSet: SelectionSetNode(selections: [\n        FieldNode(\n            name: NameNode(value: 'number'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null),\n        FieldNode(\n            name: NameNode(value: 'name'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null),\n        FieldNode(\n            name: NameNode(value: 'types'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null)\n      ]))\n]);\n\nclass FragmentQueryQuery\n    extends GraphQLQuery<FragmentQuery$Query, FragmentQueryArguments> {\n  FragmentQueryQuery({required this.variables});\n\n  @override\n  final DocumentNode document = FRAGMENT_QUERY_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = 'fragmentQuery';\n\n  @override\n  final FragmentQueryArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  FragmentQuery$Query parse(Map<String, dynamic> json) =>\n      FragmentQuery$Query.fromJson(json);\n}\n"
  },
  {
    "path": "example/pokemon/lib/graphql/fragment_query.graphql.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n// @dart=2.12\n\npart of 'fragment_query.graphql.dart';\n\n// **************************************************************************\n// JsonSerializableGenerator\n// **************************************************************************\n\nFragmentQuery$Query$Charmander _$FragmentQuery$Query$CharmanderFromJson(\n        Map<String, dynamic> json) =>\n    FragmentQuery$Query$Charmander()\n      ..number = json['number'] as String?\n      ..name = json['name'] as String?\n      ..types =\n          (json['types'] as List<dynamic>?)?.map((e) => e as String?).toList();\n\nMap<String, dynamic> _$FragmentQuery$Query$CharmanderToJson(\n        FragmentQuery$Query$Charmander instance) =>\n    <String, dynamic>{\n      'number': instance.number,\n      'name': instance.name,\n      'types': instance.types,\n    };\n\nFragmentQuery$Query$Pokemon$Evolutions\n    _$FragmentQuery$Query$Pokemon$EvolutionsFromJson(\n            Map<String, dynamic> json) =>\n        FragmentQuery$Query$Pokemon$Evolutions()\n          ..number = json['number'] as String?\n          ..name = json['name'] as String?\n          ..types = (json['types'] as List<dynamic>?)\n              ?.map((e) => e as String?)\n              .toList();\n\nMap<String, dynamic> _$FragmentQuery$Query$Pokemon$EvolutionsToJson(\n        FragmentQuery$Query$Pokemon$Evolutions instance) =>\n    <String, dynamic>{\n      'number': instance.number,\n      'name': instance.name,\n      'types': instance.types,\n    };\n\nFragmentQuery$Query$Pokemon _$FragmentQuery$Query$PokemonFromJson(\n        Map<String, dynamic> json) =>\n    FragmentQuery$Query$Pokemon()\n      ..number = json['number'] as String?\n      ..name = json['name'] as String?\n      ..types =\n          (json['types'] as List<dynamic>?)?.map((e) => e as String?).toList()\n      ..evolutions = (json['evolutions'] as List<dynamic>?)\n          ?.map((e) => e == null\n              ? null\n              : FragmentQuery$Query$Pokemon$Evolutions.fromJson(\n                  e as Map<String, dynamic>))\n          .toList();\n\nMap<String, dynamic> _$FragmentQuery$Query$PokemonToJson(\n        FragmentQuery$Query$Pokemon instance) =>\n    <String, dynamic>{\n      'number': instance.number,\n      'name': instance.name,\n      'types': instance.types,\n      'evolutions': instance.evolutions?.map((e) => e?.toJson()).toList(),\n    };\n\nFragmentQuery$Query _$FragmentQuery$QueryFromJson(Map<String, dynamic> json) =>\n    FragmentQuery$Query()\n      ..charmander = json['charmander'] == null\n          ? null\n          : FragmentQuery$Query$Charmander.fromJson(\n              json['charmander'] as Map<String, dynamic>)\n      ..pokemons = (json['pokemons'] as List<dynamic>?)\n          ?.map((e) => e == null\n              ? null\n              : FragmentQuery$Query$Pokemon.fromJson(e as Map<String, dynamic>))\n          .toList();\n\nMap<String, dynamic> _$FragmentQuery$QueryToJson(\n        FragmentQuery$Query instance) =>\n    <String, dynamic>{\n      'charmander': instance.charmander?.toJson(),\n      'pokemons': instance.pokemons?.map((e) => e?.toJson()).toList(),\n    };\n\nFragmentQueryArguments _$FragmentQueryArgumentsFromJson(\n        Map<String, dynamic> json) =>\n    FragmentQueryArguments(\n      quantity: json['quantity'] as int,\n    );\n\nMap<String, dynamic> _$FragmentQueryArgumentsToJson(\n        FragmentQueryArguments instance) =>\n    <String, dynamic>{\n      'quantity': instance.quantity,\n    };\n"
  },
  {
    "path": "example/pokemon/lib/graphql/fragments_glob.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\nexport 'fragments_glob.graphql.dart';\n"
  },
  {
    "path": "example/pokemon/lib/graphql/fragments_glob.graphql.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n// @dart = 2.12\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'fragments_glob.graphql.g.dart';\n\nmixin PokemonMixin {\n  late String id;\n  PokemonMixin$PokemonDimension? weight;\n  PokemonMixin$PokemonAttack? attacks;\n}\nmixin WeightMixin {\n  String? minimum;\n}\nmixin PokemonAttackMixin {\n  List<PokemonAttackMixin$Attack?>? special;\n}\nmixin AttackMixin {\n  String? name;\n}\n\n@JsonSerializable(explicitToJson: true)\nclass FragmentsGlob$Query$Pokemon$Pokemon extends JsonSerializable\n    with EquatableMixin, PokemonMixin {\n  FragmentsGlob$Query$Pokemon$Pokemon();\n\n  factory FragmentsGlob$Query$Pokemon$Pokemon.fromJson(\n          Map<String, dynamic> json) =>\n      _$FragmentsGlob$Query$Pokemon$PokemonFromJson(json);\n\n  @override\n  List<Object?> get props => [id, weight, attacks];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$FragmentsGlob$Query$Pokemon$PokemonToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass FragmentsGlob$Query$Pokemon extends JsonSerializable\n    with EquatableMixin, PokemonMixin {\n  FragmentsGlob$Query$Pokemon();\n\n  factory FragmentsGlob$Query$Pokemon.fromJson(Map<String, dynamic> json) =>\n      _$FragmentsGlob$Query$PokemonFromJson(json);\n\n  List<FragmentsGlob$Query$Pokemon$Pokemon?>? evolutions;\n\n  @override\n  List<Object?> get props => [id, weight, attacks, evolutions];\n  @override\n  Map<String, dynamic> toJson() => _$FragmentsGlob$Query$PokemonToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass FragmentsGlob$Query extends JsonSerializable with EquatableMixin {\n  FragmentsGlob$Query();\n\n  factory FragmentsGlob$Query.fromJson(Map<String, dynamic> json) =>\n      _$FragmentsGlob$QueryFromJson(json);\n\n  FragmentsGlob$Query$Pokemon? pokemon;\n\n  @override\n  List<Object?> get props => [pokemon];\n  @override\n  Map<String, dynamic> toJson() => _$FragmentsGlob$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass PokemonMixin$PokemonDimension extends JsonSerializable\n    with EquatableMixin, WeightMixin {\n  PokemonMixin$PokemonDimension();\n\n  factory PokemonMixin$PokemonDimension.fromJson(Map<String, dynamic> json) =>\n      _$PokemonMixin$PokemonDimensionFromJson(json);\n\n  @override\n  List<Object?> get props => [minimum];\n  @override\n  Map<String, dynamic> toJson() => _$PokemonMixin$PokemonDimensionToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass PokemonMixin$PokemonAttack extends JsonSerializable\n    with EquatableMixin, PokemonAttackMixin {\n  PokemonMixin$PokemonAttack();\n\n  factory PokemonMixin$PokemonAttack.fromJson(Map<String, dynamic> json) =>\n      _$PokemonMixin$PokemonAttackFromJson(json);\n\n  @override\n  List<Object?> get props => [special];\n  @override\n  Map<String, dynamic> toJson() => _$PokemonMixin$PokemonAttackToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass PokemonAttackMixin$Attack extends JsonSerializable\n    with EquatableMixin, AttackMixin {\n  PokemonAttackMixin$Attack();\n\n  factory PokemonAttackMixin$Attack.fromJson(Map<String, dynamic> json) =>\n      _$PokemonAttackMixin$AttackFromJson(json);\n\n  @override\n  List<Object?> get props => [name];\n  @override\n  Map<String, dynamic> toJson() => _$PokemonAttackMixin$AttackToJson(this);\n}\n\nfinal FRAGMENTS_GLOB_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n      type: OperationType.query,\n      name: null,\n      variableDefinitions: [],\n      directives: [],\n      selectionSet: SelectionSetNode(selections: [\n        FieldNode(\n            name: NameNode(value: 'pokemon'),\n            alias: null,\n            arguments: [\n              ArgumentNode(\n                  name: NameNode(value: 'name'),\n                  value: StringValueNode(value: 'Pikachu', isBlock: false))\n            ],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FragmentSpreadNode(\n                  name: NameNode(value: 'Pokemon'), directives: []),\n              FieldNode(\n                  name: NameNode(value: 'evolutions'),\n                  alias: null,\n                  arguments: [],\n                  directives: [],\n                  selectionSet: SelectionSetNode(selections: [\n                    FragmentSpreadNode(\n                        name: NameNode(value: 'Pokemon'), directives: [])\n                  ]))\n            ]))\n      ])),\n  FragmentDefinitionNode(\n      name: NameNode(value: 'Pokemon'),\n      typeCondition: TypeConditionNode(\n          on: NamedTypeNode(\n              name: NameNode(value: 'Pokemon'), isNonNull: false)),\n      directives: [],\n      selectionSet: SelectionSetNode(selections: [\n        FieldNode(\n            name: NameNode(value: 'id'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null),\n        FieldNode(\n            name: NameNode(value: 'weight'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FragmentSpreadNode(\n                  name: NameNode(value: 'weight'), directives: [])\n            ])),\n        FieldNode(\n            name: NameNode(value: 'attacks'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FragmentSpreadNode(\n                  name: NameNode(value: 'pokemonAttack'), directives: [])\n            ]))\n      ])),\n  FragmentDefinitionNode(\n      name: NameNode(value: 'weight'),\n      typeCondition: TypeConditionNode(\n          on: NamedTypeNode(\n              name: NameNode(value: 'PokemonDimension'), isNonNull: false)),\n      directives: [],\n      selectionSet: SelectionSetNode(selections: [\n        FieldNode(\n            name: NameNode(value: 'minimum'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null)\n      ])),\n  FragmentDefinitionNode(\n      name: NameNode(value: 'pokemonAttack'),\n      typeCondition: TypeConditionNode(\n          on: NamedTypeNode(\n              name: NameNode(value: 'PokemonAttack'), isNonNull: false)),\n      directives: [],\n      selectionSet: SelectionSetNode(selections: [\n        FieldNode(\n            name: NameNode(value: 'special'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FragmentSpreadNode(\n                  name: NameNode(value: 'attack'), directives: [])\n            ]))\n      ])),\n  FragmentDefinitionNode(\n      name: NameNode(value: 'attack'),\n      typeCondition: TypeConditionNode(\n          on: NamedTypeNode(name: NameNode(value: 'Attack'), isNonNull: false)),\n      directives: [],\n      selectionSet: SelectionSetNode(selections: [\n        FieldNode(\n            name: NameNode(value: 'name'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null)\n      ]))\n]);\n\nclass FragmentsGlobQuery\n    extends GraphQLQuery<FragmentsGlob$Query, JsonSerializable> {\n  FragmentsGlobQuery();\n\n  @override\n  final DocumentNode document = FRAGMENTS_GLOB_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = 'fragments_glob';\n\n  @override\n  List<Object?> get props => [document, operationName];\n  @override\n  FragmentsGlob$Query parse(Map<String, dynamic> json) =>\n      FragmentsGlob$Query.fromJson(json);\n}\n"
  },
  {
    "path": "example/pokemon/lib/graphql/fragments_glob.graphql.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n// @dart=2.12\n\npart of 'fragments_glob.graphql.dart';\n\n// **************************************************************************\n// JsonSerializableGenerator\n// **************************************************************************\n\nFragmentsGlob$Query$Pokemon$Pokemon\n    _$FragmentsGlob$Query$Pokemon$PokemonFromJson(Map<String, dynamic> json) =>\n        FragmentsGlob$Query$Pokemon$Pokemon()\n          ..id = json['id'] as String\n          ..weight = json['weight'] == null\n              ? null\n              : PokemonMixin$PokemonDimension.fromJson(\n                  json['weight'] as Map<String, dynamic>)\n          ..attacks = json['attacks'] == null\n              ? null\n              : PokemonMixin$PokemonAttack.fromJson(\n                  json['attacks'] as Map<String, dynamic>);\n\nMap<String, dynamic> _$FragmentsGlob$Query$Pokemon$PokemonToJson(\n        FragmentsGlob$Query$Pokemon$Pokemon instance) =>\n    <String, dynamic>{\n      'id': instance.id,\n      'weight': instance.weight?.toJson(),\n      'attacks': instance.attacks?.toJson(),\n    };\n\nFragmentsGlob$Query$Pokemon _$FragmentsGlob$Query$PokemonFromJson(\n        Map<String, dynamic> json) =>\n    FragmentsGlob$Query$Pokemon()\n      ..id = json['id'] as String\n      ..weight = json['weight'] == null\n          ? null\n          : PokemonMixin$PokemonDimension.fromJson(\n              json['weight'] as Map<String, dynamic>)\n      ..attacks = json['attacks'] == null\n          ? null\n          : PokemonMixin$PokemonAttack.fromJson(\n              json['attacks'] as Map<String, dynamic>)\n      ..evolutions = (json['evolutions'] as List<dynamic>?)\n          ?.map((e) => e == null\n              ? null\n              : FragmentsGlob$Query$Pokemon$Pokemon.fromJson(\n                  e as Map<String, dynamic>))\n          .toList();\n\nMap<String, dynamic> _$FragmentsGlob$Query$PokemonToJson(\n        FragmentsGlob$Query$Pokemon instance) =>\n    <String, dynamic>{\n      'id': instance.id,\n      'weight': instance.weight?.toJson(),\n      'attacks': instance.attacks?.toJson(),\n      'evolutions': instance.evolutions?.map((e) => e?.toJson()).toList(),\n    };\n\nFragmentsGlob$Query _$FragmentsGlob$QueryFromJson(Map<String, dynamic> json) =>\n    FragmentsGlob$Query()\n      ..pokemon = json['pokemon'] == null\n          ? null\n          : FragmentsGlob$Query$Pokemon.fromJson(\n              json['pokemon'] as Map<String, dynamic>);\n\nMap<String, dynamic> _$FragmentsGlob$QueryToJson(\n        FragmentsGlob$Query instance) =>\n    <String, dynamic>{\n      'pokemon': instance.pokemon?.toJson(),\n    };\n\nPokemonMixin$PokemonDimension _$PokemonMixin$PokemonDimensionFromJson(\n        Map<String, dynamic> json) =>\n    PokemonMixin$PokemonDimension()..minimum = json['minimum'] as String?;\n\nMap<String, dynamic> _$PokemonMixin$PokemonDimensionToJson(\n        PokemonMixin$PokemonDimension instance) =>\n    <String, dynamic>{\n      'minimum': instance.minimum,\n    };\n\nPokemonMixin$PokemonAttack _$PokemonMixin$PokemonAttackFromJson(\n        Map<String, dynamic> json) =>\n    PokemonMixin$PokemonAttack()\n      ..special = (json['special'] as List<dynamic>?)\n          ?.map((e) => e == null\n              ? null\n              : PokemonAttackMixin$Attack.fromJson(e as Map<String, dynamic>))\n          .toList();\n\nMap<String, dynamic> _$PokemonMixin$PokemonAttackToJson(\n        PokemonMixin$PokemonAttack instance) =>\n    <String, dynamic>{\n      'special': instance.special?.map((e) => e?.toJson()).toList(),\n    };\n\nPokemonAttackMixin$Attack _$PokemonAttackMixin$AttackFromJson(\n        Map<String, dynamic> json) =>\n    PokemonAttackMixin$Attack()..name = json['name'] as String?;\n\nMap<String, dynamic> _$PokemonAttackMixin$AttackToJson(\n        PokemonAttackMixin$Attack instance) =>\n    <String, dynamic>{\n      'name': instance.name,\n    };\n"
  },
  {
    "path": "example/pokemon/lib/graphql/simple_query.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\nexport 'simple_query.graphql.dart';\n"
  },
  {
    "path": "example/pokemon/lib/graphql/simple_query.graphql.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n// @dart = 2.12\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'simple_query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SimpleQuery$Query$Pokemon extends JsonSerializable with EquatableMixin {\n  SimpleQuery$Query$Pokemon();\n\n  factory SimpleQuery$Query$Pokemon.fromJson(Map<String, dynamic> json) =>\n      _$SimpleQuery$Query$PokemonFromJson(json);\n\n  String? number;\n\n  List<String?>? types;\n\n  @override\n  List<Object?> get props => [number, types];\n  @override\n  Map<String, dynamic> toJson() => _$SimpleQuery$Query$PokemonToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SimpleQuery$Query extends JsonSerializable with EquatableMixin {\n  SimpleQuery$Query();\n\n  factory SimpleQuery$Query.fromJson(Map<String, dynamic> json) =>\n      _$SimpleQuery$QueryFromJson(json);\n\n  SimpleQuery$Query$Pokemon? pokemon;\n\n  @override\n  List<Object?> get props => [pokemon];\n  @override\n  Map<String, dynamic> toJson() => _$SimpleQuery$QueryToJson(this);\n}\n\nfinal SIMPLE_QUERY_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n      type: OperationType.query,\n      name: NameNode(value: 'simple_query'),\n      variableDefinitions: [],\n      directives: [],\n      selectionSet: SelectionSetNode(selections: [\n        FieldNode(\n            name: NameNode(value: 'pokemon'),\n            alias: null,\n            arguments: [\n              ArgumentNode(\n                  name: NameNode(value: 'name'),\n                  value: StringValueNode(value: 'Charmander', isBlock: false))\n            ],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FieldNode(\n                  name: NameNode(value: 'number'),\n                  alias: null,\n                  arguments: [],\n                  directives: [],\n                  selectionSet: null),\n              FieldNode(\n                  name: NameNode(value: 'types'),\n                  alias: null,\n                  arguments: [],\n                  directives: [],\n                  selectionSet: null)\n            ]))\n      ]))\n]);\n\nclass SimpleQueryQuery\n    extends GraphQLQuery<SimpleQuery$Query, JsonSerializable> {\n  SimpleQueryQuery();\n\n  @override\n  final DocumentNode document = SIMPLE_QUERY_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = 'simple_query';\n\n  @override\n  List<Object?> get props => [document, operationName];\n  @override\n  SimpleQuery$Query parse(Map<String, dynamic> json) =>\n      SimpleQuery$Query.fromJson(json);\n}\n"
  },
  {
    "path": "example/pokemon/lib/graphql/simple_query.graphql.g.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n// @dart=2.12\n\npart of 'simple_query.graphql.dart';\n\n// **************************************************************************\n// JsonSerializableGenerator\n// **************************************************************************\n\nSimpleQuery$Query$Pokemon _$SimpleQuery$Query$PokemonFromJson(\n        Map<String, dynamic> json) =>\n    SimpleQuery$Query$Pokemon()\n      ..number = json['number'] as String?\n      ..types =\n          (json['types'] as List<dynamic>?)?.map((e) => e as String?).toList();\n\nMap<String, dynamic> _$SimpleQuery$Query$PokemonToJson(\n        SimpleQuery$Query$Pokemon instance) =>\n    <String, dynamic>{\n      'number': instance.number,\n      'types': instance.types,\n    };\n\nSimpleQuery$Query _$SimpleQuery$QueryFromJson(Map<String, dynamic> json) =>\n    SimpleQuery$Query()\n      ..pokemon = json['pokemon'] == null\n          ? null\n          : SimpleQuery$Query$Pokemon.fromJson(\n              json['pokemon'] as Map<String, dynamic>);\n\nMap<String, dynamic> _$SimpleQuery$QueryToJson(SimpleQuery$Query instance) =>\n    <String, dynamic>{\n      'pokemon': instance.pokemon?.toJson(),\n    };\n"
  },
  {
    "path": "example/pokemon/lib/main.dart",
    "content": "import 'dart:async';\n\nimport 'package:artemis/artemis.dart';\n\nimport 'graphql/big_query.dart';\nimport 'graphql/simple_query.dart';\n\nFuture<void> main() async {\n  final client = ArtemisClient(\n    'https://graphql-pokemon2.vercel.app',\n  );\n\n  final simpleQuery = SimpleQueryQuery();\n  final bigQuery = BigQueryQuery(variables: BigQueryArguments(quantity: 5));\n\n  final bigQuery2 = BigQueryQuery(variables: BigQueryArguments(quantity: 5));\n\n  print('Equality works: ${bigQuery == bigQuery2}');\n\n  final simpleQueryResponse = await client.execute(simpleQuery);\n  final bigQueryResponse = await client.execute(bigQuery);\n  client.dispose();\n\n  print('Simple query response: ${simpleQueryResponse.data?.pokemon?.number}');\n\n  for (final pokemon in bigQueryResponse.data?.pokemons ?? []) {\n    print('#${pokemon.number}: ${pokemon.name}');\n  }\n}\n"
  },
  {
    "path": "example/pokemon/pokemon.schema.graphql",
    "content": "\"\"\"Represents a Pokémon's attack types\"\"\"\ntype Attack {\n  \"\"\"The name of this Pokémon attack\"\"\"\n  name: String\n\n  \"\"\"The type of this Pokémon attack\"\"\"\n  type: String\n\n  \"\"\"The damage of this Pokémon attack\"\"\"\n  damage: Int\n}\n\n\"\"\"Represents a Pokémon\"\"\"\ntype Pokemon {\n  \"\"\"The ID of an object\"\"\"\n  id: ID!\n\n  \"\"\"The identifier of this Pokémon\"\"\"\n  number: String\n\n  \"\"\"The name of this Pokémon\"\"\"\n  name: String\n\n  \"\"\"The minimum and maximum weight of this Pokémon\"\"\"\n  weight: PokemonDimension\n\n  \"\"\"The minimum and maximum weight of this Pokémon\"\"\"\n  height: PokemonDimension\n\n  \"\"\"The classification of this Pokémon\"\"\"\n  classification: String\n\n  \"\"\"The type(s) of this Pokémon\"\"\"\n  types: [String]\n\n  \"\"\"The type(s) of Pokémons that this Pokémon is resistant to\"\"\"\n  resistant: [String]\n\n  \"\"\"The attacks of this Pokémon\"\"\"\n  attacks: PokemonAttack\n\n  \"\"\"The type(s) of Pokémons that this Pokémon weak to\"\"\"\n  weaknesses: [String]\n  fleeRate: Float\n\n  \"\"\"The maximum CP of this Pokémon\"\"\"\n  maxCP: Int\n\n  \"\"\"The evolutions of this Pokémon\"\"\"\n  evolutions: [Pokemon]\n\n  \"\"\"The evolution requirements of this Pokémon\"\"\"\n  evolutionRequirements: PokemonEvolutionRequirement\n\n  \"\"\"The maximum HP of this Pokémon\"\"\"\n  maxHP: Int\n  image: String\n}\n\n\"\"\"Represents a Pokémon's attack types\"\"\"\ntype PokemonAttack {\n  \"\"\"The fast attacks of this Pokémon\"\"\"\n  fast: [Attack]\n\n  \"\"\"The special attacks of this Pokémon\"\"\"\n  special: [Attack]\n}\n\n\"\"\"Represents a Pokémon's dimensions\"\"\"\ntype PokemonDimension {\n  \"\"\"The minimum value of this dimension\"\"\"\n  minimum: String\n\n  \"\"\"The maximum value of this dimension\"\"\"\n  maximum: String\n}\n\n\"\"\"Represents a Pokémon's requirement to evolve\"\"\"\ntype PokemonEvolutionRequirement {\n  \"\"\"The amount of candy to evolve\"\"\"\n  amount: Int\n\n  \"\"\"The name of the candy to evolve\"\"\"\n  name: String\n}\n\n\"\"\"Query any Pokémon by number or name\"\"\"\ntype Query {\n  query: Query\n  pokemons(first: Int!): [Pokemon]\n  pokemon(id: String, name: String): Pokemon\n}\n"
  },
  {
    "path": "example/pokemon/pubspec.yaml",
    "content": "name: pokemon_example\nversion: 0.0.1\n\nenvironment:\n  sdk: \">=2.12.0 <3.0.0\"\n\ndependencies:\n  http:\n\ndev_dependencies:\n  test:\n  build_runner:\n  json_serializable:\n  lints: ^1.0.1\n  artemis:\n    path: ../../.\n"
  },
  {
    "path": "lib/artemis.dart",
    "content": "export 'client.dart';\nexport 'schema/graphql_query.dart';\nexport 'schema/graphql_response.dart';\n"
  },
  {
    "path": "lib/builder.dart",
    "content": "import 'dart:async';\n\nimport 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/transformer/add_typename_transformer.dart';\nimport 'package:build/build.dart';\nimport 'package:glob/glob.dart';\nimport 'package:gql/ast.dart';\nimport 'package:gql/language.dart';\n\nimport './generator.dart';\nimport './generator/print_helpers.dart';\nimport './schema/options.dart';\nimport 'generator/errors.dart';\n\n/// [GraphQLQueryBuilder] instance, to be used by `build_runner`.\nGraphQLQueryBuilder graphQLQueryBuilder(BuilderOptions options) =>\n    GraphQLQueryBuilder(options);\n\nString _addGraphQLExtensionToPathIfNeeded(String path) {\n  if (!path.endsWith('.graphql.dart')) {\n    return path.replaceAll(RegExp(r'\\.dart$'), '.graphql.dart');\n  }\n  return path;\n}\n\nList<String> _builderOptionsToExpectedOutputs(BuilderOptions builderOptions) {\n  final schemaMapping =\n      GeneratorOptions.fromJson(builderOptions.config).schemaMapping;\n\n  if (schemaMapping.isEmpty) {\n    throw MissingBuildConfigurationException('schema_mapping');\n  }\n\n  if (schemaMapping.any((s) => s.output == null)) {\n    throw MissingBuildConfigurationException('schema_mapping => output');\n  }\n\n  return schemaMapping\n      .map((s) {\n        final outputWithoutLib = s.output!.replaceAll(RegExp(r'^lib/'), '');\n\n        return {\n          outputWithoutLib,\n          _addGraphQLExtensionToPathIfNeeded(outputWithoutLib),\n        }.toList();\n      })\n      .expand((e) => e)\n      .toList();\n}\n\n/// Main Artemis builder.\nclass GraphQLQueryBuilder implements Builder {\n  /// Creates a builder from [BuilderOptions].\n  GraphQLQueryBuilder(BuilderOptions builderOptions)\n      : options = GeneratorOptions.fromJson(builderOptions.config),\n        expectedOutputs = _builderOptionsToExpectedOutputs(builderOptions);\n\n  /// This generator options, gathered from `build.yaml` file.\n  final GeneratorOptions options;\n\n  /// List FragmentDefinitionNode in fragments_glob.\n  // List<FragmentDefinitionNode> fragmentsCommon = [];\n\n  /// The generated output file.\n  final List<String> expectedOutputs;\n\n  /// Callback fired when the generator processes a [QueryDefinition].\n  OnBuildQuery? onBuild;\n\n  @override\n  Map<String, List<String>> get buildExtensions => {\n        r'$lib$': expectedOutputs,\n      };\n\n  /// read asset files\n  Future<List<DocumentNode>> readGraphQlFiles(\n    BuildStep buildStep,\n    String schema,\n  ) async {\n    final schemaAssetStream = buildStep.findAssets(Glob(schema));\n\n    return await schemaAssetStream\n        .asyncMap(\n          (asset) async => parseString(\n            await buildStep.readAsString(asset),\n            url: asset.path,\n          ),\n        )\n        .toList();\n  }\n\n  @override\n  Future<void> build(BuildStep buildStep) async {\n    List<FragmentDefinitionNode> fragmentsCommon = [];\n\n    final fragmentsGlob = options.fragmentsGlob;\n    if (fragmentsGlob != null) {\n      final commonFragments = (await readGraphQlFiles(buildStep, fragmentsGlob))\n          .map((e) => e.definitions.whereType<FragmentDefinitionNode>())\n          .expand((e) => e)\n          .toList();\n\n      if (commonFragments.isEmpty) {\n        throw MissingFilesException(fragmentsGlob);\n      }\n\n      fragmentsCommon.addAll(commonFragments);\n    }\n\n    for (final schemaMap in options.schemaMapping) {\n      List<FragmentDefinitionNode> schemaCommonFragments = [\n        ...fragmentsCommon,\n      ];\n      final schemaFragmentsGlob = schemaMap.fragmentsGlob;\n      if (schemaFragmentsGlob != null) {\n        final schemaFragments =\n            (await readGraphQlFiles(buildStep, schemaFragmentsGlob))\n                .map((e) => e.definitions.whereType<FragmentDefinitionNode>())\n                .expand((e) => e)\n                .toList();\n\n        if (schemaFragments.isEmpty) {\n          throw MissingFilesException(schemaFragmentsGlob);\n        }\n\n        schemaCommonFragments.addAll(schemaFragments);\n      }\n\n      final queriesGlob = schemaMap.queriesGlob;\n      final schema = schemaMap.schema;\n      final output = schemaMap.output;\n\n      if (schema == null) {\n        throw MissingBuildConfigurationException('schema_map => schema');\n      }\n\n      if (output == null) {\n        throw MissingBuildConfigurationException('schema_map => output');\n      }\n\n      // Loop through all files in glob\n      if (queriesGlob == null) {\n        throw MissingBuildConfigurationException('schema_map => queries_glob');\n      } else if (Glob(queriesGlob).matches(schema)) {\n        throw QueryGlobsSchemaException();\n      } else if (Glob(queriesGlob).matches(output)) {\n        throw QueryGlobsOutputException();\n      }\n\n      final gqlSchema = await readGraphQlFiles(buildStep, schema);\n\n      if (gqlSchema.isEmpty) {\n        throw MissingFilesException(schema);\n      }\n\n      var gqlDocs = await readGraphQlFiles(buildStep, queriesGlob);\n\n      if (gqlDocs.isEmpty) {\n        throw MissingFilesException(queriesGlob);\n      }\n\n      if (schemaMap.appendTypeName) {\n        gqlDocs = gqlDocs.map(\n          (doc) {\n            final transformed =\n                transform(doc, [AppendTypename(schemaMap.typeNameField)]);\n\n            // transform makes definitions growable: false so just recreate it again\n            // as far as we need to add some elements there lately\n            return DocumentNode(\n              definitions: List.from(transformed.definitions),\n              span: transformed.span,\n            );\n          },\n        ).toList();\n\n        schemaCommonFragments = schemaCommonFragments\n            .map((fragments) => transform(\n                  fragments,\n                  [AppendTypename(schemaMap.typeNameField)],\n                ))\n            .toList();\n      }\n\n      final libDefinition = generateLibrary(\n        _addGraphQLExtensionToPathIfNeeded(output),\n        gqlDocs,\n        options,\n        schemaMap,\n        schemaCommonFragments,\n        gqlSchema.first,\n      );\n\n      if (onBuild != null) {\n        onBuild!(libDefinition);\n      }\n\n      final buffer = StringBuffer();\n\n      final outputFileId = AssetId(\n        buildStep.inputId.package,\n        _addGraphQLExtensionToPathIfNeeded(output),\n      );\n\n      writeLibraryDefinitionToBuffer(\n        buffer,\n        options.ignoreForFile,\n        libDefinition,\n      );\n\n      await buildStep.writeAsString(outputFileId, buffer.toString());\n\n      if (!output.endsWith('.graphql.dart')) {\n        final forwarderOutputFileId =\n            AssetId(buildStep.inputId.package, output);\n        await buildStep.writeAsString(\n            forwarderOutputFileId, writeLibraryForwarder(libDefinition));\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "lib/client.dart",
    "content": "import 'dart:async';\n\nimport 'package:gql_dedupe_link/gql_dedupe_link.dart';\nimport 'package:gql_exec/gql_exec.dart';\nimport 'package:gql_http_link/gql_http_link.dart';\nimport 'package:gql_link/gql_link.dart';\nimport 'package:http/http.dart' as http;\nimport 'package:json_annotation/json_annotation.dart';\n\nimport './schema/graphql_query.dart';\nimport './schema/graphql_response.dart';\n\n/// Used to execute a GraphQL query or mutation and return its typed response.\n///\n/// A [Link] is used as the network interface.\nclass ArtemisClient {\n  HttpLink? _httpLink;\n  final Link _link;\n\n  /// Instantiate an [ArtemisClient].\n  ///\n  /// [DedupeLink] and [HttpLink] are included.\n  /// To use different [Link] create an [ArtemisClient] with [ArtemisClient.fromLink].\n  factory ArtemisClient(\n    String graphQLEndpoint, {\n    http.Client? httpClient,\n  }) {\n    final httpLink = HttpLink(\n      graphQLEndpoint,\n      httpClient: httpClient,\n    );\n    return ArtemisClient.fromLink(\n      Link.from([\n        DedupeLink(),\n        httpLink,\n      ]),\n    ).._httpLink = httpLink;\n  }\n\n  /// Create an [ArtemisClient] from [Link].\n  ArtemisClient.fromLink(this._link);\n\n  /// Executes a [GraphQLQuery], returning a typed response.\n  Future<GraphQLResponse<T>> execute<T, U extends JsonSerializable>(\n    GraphQLQuery<T, U> query, {\n    Context context = const Context(),\n  }) async {\n    final request = Request(\n      operation: Operation(\n        document: query.document,\n        operationName: query.operationName,\n      ),\n      variables: query.getVariablesMap(),\n      context: context,\n    );\n\n    final response = await _link.request(request).first;\n\n    return GraphQLResponse<T>(\n      data: response.data == null ? null : query.parse(response.data ?? {}),\n      errors: response.errors,\n      context: response.context,\n    );\n  }\n\n  /// Streams a [GraphQLQuery], returning a typed response stream.\n  Stream<GraphQLResponse<T>> stream<T, U extends JsonSerializable>(\n    GraphQLQuery<T, U> query, {\n    Context context = const Context(),\n  }) {\n    final request = Request(\n      operation: Operation(\n        document: query.document,\n        operationName: query.operationName,\n      ),\n      variables: query.getVariablesMap(),\n      context: context,\n    );\n\n    return _link.request(request).map((response) => GraphQLResponse<T>(\n          data: response.data == null ? null : query.parse(response.data ?? {}),\n          errors: response.errors,\n          context: response.context,\n        ));\n  }\n\n  /// Close the inline [http.Client].\n  ///\n  /// Keep in mind this will not close clients whose Artemis client\n  /// was instantiated from [ArtemisClient.fromLink]. If you're using\n  /// this constructor, you need to close your own links.\n  void dispose() {\n    _httpLink?.dispose();\n  }\n}\n"
  },
  {
    "path": "lib/generator/data/class_definition.dart",
    "content": "import 'package:artemis/generator/data/class_property.dart';\nimport 'package:artemis/generator/data/definition.dart';\nimport 'package:artemis/generator/data/fragment_class_definition.dart';\nimport 'package:artemis/generator/data_printer.dart';\nimport 'package:artemis/generator/helpers.dart';\nimport 'package:recase/recase.dart';\n\n/// Define a Dart class parsed from GraphQL type.\nclass ClassDefinition extends Definition with DataPrinter {\n  /// The properties (fields) of the class.\n  final Iterable<ClassProperty> properties;\n\n  /// The type this class extends from, or [null].\n  final Name? extension;\n\n  /// The types this class implements.\n  final Iterable<String> implementations;\n\n  /// The types this class mixins.\n  final Iterable<FragmentName> mixins;\n\n  /// The types possibilities (GraphQL type -> class name) the class\n  /// implements, if it's part of an union type or interface.\n  final Map<String, Name> factoryPossibilities;\n\n  /// The field name used to resolve this class type.\n  final ClassPropertyName typeNameField;\n\n  /// Whether this is an input object or not.\n  final bool isInput;\n\n  /// Instantiate a class definition.\n  ClassDefinition({\n    required Name name,\n    this.properties = const [],\n    this.extension,\n    this.implementations = const [],\n    this.mixins = const [],\n    this.factoryPossibilities = const {},\n    ClassPropertyName? typeNameField,\n    this.isInput = false,\n  })  : typeNameField = typeNameField ?? ClassPropertyName(name: '__typename'),\n        super(name: name);\n\n  @override\n  Map<String, Object?> get namedProps => {\n        'name': name,\n        'properties': properties,\n        'extension': extension,\n        'implementations': implementations,\n        'mixins': mixins,\n        'factoryPossibilities': factoryPossibilities,\n        'typeNameField': typeNameField,\n        'isInput': isInput,\n      };\n}\n\n/// Class name.\nclass ClassName extends Name with DataPrinter {\n  /// Instantiate a class name definition.\n  ClassName({required String name})\n      : assert(hasValue(name)),\n        super(name: name);\n\n  /// Generate class name from hierarchical path\n  factory ClassName.fromPath({required List<Name> path}) {\n    return ClassName(name: path.map((e) => e.dartTypeSafe).join(r'$_'));\n  }\n\n  @override\n  Map<String, Object?> get namedProps => {\n        'name': name,\n      };\n\n  @override\n  String normalize(String name) {\n    return ReCase(super.normalize(name)).pascalCase;\n  }\n}\n"
  },
  {
    "path": "lib/generator/data/class_property.dart",
    "content": "import 'package:artemis/generator/data/definition.dart';\nimport 'package:artemis/generator/data_printer.dart';\nimport 'package:artemis/generator/helpers.dart';\nimport 'package:recase/recase.dart';\n\n/// Define a property (field) from a class.\nclass ClassProperty extends Definition with DataPrinter {\n  @override\n  final ClassPropertyName name;\n\n  /// The property type.\n  final TypeName type;\n\n  /// Some other custom annotation.\n  final List<String> annotations;\n\n  /// Whether this parameter corresponds to the __resolveType (or equivalent)\n  final bool isResolveType;\n\n  /// Instantiate a property (field) from a class.\n  ClassProperty({\n    required this.name,\n    required this.type,\n    this.annotations = const [],\n    this.isResolveType = false,\n  })  : assert(hasValue(type) && hasValue(name)),\n        super(name: name);\n\n  /// If property is an override from super class.\n  bool get isOverride => annotations.contains('override');\n\n  /// Creates a copy of [ClassProperty] without modifying the original.\n  ClassProperty copyWith({\n    TypeName? type,\n    ClassPropertyName? name,\n    List<String>? annotations,\n    bool? isResolveType,\n  }) =>\n      ClassProperty(\n        type: type ?? this.type,\n        name: name ?? this.name,\n        annotations: annotations ?? this.annotations,\n        isResolveType: isResolveType ?? this.isResolveType,\n      );\n\n  @override\n  Map<String, Object> get namedProps => {\n        'type': type,\n        'name': name,\n        'annotations': annotations,\n        'isResolveType': isResolveType,\n      };\n}\n\n/// Class property name\nclass ClassPropertyName extends Name with DataPrinter {\n  /// Instantiate a class property name definition.\n  const ClassPropertyName({required String name}) : super(name: name);\n\n  @override\n  String normalize(String name) {\n    final normalized = super.normalize(name);\n    final suffix = RegExp(r'.*(_+)$').firstMatch(normalized)?.group(1) ?? '';\n    return ReCase(super.normalize(name)).camelCase + suffix;\n  }\n\n  @override\n  Map<String, Object?> get namedProps => {\n        'name': name,\n      };\n}\n\nconst _camelCaseTypes = {'bool', 'double', 'int'};\n\n/// Type name\nclass TypeName extends Name with DataPrinter {\n  /// Instantiate a type name definition.\n  TypeName({\n    required String name,\n    this.isNonNull = false,\n  }) : super(name: name);\n\n  /// If this type is non-null\n  final bool isNonNull;\n\n  @override\n  Map<String, Object?> get namedProps => {\n        'name': name,\n        if (isNonNull) 'isNonNull': true,\n      };\n\n  @override\n  List get props => [name, isNonNull];\n\n  @override\n  String normalize(String name) {\n    final normalized = super.normalize(name);\n    if (_camelCaseTypes.contains(normalized)) {\n      return '$normalized${isNonNull ? '' : '?'}';\n    }\n\n    return '${ReCase(normalized).pascalCase}${isNonNull ? '' : '?'}';\n  }\n}\n\n/// Type name\nclass DartTypeName extends TypeName with DataPrinter {\n  /// Instantiate a type name definition.\n  DartTypeName({\n    required String name,\n    bool isNonNull = false,\n  }) : super(name: name, isNonNull: isNonNull);\n\n  @override\n  String normalize(String name) => '$name${isNonNull ? '' : '?'}';\n}\n\n/// Type name\nclass ListOfTypeName extends TypeName with DataPrinter {\n  /// Instantiate a type name definition.\n  ListOfTypeName({\n    required this.typeName,\n    this.isNonNull = true,\n  }) : super(name: typeName.name, isNonNull: isNonNull);\n\n  /// Internal type name\n  final TypeName typeName;\n\n  /// If this list type is non-null\n  @override\n  final bool isNonNull;\n\n  @override\n  Map<String, Object> get namedProps => {\n        'typeName': typeName,\n        'isNonNull': isNonNull,\n      };\n\n  @override\n  String normalize(String? name) =>\n      'List<${typeName.namePrintable}>${isNonNull ? '' : '?'}';\n}\n"
  },
  {
    "path": "lib/generator/data/data.dart",
    "content": "export 'class_definition.dart';\nexport 'class_property.dart';\nexport 'enum_definition.dart';\nexport 'fragment_class_definition.dart';\nexport 'library_definition.dart';\nexport 'definition.dart';\nexport 'query_definition.dart';\nexport 'query_input.dart';\n"
  },
  {
    "path": "lib/generator/data/definition.dart",
    "content": "import 'package:artemis/generator/data_printer.dart';\nimport 'package:artemis/generator/helpers.dart';\nimport 'package:equatable/equatable.dart';\n\n/// Abstract definition of an entity.\nabstract class Definition extends Equatable with DataPrinter {\n  /// The definition name.\n  final Name name;\n\n  /// Instantiate a definition.\n  Definition({required this.name});\n}\n\n/// Abstract name of an entity.\nabstract class Name extends Equatable with DataPrinter {\n  /// Raw name string\n  final String name;\n\n  /// Instantiate a name.\n  const Name({required this.name});\n\n  /// Name suitable for code printing\n  String get namePrintable => normalize(name);\n\n  /// type name safe to use for dart\n  String get dartTypeSafe => namePrintable.replaceAll(RegExp(r'[<>?]'), '');\n\n  /// type name safe to use for dart\n  String get parserSafe {\n    final reGeneric = RegExp(r'<([\\S]*)>');\n    final reNull = RegExp(r'[?]');\n\n    return [\n      namePrintable.replaceAll(reGeneric, '').replaceAll(reNull, 'Nullable'),\n      reGeneric\n          .allMatches(namePrintable)\n          .map((e) => e.group(1))\n          .join('')\n          .replaceAll(reNull, 'Nullable')\n    ].join('');\n  }\n\n  /// Name normalization function\n  String normalize(String name) => normalizeName(name);\n}\n"
  },
  {
    "path": "lib/generator/data/enum_definition.dart",
    "content": "import 'package:artemis/generator/data/definition.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:artemis/generator/data_printer.dart';\nimport 'package:artemis/generator/helpers.dart';\nimport 'package:recase/recase.dart';\n\n/// Define a Dart enum parsed from GraphQL schema.\nclass EnumDefinition extends Definition with DataPrinter {\n  @override\n  final EnumName name;\n\n  /// The possible values of this enum.\n  final Iterable<EnumValueDefinition> values;\n\n  /// Instantiate an enum definition.\n  EnumDefinition({\n    required this.name,\n    required this.values,\n  })  : assert(hasValue(name) && hasValue(values)),\n        super(name: name);\n\n  @override\n  Map<String, Object?> get namedProps => {\n        'name': name,\n        'values': values,\n      };\n}\n\n/// Enum name\nclass EnumName extends Name with DataPrinter {\n  /// Instantiate a enum name definition.\n  EnumName({required String name}) : super(name: name);\n\n  @override\n  String normalize(String name) {\n    return ReCase(super.normalize(name)).pascalCase;\n  }\n\n  @override\n  Map<String, Object?> get namedProps => {\n        'name': name,\n      };\n}\n"
  },
  {
    "path": "lib/generator/data/enum_value_definition.dart",
    "content": "import 'package:artemis/generator/data/definition.dart';\nimport 'package:artemis/generator/data_printer.dart';\nimport 'package:recase/recase.dart';\n\n/// Enum value\nclass EnumValueDefinition extends Definition with DataPrinter {\n  @override\n  final EnumValueName name;\n\n  /// Some other custom annotation.\n  final List<String> annotations;\n\n  /// Instantiate an enum value\n  EnumValueDefinition({\n    required this.name,\n    this.annotations = const [],\n  }) : super(name: name);\n\n  @override\n  Map<String, Object> get namedProps => {\n        'name': name,\n        'annotations': annotations,\n      };\n}\n\n/// Enum value name\nclass EnumValueName extends Name with DataPrinter {\n  /// Instantiate a enum value name definition.\n  EnumValueName({required String name}) : super(name: name);\n\n  @override\n  Map<String, Object?> get namedProps => {\n        'name': name,\n      };\n\n  @override\n  String normalize(String name) {\n    return ReCase(super.normalize(name)).camelCase;\n  }\n}\n"
  },
  {
    "path": "lib/generator/data/fragment_class_definition.dart",
    "content": "import 'package:artemis/generator/data/class_property.dart';\nimport 'package:artemis/generator/data/definition.dart';\nimport 'package:artemis/generator/data_printer.dart';\nimport 'package:artemis/generator/helpers.dart';\nimport 'package:recase/recase.dart';\n\n/// Define a Dart class parsed from GraphQL fragment.\nclass FragmentClassDefinition extends Definition with DataPrinter {\n  @override\n  final FragmentName name;\n\n  /// The properties (fields) of the class.\n  final Iterable<ClassProperty> properties;\n\n  /// Instantiate a fragment class definition.\n  FragmentClassDefinition({\n    required this.name,\n    required this.properties,\n  })  : assert(hasValue(name) && hasValue(properties)),\n        super(name: name);\n\n  @override\n  Map<String, Object> get namedProps => {\n        'name': name,\n        'properties': properties,\n      };\n}\n\n/// Fragment name\nclass FragmentName extends Name with DataPrinter {\n  /// Instantiate a fragment name definition.\n  FragmentName({required String name}) : super(name: name);\n\n  /// Generate class name from hierarchical path\n  factory FragmentName.fromPath({required List<Name?> path}) {\n    return FragmentName(name: path.map((e) => e!.dartTypeSafe).join(r'$_'));\n  }\n\n  @override\n  Map<String, Object?> get namedProps => {\n        'name': name,\n      };\n\n  @override\n  String normalize(String name) {\n    final normalizedName = ReCase(super.normalize(name)).pascalCase;\n    if (normalizedName.endsWith('Mixin')) {\n      return name;\n    }\n    return '${normalizedName}Mixin';\n  }\n}\n"
  },
  {
    "path": "lib/generator/data/library_definition.dart",
    "content": "import 'package:artemis/generator/data/query_definition.dart';\nimport 'package:artemis/generator/data_printer.dart';\nimport 'package:artemis/generator/helpers.dart';\nimport 'package:equatable/equatable.dart';\n\n/// Callback fired when the generator processes a [LibraryDefinition].\ntypedef OnBuildQuery = void Function(LibraryDefinition definition);\n\n/// Define a whole library file, the output of a single [SchemaMap] code\n/// generation.\nclass LibraryDefinition extends Equatable with DataPrinter {\n  /// The output file basename.\n  final String basename;\n\n  /// A list of queries.\n  final Iterable<QueryDefinition> queries;\n\n  /// Any other custom package imports, defined in `build.yaml`.\n  final Iterable<String> customImports;\n\n  /// Instantiate a library definition.\n  LibraryDefinition({\n    required this.basename,\n    this.queries = const [],\n    this.customImports = const [],\n  }) : assert(hasValue(basename));\n\n  @override\n  Map<String, Object> get namedProps => {\n        'basename': basename,\n        'queries': queries,\n        'customImports': customImports,\n      };\n}\n"
  },
  {
    "path": "lib/generator/data/nullable.dart",
    "content": "/// Allows to reset values back to null in `copyWith` pattern\nclass Nullable<T> {\n  final T _value;\n\n  /// Sets desired value\n  Nullable(this._value);\n\n  /// Gets the real value\n  T get value {\n    return _value;\n  }\n}\n"
  },
  {
    "path": "lib/generator/data/query_definition.dart",
    "content": "import 'package:artemis/generator/data/class_definition.dart';\nimport 'package:artemis/generator/data/definition.dart';\nimport 'package:artemis/generator/data/query_input.dart';\nimport 'package:artemis/generator/data_printer.dart';\nimport 'package:artemis/generator/helpers.dart';\nimport 'package:gql/ast.dart';\nimport 'package:recase/recase.dart';\n\n/// Define a GraphQL query and its dependencies.\nclass QueryDefinition extends Definition with DataPrinter {\n  /// graphql operation name for helper classes\n  final String operationName;\n\n  /// The AST representation of GraphQL document.\n  final DocumentNode document;\n\n  /// A list of classes related to this query.\n  final Iterable<Definition> classes;\n\n  /// A list of inputs related to this query.\n  final Iterable<QueryInput> inputs;\n\n  /// If instances of [GraphQLQuery] should be generated.\n  final bool generateHelpers;\n\n  /// If query documents and operation names should be generated\n  final bool generateQueries;\n\n  /// The suffix of generated [GraphQLQuery] classes.\n  final String suffix;\n\n  /// Instantiate a query definition.\n  QueryDefinition({\n    required Name name,\n    required this.operationName,\n    this.document = const DocumentNode(),\n    this.classes = const [],\n    this.inputs = const [],\n    this.generateHelpers = false,\n    this.generateQueries = false,\n    this.suffix = 'Query',\n  })  : assert(hasValue(operationName)),\n        super(name: name);\n\n  /// class name for helper classes\n  String? get className => ClassName(name: operationName).namePrintable;\n\n  /// name for document constant\n  String get documentName => '$className${suffix}Document';\n\n  /// name for document operation name constant\n  String get documentOperationName =>\n      '$className${suffix}DocumentOperationName';\n\n  @override\n  Map<String, Object?> get namedProps => {\n        'name': name,\n        'operationName': operationName,\n        'classes': classes,\n        'inputs': inputs,\n        'generateHelpers': generateHelpers,\n        'suffix': suffix,\n      };\n}\n\n/// Query name\nclass QueryName extends Name with DataPrinter {\n  /// Instantiate a query name definition.\n  QueryName({required String name})\n      : assert(hasValue(name)),\n        super(name: name);\n\n  /// Generate class name from hierarchical path\n  factory QueryName.fromPath({required List<Name?> path}) {\n    return QueryName(name: path.map((e) => e!.dartTypeSafe).join(r'$_'));\n  }\n\n  @override\n  Map<String, Object?> get namedProps => {\n        'name': name,\n      };\n\n  @override\n  String normalize(String name) {\n    return ReCase(super.normalize(name)).pascalCase;\n  }\n}\n"
  },
  {
    "path": "lib/generator/data/query_input.dart",
    "content": "import 'package:artemis/generator/data/class_property.dart';\nimport 'package:artemis/generator/data/definition.dart';\nimport 'package:artemis/generator/data_printer.dart';\nimport 'package:artemis/generator/helpers.dart';\n\n/// Define a query/mutation input parameter.\nclass QueryInput extends Definition with DataPrinter {\n  @override\n  final QueryInputName name;\n\n  /// The input type.\n  final TypeName type;\n\n  /// Some other custom annotation.\n  final List<String> annotations;\n\n  /// Instantiate an input parameter.\n  QueryInput({\n    required this.type,\n    this.annotations = const [],\n    required this.name,\n  })  : assert(hasValue(type) && hasValue(name)),\n        super(name: name);\n\n  @override\n  Map<String, Object?> get namedProps => {\n        'type': type,\n        'name': name,\n        'annotations': annotations,\n      };\n}\n\n///\nclass QueryInputName extends Name {\n  ///\n  QueryInputName({required String name}) : super(name: name);\n\n  @override\n  Map<String, Object?> get namedProps => {\n        'name': name,\n      };\n}\n"
  },
  {
    "path": "lib/generator/data_printer.dart",
    "content": "import 'package:equatable/equatable.dart';\n\nimport 'helpers.dart';\n\nString? _formatPrint(Object? obj) {\n  if (obj is Map) {\n    return '{${obj.entries.map((e) => '${_formatPrint(e.key)}: ${_formatPrint(e.value)}').join(', ')}}';\n  } else if (obj is Iterable) {\n    return '[${obj.map(_formatPrint).join(', ')}]';\n  } else if (obj is String) {\n    final bt = obj.contains('\\'');\n    return 'r\\'${bt ? '\\'\\'' : ''}$obj${bt ? '\\'\\'' : ''}\\'';\n  }\n  final str = obj.toString();\n  if (str.startsWith('Instance of')) {\n    return null;\n  }\n  return str;\n}\n\n/// Data printer mixin\nmixin DataPrinter on Equatable {\n  ///\n  Map<String, Object?> get namedProps;\n\n  @override\n  List get props => namedProps.values.toList();\n\n  @override\n  String toString() {\n    final params = namedProps.entries\n        .map((e) =>\n            hasValue(e.value) ? '${e.key}:${_formatPrint(e.value)}' : null)\n        .where((o) => o != null)\n        .join(', ');\n    return '$runtimeType($params)';\n  }\n}\n"
  },
  {
    "path": "lib/generator/ephemeral_data.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/nullable.dart';\nimport 'package:artemis/visitor/type_definition_node_visitor.dart';\nimport 'package:gql/ast.dart';\n\nimport '../schema/options.dart';\n\n/// Returns the full class name with joined path.\nList<Name> createPathName(List<Name> path, NamingScheme? namingScheme,\n    [Name? currentClassName, Name? currentFieldName, Name? alias]) {\n  final fieldName = alias ?? currentFieldName;\n  final className = alias ?? currentClassName;\n\n  List<Name?> fullPath;\n\n  switch (namingScheme) {\n    case NamingScheme.simple:\n      fullPath = className == null\n          // fix for https://github.com/comigor/artemis/issues/226\n          ? (path.length == 2 ? path : [path.last])\n          : [className];\n      break;\n    case NamingScheme.pathedWithFields:\n      fullPath = [...path, fieldName];\n      break;\n    case NamingScheme.pathedWithTypes:\n    default:\n      fullPath = [...path, className];\n      break;\n  }\n\n  return fullPath.whereType<Name>().toList();\n}\n\n/// Holds context between [_GeneratorVisitor] iterations.\nclass Context {\n  /// Instantiates context for [_GeneratorVisitor] iterations.\n  Context({\n    required this.schema,\n    required this.typeDefinitionNodeVisitor,\n    required this.options,\n    required this.schemaMap,\n    required this.path,\n    required this.currentType,\n    required this.currentFieldName,\n    required this.currentClassName,\n    this.alias,\n    this.ofUnion,\n    required this.generatedClasses,\n    required this.inputsClasses,\n    required this.fragments,\n    this.usedEnums = const {},\n    this.usedInputObjects = const {},\n    this.align = 0,\n    this.log = true,\n  });\n\n  /// The [DocumentNode] parsed from `build.yaml` configuration.\n  final DocumentNode schema;\n\n  /// The [DocumentNode] parsed from `build.yaml` configuration.\n  final TypeDefinitionNodeVisitor typeDefinitionNodeVisitor;\n\n  /// Other options parsed from `build.yaml` configuration.\n  final GeneratorOptions options;\n\n  /// The [SchemaMap] being used on this iteration.\n  final SchemaMap schemaMap;\n\n  /// The path of data we're currently processing.\n  final List<Name> path;\n\n  /// The [TypeDefinitionNode] we're currently processing.\n  final TypeDefinitionNode? currentType;\n\n  /// The name of the class we're currently processing.\n  final Name? currentClassName;\n\n  /// The name of the field we're currently processing.\n  final Name? currentFieldName;\n\n  /// If part of an union type, which [TypeDefinitionNode] it represents.\n  final TypeDefinitionNode? ofUnion;\n\n  /// A string to replace the current class name.\n  final Name? alias;\n\n  /// The current generated definition classes of this visitor.\n  final List<Definition> generatedClasses;\n\n  /// The current generated input classes of this visitor.\n  final List<QueryInput> inputsClasses;\n\n  /// The current fragments considered in this visitor.\n  final List<FragmentDefinitionNode> fragments;\n\n  /// The indentation used to debugging purposes.\n  final int align;\n\n  /// If debug log should be printed.\n  final bool log;\n\n  /// A list of used enums (to filtered on generation).\n  final Set<EnumName> usedEnums;\n\n  /// A list of used input objects (to filtered on generation).\n  final Set<ClassName> usedInputObjects;\n\n  Name? _stringForNaming(Name? withFieldNames, Name? withClassNames) =>\n      schemaMap.namingScheme == NamingScheme.pathedWithFields\n          ? withFieldNames\n          : withClassNames;\n\n  /// Returns the full class name\n  List<Name> fullPathName() => createPathName(\n      path, schemaMap.namingScheme, currentClassName, currentFieldName, alias);\n\n  /// Returns a copy of this context, on the same path, but with a new type.\n  Context nextTypeWithSamePath({\n    required TypeDefinitionNode nextType,\n    required Name? nextFieldName,\n    required Name? nextClassName,\n    Nullable<TypeDefinitionNode?>? ofUnion,\n    Name? alias,\n    List<Definition>? generatedClasses,\n    List<QueryInput>? inputsClasses,\n    List<FragmentDefinitionNode>? fragments,\n  }) =>\n      Context(\n        schema: schema,\n        typeDefinitionNodeVisitor: typeDefinitionNodeVisitor,\n        options: options,\n        schemaMap: schemaMap,\n        path: path,\n        currentType: nextType,\n        currentFieldName: nextFieldName,\n        currentClassName: nextClassName,\n        ofUnion: ofUnion == null ? this.ofUnion : ofUnion.value,\n        generatedClasses: generatedClasses ?? this.generatedClasses,\n        inputsClasses: inputsClasses ?? this.inputsClasses,\n        fragments: fragments ?? this.fragments,\n        align: align,\n        usedEnums: usedEnums,\n        usedInputObjects: usedInputObjects,\n      );\n\n  /// Returns a copy of this context, with a new type on a new path.\n  Context next({\n    required TypeDefinitionNode nextType,\n    Name? nextFieldName,\n    Name? nextClassName,\n    Name? alias,\n    Nullable<TypeDefinitionNode?>? ofUnion,\n    List<Definition>? generatedClasses,\n    List<QueryInput>? inputsClasses,\n    List<FragmentDefinitionNode>? fragments,\n  }) {\n    assert(alias != null || (nextFieldName != null && nextClassName != null));\n    return Context(\n      schema: schema,\n      typeDefinitionNodeVisitor: typeDefinitionNodeVisitor,\n      options: options,\n      schemaMap: schemaMap,\n      path: path\n          .followedBy([\n            _stringForNaming(\n              alias ?? nextFieldName,\n              alias ?? nextClassName,\n            )\n          ].whereType<Name>())\n          .toList(),\n      currentType: nextType,\n      currentFieldName: nextFieldName,\n      currentClassName: nextClassName,\n      ofUnion: ofUnion == null ? this.ofUnion : ofUnion.value,\n      generatedClasses: generatedClasses ?? this.generatedClasses,\n      inputsClasses: inputsClasses ?? this.inputsClasses,\n      fragments: fragments ?? this.fragments,\n      align: align + 1,\n      usedEnums: usedEnums,\n      usedInputObjects: usedInputObjects,\n    );\n  }\n\n  /// Returns a copy of this context, with the same type and path.\n  Context withAlias({\n    Name? nextFieldName,\n    Name? nextClassName,\n    Name? alias,\n  }) =>\n      Context(\n        schema: schema,\n        typeDefinitionNodeVisitor: typeDefinitionNodeVisitor,\n        options: options,\n        schemaMap: schemaMap,\n        path: path,\n        currentType: currentType,\n        currentFieldName: nextFieldName,\n        currentClassName: nextClassName,\n        ofUnion: ofUnion,\n        alias: alias,\n        generatedClasses: generatedClasses,\n        inputsClasses: inputsClasses,\n        fragments: fragments,\n        align: align,\n        usedEnums: usedEnums,\n        usedInputObjects: usedInputObjects,\n      );\n\n  /// Returns a copy of this context, with the same type, but on a new path.\n  Context sameTypeWithNextPath({\n    Name? nextFieldName,\n    Name? nextClassName,\n    Name? alias,\n    Nullable<TypeDefinitionNode?>? ofUnion,\n    List<Definition>? generatedClasses,\n    List<QueryInput>? inputsClasses,\n    List<FragmentDefinitionNode>? fragments,\n    bool? log,\n  }) {\n    assert(alias != null || (nextFieldName != null && nextClassName != null));\n    return Context(\n      schema: schema,\n      typeDefinitionNodeVisitor: typeDefinitionNodeVisitor,\n      options: options,\n      schemaMap: schemaMap,\n      path: path\n          .followedBy([\n            _stringForNaming(\n              alias ?? nextFieldName,\n              alias ?? nextClassName,\n            ),\n          ].whereType<Name>())\n          .toList(),\n      currentType: currentType,\n      currentFieldName: nextFieldName ?? currentFieldName,\n      currentClassName: nextClassName ?? currentClassName,\n      ofUnion: ofUnion == null ? this.ofUnion : ofUnion.value,\n      alias: alias ?? this.alias,\n      generatedClasses: generatedClasses ?? this.generatedClasses,\n      inputsClasses: inputsClasses ?? this.inputsClasses,\n      fragments: fragments ?? this.fragments,\n      align: align + 1,\n      usedEnums: usedEnums,\n      usedInputObjects: usedInputObjects,\n      log: log ?? this.log,\n    );\n  }\n\n  /// Returns a copy of this context, rolling back a item on path.\n  Context rollbackPath() {\n    return Context(\n      schema: schema,\n      typeDefinitionNodeVisitor: typeDefinitionNodeVisitor,\n      options: options,\n      schemaMap: schemaMap,\n      path: [...path]..removeLast(),\n      currentType: currentType,\n      currentFieldName: currentFieldName,\n      currentClassName: currentClassName,\n      ofUnion: ofUnion,\n      alias: alias,\n      generatedClasses: generatedClasses,\n      inputsClasses: inputsClasses,\n      fragments: fragments,\n      align: align - 1,\n      usedEnums: usedEnums,\n      usedInputObjects: usedInputObjects,\n    );\n  }\n\n  /// Returns a copy of this context, with the same type, but on the first path.\n  Context sameTypeWithNoPath({\n    Name? alias,\n    Nullable<TypeDefinitionNode?>? ofUnion,\n    List<Definition>? generatedClasses,\n    List<QueryInput>? inputsClasses,\n    List<FragmentDefinitionNode>? fragments,\n  }) =>\n      Context(\n        schema: schema,\n        typeDefinitionNodeVisitor: typeDefinitionNodeVisitor,\n        options: options,\n        schemaMap: schemaMap,\n        path: [],\n        currentType: currentType,\n        currentFieldName: currentFieldName,\n        currentClassName: currentClassName,\n        ofUnion: ofUnion == null ? this.ofUnion : ofUnion.value,\n        alias: alias ?? this.alias,\n        generatedClasses: generatedClasses ?? this.generatedClasses,\n        inputsClasses: inputsClasses ?? this.inputsClasses,\n        fragments: fragments ?? this.fragments,\n        align: align,\n        usedEnums: usedEnums,\n        usedInputObjects: usedInputObjects,\n      );\n\n  /// Returns a copy of this context, with next type, but on the first path.\n  Context nextTypeWithNoPath({\n    required TypeDefinitionNode nextType,\n    required Name nextFieldName,\n    required Name nextClassName,\n    Nullable<TypeDefinitionNode?>? ofUnion,\n    Name? alias,\n    List<Definition>? generatedClasses,\n    List<QueryInput>? inputsClasses,\n    List<FragmentDefinitionNode>? fragments,\n  }) =>\n      Context(\n        schema: schema,\n        typeDefinitionNodeVisitor: typeDefinitionNodeVisitor,\n        options: options,\n        schemaMap: schemaMap,\n        path: [],\n        currentType: nextType,\n        currentFieldName: nextFieldName,\n        currentClassName: nextClassName,\n        ofUnion: ofUnion == null ? this.ofUnion : ofUnion.value,\n        alias: alias ?? this.alias,\n        generatedClasses: generatedClasses ?? this.generatedClasses,\n        inputsClasses: inputsClasses ?? this.inputsClasses,\n        fragments: fragments ?? this.fragments,\n        align: 0,\n        usedEnums: usedEnums,\n        usedInputObjects: usedInputObjects,\n      );\n}\n"
  },
  {
    "path": "lib/generator/errors.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\n\n/// Define an exception thrown when duplicated classes names were generated.\nclass DuplicatedClassesException implements Exception {\n  /// Define an exception thrown when duplicated classes names were generated.\n  const DuplicatedClassesException(this.a, this.b);\n\n  /// First duplicated class.\n  final Definition a;\n\n  /// Second duplicated class.\n  final Definition b;\n\n  @override\n  String toString() =>\n      '''Two classes were generated with the same name `${a.name}` \nbut with different selection set.\n\nClass A\n${a.toString()}\n\nClass B\n${b.toString()}\n''';\n}\n\n/// Define an exception thrown when `queries_glob` configuration contains the\n/// `schema` (Artemis would try to generate the schema as a query).\nclass QueryGlobsSchemaException implements Exception {\n  /// Define an exception thrown when `queries_glob` configuration contains the\n  /// `schema` (Artemis would try to generate the schema as a query).\n  const QueryGlobsSchemaException();\n\n  @override\n  String toString() =>\n      '''One of your `queries_glob` configuration contains the path to the `schema` file!\nChange `schema` file location and try again.\n''';\n}\n\n/// Define an exception thrown when `queries_glob` configuration contains `output`.\nclass QueryGlobsOutputException implements Exception {\n  /// Define an exception thrown when `queries_glob` configuration contains `output`.\n  const QueryGlobsOutputException();\n\n  @override\n  String toString() =>\n      '''One of your `queries_glob` configuration contains the path to the `output` file!\nChange `schema` or `output` location and try again.\n''';\n}\n\n/// Define an exception thrown when Artemis does not find asset files\nclass MissingFilesException implements Exception {\n  /// glob pattern which was used\n  final String globPattern;\n\n  /// Define an exception thrown when Artemis does not find asset files\n  MissingFilesException(this.globPattern);\n\n  @override\n  String toString() {\n    return 'Missing files for $globPattern';\n  }\n}\n\n/// Define an exception thrown when Artemis does not find required config params\nclass MissingBuildConfigurationException implements Exception {\n  /// missing config option name\n  final String name;\n\n  /// Define an exception thrown when Artemis does not find required config params\n  MissingBuildConfigurationException(this.name);\n\n  @override\n  String toString() =>\n      'Missing `$name` configuration option. Cehck `build.yaml` configuration';\n}\n\n/// Define an exception thrown when Artemis find a scalar on schema but it's\n/// not configured on `build.yaml`.\nclass MissingScalarConfigurationException implements Exception {\n  /// Define an exception thrown when Artemis find a scalar on schema but it's\n  /// not configured on `build.yaml`.\n  const MissingScalarConfigurationException(this.scalarName);\n\n  /// The misconfigured scalar name.\n  final String scalarName;\n\n  @override\n  String toString() =>\n      '''Your `schema` file contains \"$scalarName\" scalar, but this scalar is not\nconfigured on `build.yaml`!\nPlease configure it, following the README on `scalar_mapping`.\n''';\n}\n\n/// Thrown when Artemis can't find the default (or configured) root object type\n/// on schema.\nclass MissingRootTypeException implements Exception {\n  /// Thrown when Artemis can't find the default (or configured) root object\n  /// type on schema.\n  const MissingRootTypeException(this.rootTypeName);\n\n  /// The missing root type name.\n  final String rootTypeName;\n\n  @override\n  String toString() => '''Can't find the \"$rootTypeName\" root type.\nMake sure your schema file contains it.\n''';\n}\n\n/// Thrown when Artemis can't find the requested fragment on schema.\nclass MissingFragmentException implements Exception {\n  /// Thrown when Artemis can't find the requested fragment on schema.\n  const MissingFragmentException(this.fragmentName, this.className);\n\n  /// The missing fragment name.\n  final String fragmentName;\n\n  /// The class name in which the fragment is used.\n  final String className;\n\n  @override\n  String toString() => '''Can't find the \"$fragmentName\" in \"$className\".\nMake sure files inside `fragments_glob` or the query file contains it.\n''';\n}\n"
  },
  {
    "path": "lib/generator/graphql_helpers.dart",
    "content": "import 'package:artemis/generator/errors.dart';\nimport 'package:artemis/visitor/type_definition_node_visitor.dart';\nimport 'package:gql/ast.dart';\n\nimport '../generator/data/data.dart';\nimport '../schema/options.dart';\n\n/// Get a full [TypeDefinitionNode] from a type node.\nTypeDefinitionNode getTypeByName(\n  TypeDefinitionNodeVisitor typeDefinitionNodeVisitor,\n  TypeNode typeNode,\n) {\n  late NamedTypeNode namedNode;\n\n  if (typeNode is ListTypeNode) {\n    return getTypeByName(typeDefinitionNodeVisitor, typeNode.type);\n  }\n\n  if (typeNode is NamedTypeNode) {\n    namedNode = typeNode;\n  }\n\n  final type = typeDefinitionNodeVisitor.getByName(namedNode.name.value);\n\n  if (type == null) {\n    throw Exception('''Type ${namedNode.name.value} was not found in schema.\nMake sure your query is correct and your schema is updated.''');\n  }\n\n  return type;\n}\n\n/// Build a string representing a Dart type, given a GraphQL type.\nTypeName buildTypeName(\n  Node node,\n  GeneratorOptions options, {\n  bool dartType = true,\n  Name? replaceLeafWith,\n  required TypeDefinitionNodeVisitor typeDefinitionNodeVisitor,\n}) {\n  if (node is NamedTypeNode) {\n    final type = typeDefinitionNodeVisitor.getByName(node.name.value);\n\n    if (type != null) {\n      if (type is ScalarTypeDefinitionNode) {\n        final scalar = getSingleScalarMap(options, node.name.value);\n        final dartTypeValue = scalar?.dartType;\n        final graphQLTypeValue = scalar?.graphQLType;\n\n        if (dartType && dartTypeValue != null && dartTypeValue.name != null) {\n          return DartTypeName(\n            name: dartTypeValue.name!,\n            isNonNull: node.isNonNull,\n          );\n        } else if (graphQLTypeValue != null) {\n          return TypeName(\n            name: graphQLTypeValue,\n            isNonNull: node.isNonNull,\n          );\n        }\n      }\n\n      if (type is EnumTypeDefinitionNode ||\n          type is InputObjectTypeDefinitionNode) {\n        return TypeName(name: type.name.value, isNonNull: node.isNonNull);\n      }\n\n      if (replaceLeafWith != null) {\n        return TypeName(name: replaceLeafWith.name, isNonNull: node.isNonNull);\n      } else {\n        return TypeName(name: type.name.value, isNonNull: node.isNonNull);\n      }\n    }\n\n    return TypeName(name: node.name.value, isNonNull: node.isNonNull);\n  }\n\n  if (node is ListTypeNode) {\n    final typeName = buildTypeName(\n      node.type,\n      options,\n      dartType: dartType,\n      replaceLeafWith: replaceLeafWith,\n      typeDefinitionNodeVisitor: typeDefinitionNodeVisitor,\n    );\n    return ListOfTypeName(\n      typeName: typeName,\n      isNonNull: node.isNonNull,\n    );\n  }\n\n  throw Exception('Unable to build type name');\n}\n\nMap<String, ScalarMap> _defaultScalarMapping = {\n  'Boolean':\n      ScalarMap(graphQLType: 'Boolean', dartType: const DartType(name: 'bool')),\n  'Float':\n      ScalarMap(graphQLType: 'Float', dartType: const DartType(name: 'double')),\n  'ID': ScalarMap(graphQLType: 'ID', dartType: const DartType(name: 'String')),\n  'Int': ScalarMap(graphQLType: 'Int', dartType: const DartType(name: 'int')),\n  'String': ScalarMap(\n      graphQLType: 'String', dartType: const DartType(name: 'String')),\n};\n\n/// Retrieve a scalar mapping of a type.\nScalarMap? getSingleScalarMap(GeneratorOptions options, String type,\n    {bool throwOnNotFound = true}) {\n  final scalarMap =\n      options.scalarMapping.followedBy(_defaultScalarMapping.values).firstWhere(\n            (m) => m!.graphQLType == type,\n            orElse: () => null,\n          );\n\n  if (throwOnNotFound && scalarMap == null) {\n    throw MissingScalarConfigurationException(type);\n  }\n\n  return scalarMap;\n}\n\n/// Retrieve imports of a scalar map.\nIterable<String> importsOfScalar(GeneratorOptions options, String type) {\n  final scalarMapping = options.scalarMapping.firstWhere(\n    (m) => m!.graphQLType == type,\n    orElse: () => null,\n  );\n\n  final customParserImport = scalarMapping?.customParserImport;\n\n  final result = List<String>.from(scalarMapping?.dartType?.imports ?? []);\n\n  if (customParserImport != null) {\n    result.add(customParserImport);\n  }\n\n  return result;\n}\n"
  },
  {
    "path": "lib/generator/helpers.dart",
    "content": "import 'package:artemis/generator/ephemeral_data.dart';\nimport 'package:build/build.dart';\nimport 'package:collection/collection.dart' show IterableExtension;\nimport 'package:gql/ast.dart';\n\ntypedef IterableFunction<T, U> = U Function(T i);\ntypedef MergeableFunction<T> = T Function(T oldT, T newT);\n\n/// a list of dart lang keywords\nList<String> dartKeywords = const [\n  'abstract',\n  'else',\n  'import',\n  'super',\n  'as',\n  'enum',\n  'in',\n  'switch',\n  'assert',\n  'export',\n  'interface',\n  'sync',\n  'async',\n  'extends',\n  'is',\n  'this',\n  'await',\n  'extension',\n  'library',\n  'throw',\n  'break',\n  'external',\n  'mixin',\n  'true',\n  'case',\n  'factory',\n  'new',\n  'try',\n  'catch',\n  'false',\n  'null',\n  'typedef',\n  'class',\n  'final',\n  'on',\n  'var',\n  'const',\n  'finally',\n  'operator',\n  'void',\n  'continue',\n  'for',\n  'part',\n  'while',\n  'covariant',\n  'Function',\n  'rethrow',\n  'with',\n  'default',\n  'get',\n  'return',\n  'yield',\n  'deferred',\n  'hide',\n  'set',\n  'do',\n  'if',\n  'show',\n  'dynamic',\n  'implements',\n  'static',\n];\n\nIterable<T> _removeDuplicatedBy<T, U>(\n    Iterable<T> list, IterableFunction<T, U> fn) {\n  final values = <U, bool>{};\n  return list.where((i) {\n    final value = fn(i);\n    return values.update(value, (_) => false, ifAbsent: () => true);\n  }).toList();\n}\n\n/// normalizes name\n/// _variable => $variable\n/// __typename => $$typename\n/// new -> kw$new\nString normalizeName(String name) {\n  final regExp = RegExp(r'^(_+)([\\w$]*)$');\n  var matches = regExp.allMatches(name);\n\n  if (matches.isNotEmpty) {\n    var match = matches.elementAt(0);\n    var fieldName = match.group(2)!;\n\n    return fieldName.padLeft(name.length, r'$');\n  }\n\n  if (dartKeywords.contains(name.toLowerCase())) {\n    return 'kw\\$$name';\n  }\n\n  return name;\n}\n\nIterable<T> _mergeDuplicatesBy<T, U>(\n  Iterable<T> list,\n  IterableFunction<T, U> fn,\n  MergeableFunction<T> mergeFn,\n) {\n  final values = <U, T>{};\n  for (final i in list) {\n    final value = fn(i);\n    values.update(value, (oldI) => mergeFn(oldI, i), ifAbsent: () => i);\n  }\n  return values.values.toList();\n}\n\n/// Merge multiple values from an iterable given a predicate without modifying\n/// the original iterable.\nextension ExtensionsOnIterable<T, U> on Iterable<T> {\n  /// Merge multiple values from an iterable given a predicate without modifying\n  /// the original iterable.\n  Iterable<T> mergeDuplicatesBy(\n          IterableFunction<T, U> fn, MergeableFunction<T> mergeFn) =>\n      _mergeDuplicatesBy(this, fn, mergeFn);\n\n  /// Remove duplicated values from an iterable given a predicate without\n  /// modifying the original iterable.\n  Iterable<T> removeDuplicatedBy(IterableFunction<T, U> fn) =>\n      _removeDuplicatedBy(this, fn);\n}\n\n/// Check if [obj] has value (isn't null or empty).\nbool hasValue(Object? obj) {\n  if (obj is Iterable) {\n    return obj.isNotEmpty;\n  }\n  return obj != null && obj.toString().isNotEmpty;\n}\n\n/// Proceeds deprecated annotation\nList<String> proceedDeprecated(\n  List<DirectiveNode>? directives,\n) {\n  final annotations = <String>[];\n\n  final deprecatedDirective = directives?.firstWhereOrNull(\n    (directive) => directive.name.value == 'deprecated',\n  );\n\n  if (deprecatedDirective != null) {\n    final reasonValueNode = deprecatedDirective.arguments\n        .firstWhereOrNull((argument) => argument.name.value == 'reason')\n        ?.value;\n\n    final reason = reasonValueNode is StringValueNode\n        ? reasonValueNode.value.replaceAll(\"'\", \"\\\\'\").replaceAll(r'$', r'\\$')\n        : 'No longer supported';\n\n    annotations.add(\"Deprecated('$reason')\");\n  }\n\n  return annotations;\n}\n\n/// Logger function\nvoid logFn(Context context, int align, Object logObject) {\n  if (!context.log) return;\n  log.fine('${List.filled(align, '|   ').join()}${logObject.toString()}');\n}\n"
  },
  {
    "path": "lib/generator/print_helpers.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:artemis/generator/errors.dart';\nimport 'package:code_builder/code_builder.dart';\nimport 'package:collection/collection.dart' show IterableExtension;\nimport 'package:dart_style/dart_style.dart';\n// ignore: implementation_imports\nimport 'package:gql_code_builder/src/ast.dart' as dart;\nimport 'package:recase/recase.dart';\n\nimport '../generator/helpers.dart';\n\n/// Generates a [Spec] of a single enum definition.\nSpec enumDefinitionToSpec(EnumDefinition definition) =>\n    CodeExpression(Code('''enum ${definition.name.namePrintable} {\n  ${definition.values.removeDuplicatedBy((i) => i).map(_enumValueToSpec).join()}\n}'''));\n\nString _enumValueToSpec(EnumValueDefinition value) {\n  final annotations = value.annotations\n      .map((annotation) => '@$annotation')\n      .followedBy(['@JsonValue(\\'${value.name.name}\\')']).join(' ');\n\n  return '$annotations${value.name.namePrintable}, ';\n}\n\nString _fromJsonBody(ClassDefinition definition) {\n  final buffer = StringBuffer();\n  buffer.writeln(\n      '''switch (json['${definition.typeNameField.name}'].toString()) {''');\n\n  for (final p in definition.factoryPossibilities.entries) {\n    buffer.writeln('''      case r'${p.key}':\n        return ${p.value.namePrintable}.fromJson(json);''');\n  }\n\n  buffer.writeln('''      default:\n    }\n    return _\\$${definition.name.namePrintable}FromJson(json);''');\n  return buffer.toString();\n}\n\nString _toJsonBody(ClassDefinition definition) {\n  final buffer = StringBuffer();\n  final typeName = definition.typeNameField.namePrintable;\n  buffer.writeln('''switch ($typeName) {''');\n\n  for (final p in definition.factoryPossibilities.entries) {\n    buffer.writeln('''      case r'${p.key}':\n        return (this as ${p.value.namePrintable}).toJson();''');\n  }\n\n  buffer.writeln('''      default:\n    }\n    return _\\$${definition.name.namePrintable}ToJson(this);''');\n  return buffer.toString();\n}\n\nMethod _propsMethod(Iterable<String> body) {\n  return Method((m) => m\n    ..type = MethodType.getter\n    ..returns = refer('List<Object?>')\n    ..annotations.add(CodeExpression(Code('override')))\n    ..name = 'props'\n    ..lambda = true\n    ..body =\n        Code('[${body.mergeDuplicatesBy((i) => i, (a, b) => a).join(', ')}]'));\n}\n\n/// Generates a [Spec] of a single class definition.\nSpec classDefinitionToSpec(\n    ClassDefinition definition,\n    Iterable<FragmentClassDefinition> fragments,\n    Iterable<ClassDefinition> classes) {\n  final fromJson = definition.factoryPossibilities.isNotEmpty\n      ? Constructor(\n          (b) => b\n            ..factory = true\n            ..name = 'fromJson'\n            ..requiredParameters.add(Parameter(\n              (p) => p\n                ..type = refer('Map<String, dynamic>')\n                ..name = 'json',\n            ))\n            ..body = Code(_fromJsonBody(definition)),\n        )\n      : Constructor(\n          (b) => b\n            ..factory = true\n            ..name = 'fromJson'\n            ..lambda = true\n            ..requiredParameters.add(Parameter(\n              (p) => p\n                ..type = refer('Map<String, dynamic>')\n                ..name = 'json',\n            ))\n            ..body = Code('_\\$${definition.name.namePrintable}FromJson(json)'),\n        );\n\n  final toJson = definition.factoryPossibilities.isNotEmpty\n      ? Method(\n          (m) => m\n            ..name = 'toJson'\n            ..annotations.add(CodeExpression(Code('override')))\n            ..returns = refer('Map<String, dynamic>')\n            ..body = Code(_toJsonBody(definition)),\n        )\n      : Method(\n          (m) => m\n            ..name = 'toJson'\n            ..lambda = true\n            ..annotations.add(CodeExpression(Code('override')))\n            ..returns = refer('Map<String, dynamic>')\n            ..body = Code('_\\$${definition.name.namePrintable}ToJson(this)'),\n        );\n\n  final props = definition.mixins\n      .map((i) {\n        return fragments\n            .firstWhere((f) {\n              return f.name == i;\n            }, orElse: () {\n              throw MissingFragmentException(\n                  i.namePrintable, definition.name.namePrintable);\n            })\n            .properties\n            .map((p) => p.name.namePrintable);\n      })\n      .expand((i) => i)\n      .followedBy(definition.properties.map((p) => p.name.namePrintable));\n\n  final extendedClass =\n      classes.firstWhereOrNull((e) => e.name == definition.extension);\n\n  return Class(\n    (b) => b\n      ..annotations\n          .add(CodeExpression(Code('JsonSerializable(explicitToJson: true)')))\n      ..name = definition.name.namePrintable\n      ..mixins.add(refer('EquatableMixin'))\n      ..mixins.addAll(definition.mixins.map((i) => refer(i.namePrintable)))\n      ..methods.add(_propsMethod(props))\n      ..extend = definition.extension != null\n          ? refer(definition.extension!.namePrintable)\n          : refer('JsonSerializable')\n      ..implements.addAll(definition.implementations.map((i) => refer(i)))\n      ..constructors.add(Constructor((b) {\n        if (definition.isInput) {\n          b.optionalParameters.addAll(definition.properties\n              .where(\n                  (property) => !property.isOverride && !property.isResolveType)\n              .map(\n                (property) => Parameter(\n                  (p) {\n                    p\n                      ..name = property.name.namePrintable\n                      ..named = true\n                      ..toThis = true\n                      ..required = property.type.isNonNull;\n                  },\n                ),\n              ));\n        }\n      }))\n      ..constructors.add(fromJson)\n      ..methods.add(toJson)\n      ..fields.addAll(definition.properties.map((p) {\n        if (extendedClass != null &&\n            extendedClass.properties.any((e) => e == p)) {\n          // if class has the same prop as in extension\n          p.annotations.add('override');\n        }\n\n        final field = Field((f) {\n          f\n            ..name = p.name.namePrintable\n            // TODO: remove this workaround when code_builder includes late field modifier:\n            // https://github.com/dart-lang/code_builder/pull/310\n            ..type = refer(\n                '${p.type.isNonNull ? 'late ' : ''} ${p.type.namePrintable}')\n            ..annotations.addAll(\n              p.annotations.map((e) => CodeExpression(Code(e))),\n            );\n\n          if (p.type.isNonNull) {\n            // TODO: apply this fix when code_builder includes late field modifier:\n            // https://github.com/dart-lang/code_builder/pull/310\n            // f.modifier = FieldModifier.late$;\n          }\n        });\n        return field;\n      })),\n  );\n}\n\n/// Generates a [Spec] of a single fragment class definition.\nSpec fragmentClassDefinitionToSpec(FragmentClassDefinition definition) {\n  final fields = definition.properties.map((p) {\n    final lines = <String>[];\n    lines.addAll(p.annotations.map((e) => '@$e'));\n    lines.add(\n        '${p.type.isNonNull ? 'late ' : ''}${p.type.namePrintable} ${p.name.namePrintable};');\n    return lines.join('\\n');\n  });\n\n  return CodeExpression(Code('''mixin ${definition.name.namePrintable} {\n  ${fields.join('\\n')}\n}'''));\n}\n\n/// Generates a [Spec] of a mutation argument class.\nSpec generateArgumentClassSpec(QueryDefinition definition) {\n  return Class(\n    (b) => b\n      ..annotations\n          .add(CodeExpression(Code('JsonSerializable(explicitToJson: true)')))\n      ..name = '${definition.className}Arguments'\n      ..extend = refer('JsonSerializable')\n      ..mixins.add(refer('EquatableMixin'))\n      ..methods.add(_propsMethod(\n          definition.inputs.map((input) => input.name.namePrintable)))\n      ..constructors.add(Constructor(\n        (b) => b\n          ..optionalParameters.addAll(definition.inputs.map(\n            (input) => Parameter(\n              (p) {\n                p\n                  ..name = input.name.namePrintable\n                  ..named = true\n                  ..toThis = true\n                  ..required = input.type.isNonNull;\n              },\n            ),\n          )),\n      ))\n      ..constructors.add(Constructor(\n        (b) => b\n          ..factory = true\n          ..name = 'fromJson'\n          ..lambda = true\n          ..requiredParameters.add(Parameter(\n            (p) => p\n              ..type = refer('Map<String, dynamic>')\n              ..name = 'json',\n          ))\n          ..annotations.add(CodeExpression(Code('override')))\n          ..body = Code('_\\$${definition.className}ArgumentsFromJson(json)'),\n      ))\n      ..methods.add(Method(\n        (m) => m\n          ..name = 'toJson'\n          ..lambda = true\n          ..returns = refer('Map<String, dynamic>')\n          ..annotations.add(CodeExpression(Code('override')))\n          ..body = Code('_\\$${definition.className}ArgumentsToJson(this)'),\n      ))\n      ..fields.addAll(definition.inputs.map(\n        (p) => Field(\n          (f) {\n            f\n              ..name = p.name.namePrintable\n              // TODO: remove this workaround when code_builder includes late field modifier:\n              // https://github.com/dart-lang/code_builder/pull/310\n              ..type = refer(\n                  '${p.type.isNonNull ? 'late ' : ''} ${p.type.namePrintable}')\n              ..annotations\n                  .addAll(p.annotations.map((e) => CodeExpression(Code(e))));\n\n            if (!p.type.isNonNull) {\n              f.modifier = FieldModifier.final$;\n            }\n          },\n        ),\n      )),\n  );\n}\n\nSpec generateQuerySpec(QueryDefinition definition) {\n  return Block((b) => b\n    ..statements.addAll([\n      Code(\n          \"final ${definition.documentOperationName.constantCase} = '${definition.operationName}';\"),\n      Code('final ${definition.documentName.constantCase} = '),\n      dart.fromNode(definition.document).code,\n      Code(';'),\n    ]));\n}\n\n/// Generates a [Spec] of a query/mutation class.\nSpec generateQueryClassSpec(QueryDefinition definition) {\n  final typeDeclaration = definition.inputs.isEmpty\n      ? '${definition.name.namePrintable}, JsonSerializable'\n      : '${definition.name.namePrintable}, ${definition.className}Arguments';\n\n  final name = '${definition.className}${definition.suffix}';\n\n  final constructor = definition.inputs.isEmpty\n      ? Constructor()\n      : Constructor((b) => b\n        ..optionalParameters.add(Parameter(\n          (p) => p\n            ..name = 'variables'\n            ..toThis = true\n            ..named = true\n            ..required = true,\n        )));\n\n  final fields = [\n    Field(\n      (f) => f\n        ..annotations.add(CodeExpression(Code('override')))\n        ..modifier = FieldModifier.final$\n        ..type = refer('DocumentNode', 'package:gql/ast.dart')\n        ..name = 'document'\n        ..assignment = Code(definition.documentName.constantCase),\n    ),\n    Field(\n      (f) => f\n        ..annotations.add(CodeExpression(Code('override')))\n        ..modifier = FieldModifier.final$\n        ..type = refer('String')\n        ..name = 'operationName'\n        ..assignment = Code(definition.documentOperationName.constantCase),\n    ),\n  ];\n\n  if (definition.inputs.isNotEmpty) {\n    fields.add(Field(\n      (f) => f\n        ..annotations.add(CodeExpression(Code('override')))\n        ..modifier = FieldModifier.final$\n        ..type = refer('${definition.className}Arguments')\n        ..name = 'variables',\n    ));\n  }\n\n  return Class(\n    (b) => b\n      ..name = name\n      ..extend = refer('GraphQLQuery<$typeDeclaration>')\n      ..constructors.add(constructor)\n      ..fields.addAll(fields)\n      ..methods.add(_propsMethod([\n        'document',\n        'operationName${definition.inputs.isNotEmpty ? ', variables' : ''}'\n      ]))\n      ..methods.add(Method(\n        (m) => m\n          ..annotations.add(CodeExpression(Code('override')))\n          ..returns = refer(definition.name.namePrintable)\n          ..name = 'parse'\n          ..requiredParameters.add(Parameter(\n            (p) => p\n              ..type = refer('Map<String, dynamic>')\n              ..name = 'json',\n          ))\n          ..lambda = true\n          ..body = Code('${definition.name.namePrintable}.fromJson(json)'),\n      )),\n  );\n}\n\n/// Gathers and generates a [Spec] of a whole query/mutation and its\n/// dependencies into a single library file.\nSpec generateLibrarySpec(LibraryDefinition definition) {\n  final importDirectives = [\n    Directive.import('package:json_annotation/json_annotation.dart'),\n    Directive.import('package:equatable/equatable.dart'),\n    Directive.import('package:gql/ast.dart'),\n  ];\n\n  if (definition.queries.any((q) => q.generateHelpers)) {\n    importDirectives.insertAll(\n      0,\n      [\n        Directive.import('package:artemis/artemis.dart'),\n      ],\n    );\n  }\n\n  importDirectives.addAll(definition.customImports\n      .map((customImport) => Directive.import(customImport)));\n\n  final bodyDirectives = <Spec>[\n    CodeExpression(Code('part \\'${definition.basename}.g.dart\\';')),\n  ];\n\n  final uniqueDefinitions = definition.queries\n      .map((e) => e.classes.map((e) => e))\n      .expand((e) => e)\n      .fold<Map<String?, Definition>>(<String?, Definition>{}, (acc, element) {\n    acc[element.name.name] = element;\n\n    return acc;\n  }).values;\n\n  final fragments = uniqueDefinitions.whereType<FragmentClassDefinition>();\n  final classes = uniqueDefinitions.whereType<ClassDefinition>();\n  final enums = uniqueDefinitions.whereType<EnumDefinition>();\n\n  bodyDirectives.addAll(fragments.map(fragmentClassDefinitionToSpec));\n  bodyDirectives.addAll(\n      classes.map((cDef) => classDefinitionToSpec(cDef, fragments, classes)));\n  bodyDirectives.addAll(enums.map(enumDefinitionToSpec));\n\n  for (final queryDef in definition.queries) {\n    if (queryDef.inputs.isNotEmpty &&\n        (queryDef.generateHelpers || queryDef.generateQueries)) {\n      bodyDirectives.add(generateArgumentClassSpec(queryDef));\n    }\n\n    if (queryDef.generateHelpers || queryDef.generateQueries) {\n      bodyDirectives.add(generateQuerySpec(queryDef));\n    }\n\n    if (queryDef.generateHelpers) {\n      bodyDirectives.add(generateQueryClassSpec(queryDef));\n    }\n  }\n\n  return Library(\n    (b) => b\n      ..directives.addAll(importDirectives)\n      ..body.addAll(bodyDirectives),\n  );\n}\n\n/// Emit a [Spec] into a String, considering Dart formatting.\nString specToString(Spec spec) {\n  final emitter = DartEmitter();\n  return DartFormatter().format(spec.accept(emitter).toString());\n}\n\n/// Generate Dart code typings from a query or mutation and its response from\n/// a [QueryDefinition] into a buffer.\nvoid writeLibraryDefinitionToBuffer(\n  StringBuffer buffer,\n  List<String> ignoreForFile,\n  LibraryDefinition definition,\n) {\n  buffer.writeln('// GENERATED CODE - DO NOT MODIFY BY HAND');\n  if (ignoreForFile.isNotEmpty) {\n    buffer.writeln(\n      '// ignore_for_file: ${Set<String>.from(ignoreForFile).join(', ')}',\n    );\n  }\n  buffer.write('\\n');\n  buffer.write(specToString(generateLibrarySpec(definition)));\n}\n\n/// Generate an empty file just exporting the library. This is used to avoid\n/// a breaking change on file generation.\nString writeLibraryForwarder(LibraryDefinition definition) =>\n    '''// GENERATED CODE - DO NOT MODIFY BY HAND\nexport '${definition.basename}.dart';\n''';\n"
  },
  {
    "path": "lib/generator.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:artemis/generator/data/nullable.dart';\nimport 'package:artemis/visitor/canonical_visitor.dart';\nimport 'package:artemis/visitor/generator_visitor.dart';\nimport 'package:artemis/visitor/object_type_definition_visitor.dart';\nimport 'package:artemis/visitor/schema_definition_visitor.dart';\nimport 'package:artemis/visitor/type_definition_node_visitor.dart';\nimport 'package:collection/collection.dart' show IterableExtension;\nimport 'package:gql/ast.dart';\nimport 'package:path/path.dart' as p;\n\nimport './generator/ephemeral_data.dart';\nimport './generator/errors.dart';\nimport './generator/graphql_helpers.dart' as gql;\nimport './generator/helpers.dart';\nimport './schema/options.dart';\n\ntypedef OnNewClassFoundCallback = void Function(Context context);\n\n/// Enum value for values not mapped in the GraphQL enum\nfinal EnumValueDefinition artemisUnknown = EnumValueDefinition(\n  name: EnumValueName(name: 'ARTEMIS_UNKNOWN'),\n);\n\n/// Generate queries definitions from a GraphQL schema and a list of queries,\n/// given Artemis options and schema mappings.\nLibraryDefinition generateLibrary(\n  String path,\n  List<DocumentNode> gqlDocs,\n  GeneratorOptions options,\n  SchemaMap schemaMap,\n  List<FragmentDefinitionNode> fragmentsCommon,\n  DocumentNode schema,\n) {\n  final typeDefinitionNodeVisitor = TypeDefinitionNodeVisitor();\n  schema.accept(typeDefinitionNodeVisitor);\n\n  final canonicalVisitor = CanonicalVisitor(\n    context: Context(\n      schema: schema,\n      typeDefinitionNodeVisitor: typeDefinitionNodeVisitor,\n      options: options,\n      schemaMap: schemaMap,\n      path: [],\n      currentType: null,\n      currentFieldName: null,\n      currentClassName: null,\n      generatedClasses: [],\n      inputsClasses: [],\n      fragments: [],\n      usedEnums: {},\n      usedInputObjects: {},\n    ),\n  );\n\n  schema.accept(canonicalVisitor);\n\n  final documentFragments = gqlDocs\n      .map((doc) => doc.definitions.whereType<FragmentDefinitionNode>())\n      .expand((e) => e)\n      .toList();\n\n  final documentsWithoutFragments = gqlDocs.map((doc) {\n    return DocumentNode(\n      definitions:\n          doc.definitions.where((e) => e is! FragmentDefinitionNode).toList(),\n      span: doc.span,\n    );\n  }).toList();\n\n  final queryDefinitions = documentsWithoutFragments\n      .map((doc) => generateDefinitions(\n            schema: schema,\n            typeDefinitionNodeVisitor: typeDefinitionNodeVisitor,\n            path: path,\n            document: doc,\n            options: options,\n            schemaMap: schemaMap,\n            fragmentsCommon: [\n              ...documentFragments,\n              ...fragmentsCommon,\n            ],\n            canonicalVisitor: canonicalVisitor,\n          ))\n      .expand((e) => e)\n      .toList();\n\n  final allClassesNames = queryDefinitions\n      .map((def) => def.classes.map((c) => c))\n      .expand((e) => e)\n      .toList();\n\n  allClassesNames.mergeDuplicatesBy((a) => a.name, (a, b) {\n    if (a.name == b.name && a != b) {\n      throw DuplicatedClassesException(a, b);\n    }\n\n    return a;\n  });\n\n  final basename = p.basenameWithoutExtension(path);\n\n  final customImports = _extractCustomImports(schema, options);\n  return LibraryDefinition(\n    basename: basename,\n    queries: queryDefinitions,\n    customImports: customImports,\n  );\n}\n\nSet<FragmentDefinitionNode> _extractFragments(SelectionSetNode? selectionSet,\n    List<FragmentDefinitionNode> fragmentsCommon) {\n  final result = <FragmentDefinitionNode>{};\n  if (selectionSet != null) {\n    selectionSet.selections.whereType<FieldNode>().forEach((selection) {\n      result.addAll(_extractFragments(selection.selectionSet, fragmentsCommon));\n    });\n\n    selectionSet.selections\n        .whereType<InlineFragmentNode>()\n        .forEach((selection) {\n      result.addAll(_extractFragments(selection.selectionSet, fragmentsCommon));\n    });\n\n    selectionSet.selections\n        .whereType<FragmentSpreadNode>()\n        .forEach((selection) {\n      final fragmentDefinitions = fragmentsCommon.where((fragmentDefinition) =>\n          fragmentDefinition.name.value == selection.name.value);\n      result.addAll(fragmentDefinitions);\n      for (var fragmentDefinition in fragmentDefinitions) {\n        result.addAll(_extractFragments(\n            fragmentDefinition.selectionSet, fragmentsCommon));\n      }\n    });\n  }\n  return result;\n}\n\n/// Generate a query definition from a GraphQL schema and a query, given\n/// Artemis options and schema mappings.\nIterable<QueryDefinition> generateDefinitions({\n  required DocumentNode schema,\n  required TypeDefinitionNodeVisitor typeDefinitionNodeVisitor,\n  required String path,\n  required DocumentNode document,\n  required GeneratorOptions options,\n  required SchemaMap schemaMap,\n  required List<FragmentDefinitionNode> fragmentsCommon,\n  required CanonicalVisitor canonicalVisitor,\n}) {\n  // final documentFragments =\n  //     document.definitions.whereType<FragmentDefinitionNode>();\n\n  // if (documentFragments.isNotEmpty && fragmentsCommon.isNotEmpty) {\n  //   throw FragmentIgnoreException();\n  // }\n\n  final operations =\n      document.definitions.whereType<OperationDefinitionNode>().toList();\n\n  return operations.map((operation) {\n    // final fragments = <FragmentDefinitionNode>[\n    //   ...documentFragments,\n    // ];\n    final definitions = document.definitions\n        // filtering unused operations\n        .where((e) {\n      return e is! OperationDefinitionNode || e == operation;\n    }).toList();\n\n    if (fragmentsCommon.isNotEmpty) {\n      final fragmentsOperation =\n          _extractFragments(operation.selectionSet, fragmentsCommon);\n      definitions.addAll(fragmentsOperation);\n      // fragments.addAll(fragmentsOperation);\n    }\n\n    final basename = p.basenameWithoutExtension(path).split('.').first;\n    final operationName = operation.name?.value ?? basename;\n\n    final schemaVisitor = SchemaDefinitionVisitor();\n    final objectVisitor = ObjectTypeDefinitionVisitor();\n\n    schema.accept(schemaVisitor);\n    schema.accept(objectVisitor);\n\n    String suffix;\n    switch (operation.type) {\n      case OperationType.subscription:\n        suffix = 'Subscription';\n        break;\n      case OperationType.mutation:\n        suffix = 'Mutation';\n        break;\n      case OperationType.query:\n      default:\n        suffix = 'Query';\n        break;\n    }\n\n    final rootTypeName =\n        (schemaVisitor.schemaDefinitionNode?.operationTypes ?? [])\n                .firstWhereOrNull((e) => e.operation == operation.type)\n                ?.type\n                .name\n                .value ??\n            suffix;\n\n    final parentType = objectVisitor.getByName(rootTypeName);\n\n    if (parentType == null) {\n      throw MissingRootTypeException(rootTypeName);\n    }\n\n    final name = QueryName.fromPath(\n      path: createPathName([\n        ClassName(name: operationName),\n        ClassName(name: parentType.name.value)\n      ], schemaMap.namingScheme),\n    );\n\n    final context = Context(\n      schema: schema,\n      typeDefinitionNodeVisitor: typeDefinitionNodeVisitor,\n      options: options,\n      schemaMap: schemaMap,\n      path: [\n        TypeName(name: operationName),\n        TypeName(name: parentType.name.value)\n      ],\n      currentType: parentType,\n      currentFieldName: null,\n      currentClassName: null,\n      generatedClasses: [],\n      inputsClasses: [],\n      fragments: fragmentsCommon,\n      usedEnums: {},\n      usedInputObjects: {},\n    );\n\n    final visitor = GeneratorVisitor(context: context);\n    final documentDefinitions = DocumentNode(definitions: definitions);\n    documentDefinitions.accept(visitor);\n\n    return QueryDefinition(\n      name: name,\n      operationName: operationName,\n      document: documentDefinitions,\n      classes: [\n        ...context.usedEnums\n            .map((e) => canonicalVisitor.enums[e.name]?.call())\n            .whereType<Definition>(),\n        ...visitor.context.generatedClasses,\n        ...context.usedInputObjects\n            .map((e) => canonicalVisitor.inputObjects[e.name]?.call())\n            .whereType<Definition>(),\n      ],\n      inputs: visitor.context.inputsClasses,\n      generateHelpers: options.generateHelpers,\n      generateQueries: options.generateQueries,\n      suffix: suffix,\n    );\n  });\n}\n\nList<String> _extractCustomImports(\n  DocumentNode schema,\n  GeneratorOptions options,\n) {\n  final typeVisitor = TypeDefinitionNodeVisitor();\n\n  schema.accept(typeVisitor);\n\n  return typeVisitor.types.values\n      .whereType<ScalarTypeDefinitionNode>()\n      .map((type) => gql.importsOfScalar(options, type.name.value))\n      .expand((i) => i)\n      .toSet()\n      .toList();\n}\n\n/// Creates class property object\nClassProperty createClassProperty({\n  required ClassPropertyName fieldName,\n  ClassPropertyName? fieldAlias,\n  required Context context,\n  OnNewClassFoundCallback? onNewClassFound,\n  bool markAsUsed = true,\n}) {\n  if (fieldName.name == context.schemaMap.typeNameField) {\n    return ClassProperty(\n      type: TypeName(name: 'String'),\n      name: fieldName,\n      annotations: ['JsonKey(name: \\'${context.schemaMap.typeNameField}\\')'],\n      isResolveType: true,\n    );\n  }\n\n  var finalFields = <Node>[];\n\n  if (context.currentType is ObjectTypeDefinitionNode) {\n    finalFields = (context.currentType as ObjectTypeDefinitionNode).fields;\n  } else if (context.currentType is InterfaceTypeDefinitionNode) {\n    finalFields = (context.currentType as InterfaceTypeDefinitionNode).fields;\n  } else if (context.currentType is InputObjectTypeDefinitionNode) {\n    finalFields = (context.currentType as InputObjectTypeDefinitionNode).fields;\n  }\n\n  final regularField = finalFields\n      .whereType<FieldDefinitionNode>()\n      .firstWhereOrNull((f) => f.name.value == fieldName.name);\n  final regularInputField = finalFields\n      .whereType<InputValueDefinitionNode>()\n      .firstWhereOrNull((f) => f.name.value == fieldName.name);\n\n  final fieldType = regularField?.type ?? regularInputField?.type;\n\n  if (fieldType == null) {\n    throw Exception(\n        '''Field $fieldName was not found in GraphQL type ${context.currentType?.name.value}.\nMake sure your query is correct and your schema is updated.''');\n  }\n\n  final nextType =\n      gql.getTypeByName(context.typeDefinitionNodeVisitor, fieldType);\n\n  final aliasedContext = context.withAlias(\n    nextFieldName: fieldName,\n    nextClassName: ClassName(name: nextType.name.value),\n    alias: fieldAlias,\n  );\n\n  final nextClassName = aliasedContext.fullPathName();\n\n  final dartTypeName = gql.buildTypeName(\n    fieldType,\n    context.options,\n    dartType: true,\n    replaceLeafWith: ClassName.fromPath(path: nextClassName),\n    typeDefinitionNodeVisitor: context.typeDefinitionNodeVisitor,\n  );\n\n  logFn(context, aliasedContext.align + 1,\n      '${aliasedContext.path}[${aliasedContext.currentType!.name.value}][${aliasedContext.currentClassName} ${aliasedContext.currentFieldName}] ${fieldAlias == null ? '' : '($fieldAlias) '}-> ${dartTypeName.namePrintable}');\n\n  if ((nextType is ObjectTypeDefinitionNode ||\n          nextType is UnionTypeDefinitionNode ||\n          nextType is InterfaceTypeDefinitionNode) &&\n      onNewClassFound != null) {\n    ClassPropertyName? nextFieldName;\n\n    if (regularField != null) {\n      nextFieldName = ClassPropertyName(name: regularField.name.value);\n    } else if (regularInputField != null) {\n      nextFieldName = ClassPropertyName(name: regularInputField.name.value);\n    }\n\n    onNewClassFound(\n      aliasedContext.next(\n        nextType: nextType,\n        nextFieldName: nextFieldName,\n        nextClassName: ClassName(name: nextType.name.value),\n        alias: fieldAlias,\n        ofUnion: Nullable<TypeDefinitionNode?>(null),\n      ),\n    );\n  }\n\n  final name = fieldAlias ?? fieldName;\n\n  // On custom scalars\n  final jsonKeyAnnotation = <String, String>{};\n  if (name.namePrintable != name.name) {\n    jsonKeyAnnotation['name'] = '\\'${name.name}\\'';\n  }\n\n  if (nextType is ScalarTypeDefinitionNode) {\n    final scalar = gql.getSingleScalarMap(context.options, nextType.name.value);\n\n    if (scalar?.customParserImport != null &&\n        nextType.name.value == scalar?.graphQLType) {\n      final graphqlTypeName = gql.buildTypeName(\n        fieldType,\n        context.options,\n        dartType: false,\n        typeDefinitionNodeVisitor: context.typeDefinitionNodeVisitor,\n      );\n\n      jsonKeyAnnotation['fromJson'] =\n          'fromGraphQL${graphqlTypeName.parserSafe}ToDart${dartTypeName.parserSafe}';\n      jsonKeyAnnotation['toJson'] =\n          'fromDart${dartTypeName.parserSafe}ToGraphQL${graphqlTypeName.parserSafe}';\n    }\n  } // On enums\n  else if (nextType is EnumTypeDefinitionNode) {\n    if (markAsUsed) {\n      context.usedEnums.add(EnumName(name: nextType.name.value));\n    }\n\n    if (fieldType is ListTypeNode) {\n      final innerDartTypeName = gql.buildTypeName(\n        fieldType.type,\n        context.options,\n        dartType: true,\n        replaceLeafWith: ClassName.fromPath(path: nextClassName),\n        typeDefinitionNodeVisitor: context.typeDefinitionNodeVisitor,\n      );\n      jsonKeyAnnotation['unknownEnumValue'] =\n          '${innerDartTypeName.dartTypeSafe}.${artemisUnknown.name.namePrintable}';\n    } else {\n      jsonKeyAnnotation['unknownEnumValue'] =\n          '${dartTypeName.dartTypeSafe}.${artemisUnknown.name.namePrintable}';\n    }\n  }\n\n  final fieldDirectives =\n      regularField?.directives ?? regularInputField?.directives;\n\n  var annotations = <String>[];\n\n  if (jsonKeyAnnotation.isNotEmpty) {\n    final jsonKey = jsonKeyAnnotation.entries\n        .map<String>((e) => '${e.key}: ${e.value}')\n        .join(', ');\n    annotations.add('JsonKey($jsonKey)');\n  }\n  annotations.addAll(proceedDeprecated(fieldDirectives));\n\n  return ClassProperty(\n    type: dartTypeName,\n    name: name,\n    annotations: annotations,\n  );\n}\n"
  },
  {
    "path": "lib/schema/graphql_query.dart",
    "content": "import 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\nimport 'package:json_annotation/json_annotation.dart';\n\n/// A GraphQL query abstraction. This class should be extended automatically\n/// by Artemis and used with [ArtemisClient].\nabstract class GraphQLQuery<T, U extends JsonSerializable> extends Equatable {\n  /// Instantiates a query or mutation.\n  GraphQLQuery({this.variables});\n\n  /// Typed query/mutation variables.\n  final U? variables;\n\n  /// AST representation of the document to be executed.\n  late final DocumentNode document;\n\n  /// Operation name used for this query/mutation.\n  final String? operationName = null;\n\n  /// Parses a JSON map into the response type.\n  T parse(Map<String, dynamic> json);\n\n  /// Get variables as a JSON map.\n  Map<String, dynamic> getVariablesMap() => variables?.toJson() ?? {};\n}\n"
  },
  {
    "path": "lib/schema/graphql_response.dart",
    "content": "import 'package:gql_exec/gql_exec.dart';\n\n/// Encapsulates a GraphQL query/mutation response from server, with typed\n/// input and responses, and errors.\nclass GraphQLResponse<T> {\n  /// The typed data of this response.\n  final T? data;\n\n  /// The list of errors in this response.\n  final List<GraphQLError>? errors;\n\n  /// If this response has any error.\n  bool get hasErrors => errors != null && errors!.isNotEmpty;\n\n  /// The [Context] of the [Response]\n  final Context? context;\n\n  /// Instantiates a GraphQL response.\n  const GraphQLResponse({\n    this.data,\n    this.errors,\n    this.context,\n  });\n}\n"
  },
  {
    "path": "lib/schema/options.dart",
    "content": "import 'package:json_annotation/json_annotation.dart';\nimport 'package:yaml/yaml.dart';\n\n// I can't use the default json_serializable flow because the artemis generator\n// would crash when importing options.dart file.\npart 'options.g2.dart';\n\n/// This generator options, gathered from `build.yaml` file.\n@JsonSerializable(fieldRename: FieldRename.snake, anyMap: true)\nclass GeneratorOptions {\n  /// If instances of [GraphQLQuery] should be generated.\n  @JsonKey(defaultValue: true)\n  final bool generateHelpers;\n\n  /// If query documents and operation names should be generated\n  @JsonKey(defaultValue: true)\n  final bool generateQueries;\n\n  /// A list of scalar mappings.\n  @JsonKey(defaultValue: [])\n  final List<ScalarMap?> scalarMapping;\n\n  /// A list of fragments apply for all query files without declare them.\n  final String? fragmentsGlob;\n\n  /// A list of schema mappings.\n  @JsonKey(defaultValue: [])\n  final List<SchemaMap> schemaMapping;\n\n  /// A list of linter rules to ignore\n  /// in generated files.\n  @JsonKey(defaultValue: [])\n  final List<String> ignoreForFile;\n\n  /// Instantiate generator options.\n  GeneratorOptions({\n    this.generateHelpers = true,\n    this.generateQueries = true,\n    this.scalarMapping = const [],\n    this.fragmentsGlob,\n    this.schemaMapping = const [],\n    this.ignoreForFile = const [],\n  });\n\n  /// Build options from a JSON map.\n  factory GeneratorOptions.fromJson(Map<String, dynamic> json) =>\n      _$GeneratorOptionsFromJson(json);\n\n  /// Convert this options instance to JSON.\n  Map<String, dynamic> toJson() => _$GeneratorOptionsToJson(this);\n}\n\n/// Define a Dart type.\n@JsonSerializable()\nclass DartType {\n  /// Dart type name.\n  final String? name;\n\n  /// Package imports related to this type.\n  @JsonKey(defaultValue: <String>[])\n  final List<String> imports;\n\n  /// Instantiate a Dart type.\n  const DartType({\n    this.name,\n    this.imports = const [],\n  });\n\n  /// Build a Dart type from a JSON string or map.\n  factory DartType.fromJson(dynamic json) {\n    if (json is String) {\n      return DartType(name: json);\n    } else if (json is Map<String, dynamic>) {\n      return _$DartTypeFromJson(json);\n    } else if (json is YamlMap) {\n      return _$DartTypeFromJson({\n        'name': json['name'],\n        'imports': (json['imports'] as YamlList).map((s) => s).toList(),\n      });\n    } else {\n      throw 'Invalid YAML: $json';\n    }\n  }\n\n  /// Convert this Dart type instance to JSON.\n  Map<String, dynamic> toJson() => _$DartTypeToJson(this);\n}\n\n/// Maps a GraphQL scalar to a Dart type.\n@JsonSerializable(fieldRename: FieldRename.snake)\nclass ScalarMap {\n  /// The GraphQL type name.\n  @JsonKey(name: 'graphql_type')\n  final String? graphQLType;\n\n  /// The Dart type linked to this GraphQL type.\n  final DartType? dartType;\n\n  /// If custom parser would be used.\n  final String? customParserImport;\n\n  /// Instatiates a scalar mapping.\n  ScalarMap({\n    this.graphQLType,\n    this.dartType,\n    this.customParserImport,\n  });\n\n  /// Build a scalar mapping from a JSON map.\n  factory ScalarMap.fromJson(Map<String, dynamic> json) =>\n      _$ScalarMapFromJson(json);\n\n  /// Convert this scalar mapping instance to JSON.\n  Map<String, dynamic> toJson() => _$ScalarMapToJson(this);\n}\n\n/// The naming scheme to be used on generated classes names.\nenum NamingScheme {\n  /// Default, where the names of previous types are used as prefix of the\n  /// next class. This can generate duplication on certain schemas.\n  pathedWithTypes,\n\n  /// The names of previous fields are used as prefix of the next class.\n  pathedWithFields,\n\n  /// Considers only the actual GraphQL class name. This will probably lead to\n  /// duplication and an Artemis error unless user uses aliases.\n  simple,\n}\n\n/// Maps a GraphQL schema to queries files.\n@JsonSerializable(fieldRename: FieldRename.snake)\nclass SchemaMap {\n  /// The output file of this queries glob.\n  final String? output;\n\n  /// The GraphQL schema string.\n  final String? schema;\n\n  /// A [Glob] to find queries files.\n  final String? queriesGlob;\n\n  /// A [Glob] to find your fragments files.\n  final String? fragmentsGlob;\n\n  /// The resolve type field used on this schema.\n  @JsonKey(defaultValue: '__typename')\n  final String typeNameField;\n\n  /// The resolve type field used on this schema.\n  @JsonKey(defaultValue: false)\n  final bool appendTypeName;\n\n  /// The naming scheme to be used.\n  ///\n  /// - [NamingScheme.pathedWithTypes]: default, where the names of\n  /// previous classes are used to generate the prefix.\n  /// - [NamingScheme.pathedWithFields]: the field names are joined\n  /// together to generate the path.\n  /// - [NamingScheme.simple]: considers only the actual GraphQL class name.\n  /// This will probably lead to duplication and an Artemis error unless you\n  /// use aliases.\n  @JsonKey(unknownEnumValue: NamingScheme.pathedWithTypes)\n  final NamingScheme? namingScheme;\n\n  /// Instantiates a schema mapping.\n  SchemaMap({\n    this.output,\n    this.schema,\n    this.queriesGlob,\n    this.fragmentsGlob,\n    this.typeNameField = '__typename',\n    this.appendTypeName = false,\n    this.namingScheme = NamingScheme.pathedWithTypes,\n  });\n\n  /// Build a schema mapping from a JSON map.\n  factory SchemaMap.fromJson(Map<String, dynamic> json) =>\n      _$SchemaMapFromJson(json);\n\n  /// Convert this schema mapping instance to JSON.\n  Map<String, dynamic> toJson() => _$SchemaMapToJson(this);\n}\n"
  },
  {
    "path": "lib/schema/options.g2.dart",
    "content": "// GENERATED CODE - DO NOT MODIFY BY HAND\n\npart of 'options.dart';\n\n// **************************************************************************\n// JsonSerializableGenerator\n// **************************************************************************\n\nGeneratorOptions _$GeneratorOptionsFromJson(Map json) {\n  return GeneratorOptions(\n    generateHelpers: json['generate_helpers'] as bool? ?? true,\n    generateQueries: json['generate_queries'] as bool? ?? true,\n    scalarMapping: (json['scalar_mapping'] as List<dynamic>?)\n            ?.map((e) => e == null\n                ? null\n                : ScalarMap.fromJson(Map<String, dynamic>.from(e as Map)))\n            .toList() ??\n        [],\n    fragmentsGlob: json['fragments_glob'] as String?,\n    schemaMapping: (json['schema_mapping'] as List<dynamic>?)\n            ?.map(\n                (e) => SchemaMap.fromJson(Map<String, dynamic>.from(e as Map)))\n            .toList() ??\n        [],\n    ignoreForFile: (json['ignore_for_file'] as List<dynamic>?)\n            ?.map((e) => e as String)\n            .toList() ??\n        [],\n  );\n}\n\nMap<String, dynamic> _$GeneratorOptionsToJson(GeneratorOptions instance) =>\n    <String, dynamic>{\n      'generate_helpers': instance.generateHelpers,\n      'generate_queries': instance.generateQueries,\n      'scalar_mapping': instance.scalarMapping,\n      'fragments_glob': instance.fragmentsGlob,\n      'schema_mapping': instance.schemaMapping,\n      'ignore_for_file': instance.ignoreForFile,\n    };\n\nDartType _$DartTypeFromJson(Map<String, dynamic> json) {\n  return DartType(\n    name: json['name'] as String?,\n    imports:\n        (json['imports'] as List<dynamic>?)?.map((e) => e as String).toList() ??\n            [],\n  );\n}\n\nMap<String, dynamic> _$DartTypeToJson(DartType instance) => <String, dynamic>{\n      'name': instance.name,\n      'imports': instance.imports,\n    };\n\nScalarMap _$ScalarMapFromJson(Map<String, dynamic> json) {\n  return ScalarMap(\n    graphQLType: json['graphql_type'] as String?,\n    dartType:\n        json['dart_type'] == null ? null : DartType.fromJson(json['dart_type']),\n    customParserImport: json['custom_parser_import'] as String?,\n  );\n}\n\nMap<String, dynamic> _$ScalarMapToJson(ScalarMap instance) => <String, dynamic>{\n      'graphql_type': instance.graphQLType,\n      'dart_type': instance.dartType,\n      'custom_parser_import': instance.customParserImport,\n    };\n\nSchemaMap _$SchemaMapFromJson(Map<String, dynamic> json) {\n  return SchemaMap(\n    output: json['output'] as String?,\n    schema: json['schema'] as String?,\n    queriesGlob: json['queries_glob'] as String?,\n    fragmentsGlob: json['fragments_glob'] as String?,\n    typeNameField: json['type_name_field'] as String? ?? '__typename',\n    appendTypeName: json['append_type_name'] as bool? ?? false,\n    namingScheme: _$enumDecodeNullable(\n        _$NamingSchemeEnumMap, json['naming_scheme'],\n        unknownValue: NamingScheme.pathedWithTypes),\n  );\n}\n\nMap<String, dynamic> _$SchemaMapToJson(SchemaMap instance) => <String, dynamic>{\n      'output': instance.output,\n      'schema': instance.schema,\n      'queries_glob': instance.queriesGlob,\n      'fragments_glob': instance.fragmentsGlob,\n      'type_name_field': instance.typeNameField,\n      'append_type_name': instance.appendTypeName,\n      'naming_scheme': _$NamingSchemeEnumMap[instance.namingScheme],\n    };\n\nK _$enumDecode<K, V>(\n  Map<K, V> enumValues,\n  Object? source, {\n  K? unknownValue,\n}) {\n  if (source == null) {\n    throw ArgumentError(\n      'A value must be provided. Supported values: '\n      '${enumValues.values.join(', ')}',\n    );\n  }\n\n  return enumValues.entries.singleWhere(\n    (e) => e.value == source,\n    orElse: () {\n      if (unknownValue == null) {\n        throw ArgumentError(\n          '`$source` is not one of the supported values: '\n          '${enumValues.values.join(', ')}',\n        );\n      }\n      return MapEntry(unknownValue, enumValues.values.first);\n    },\n  ).key;\n}\n\nK? _$enumDecodeNullable<K, V>(\n  Map<K, V> enumValues,\n  dynamic source, {\n  K? unknownValue,\n}) {\n  if (source == null) {\n    return null;\n  }\n  return _$enumDecode<K, V>(enumValues, source, unknownValue: unknownValue);\n}\n\nconst _$NamingSchemeEnumMap = {\n  NamingScheme.pathedWithTypes: 'pathedWithTypes',\n  NamingScheme.pathedWithFields: 'pathedWithFields',\n  NamingScheme.simple: 'simple',\n};\n"
  },
  {
    "path": "lib/transformer/add_typename_transformer.dart",
    "content": "import 'package:gql/ast.dart';\n\n/// adds type name resolving to all schema types\nclass AppendTypename extends TransformingVisitor {\n  /// type name value\n  final String typeName;\n\n  /// adds type name resolving to all schema types\n  AppendTypename(this.typeName);\n\n  @override\n\n  /// appends type name to OperationDefinitionNode\n  @override\n  OperationDefinitionNode visitOperationDefinitionNode(\n      OperationDefinitionNode node) {\n    // if (node.selectionSet == null) {\n    //   return node;\n    // }\n\n    return OperationDefinitionNode(\n      type: node.type,\n      name: node.name,\n      variableDefinitions: node.variableDefinitions,\n      directives: node.directives,\n      span: node.span,\n      selectionSet: SelectionSetNode(\n        selections: <SelectionNode>[\n          ...node.selectionSet.selections.where((element) =>\n              (element is! FieldNode) || (element.name.value != typeName)),\n          FieldNode(name: NameNode(value: typeName)),\n        ],\n      ),\n    );\n  }\n\n  /// appends type name to FragmentDefinitionNode\n  @override\n  FragmentDefinitionNode visitFragmentDefinitionNode(\n      FragmentDefinitionNode node) {\n    if (node.selectionSet.selections.isEmpty) {\n      return node;\n    }\n\n    return FragmentDefinitionNode(\n      name: node.name,\n      typeCondition: node.typeCondition,\n      directives: node.directives,\n      span: node.span,\n      selectionSet: SelectionSetNode(\n        selections: <SelectionNode>[\n          ...node.selectionSet.selections.where((element) =>\n              (element is! FieldNode) || (element.name.value != typeName)),\n          FieldNode(name: NameNode(value: typeName)),\n        ],\n      ),\n    );\n  }\n\n  /// appends type name to OperationDefinitionNode\n  @override\n  InlineFragmentNode visitInlineFragmentNode(InlineFragmentNode node) {\n    if (node.selectionSet.selections.isEmpty) {\n      return node;\n    }\n\n    return InlineFragmentNode(\n      typeCondition: node.typeCondition,\n      directives: node.directives,\n      span: node.span,\n      selectionSet: SelectionSetNode(\n        selections: <SelectionNode>[\n          ...node.selectionSet.selections.where((element) =>\n              (element is! FieldNode) || (element.name.value != typeName)),\n          FieldNode(name: NameNode(value: typeName)),\n        ],\n      ),\n    );\n  }\n\n  /// appends type name to OperationDefinitionNode\n  @override\n  FieldNode visitFieldNode(FieldNode node) {\n    if (node.selectionSet == null) {\n      return node;\n    }\n\n    return FieldNode(\n      name: node.name,\n      alias: node.alias,\n      arguments: node.arguments,\n      directives: node.directives,\n      span: node.span,\n      selectionSet: SelectionSetNode(\n        selections: <SelectionNode>[\n          ...node.selectionSet?.selections.where((element) =>\n                  (element is! FieldNode) ||\n                  (element.name.value != typeName)) ??\n              [],\n          FieldNode(name: NameNode(value: typeName)),\n        ],\n      ),\n    );\n  }\n}\n"
  },
  {
    "path": "lib/visitor/canonical_visitor.dart",
    "content": "import 'package:artemis/generator.dart';\nimport 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:artemis/generator/data/nullable.dart';\nimport 'package:artemis/generator/ephemeral_data.dart';\nimport 'package:artemis/generator/helpers.dart';\nimport 'package:artemis/generator/graphql_helpers.dart' as gql;\nimport 'package:gql/ast.dart';\n\n/// class definition lazy generator\ntypedef ClassDefinitionGenerator = ClassDefinition Function();\n\n/// class definition lazy generator\ntypedef EnumDefinitionGenerator = EnumDefinition Function();\n\n/// Visits canonical types Enums and InputObjects\nclass CanonicalVisitor extends RecursiveVisitor {\n  /// Constructor\n  CanonicalVisitor({\n    required this.context,\n  });\n\n  /// Current context\n  final Context context;\n\n  /// List of visited input objects\n  final Map<String, ClassDefinitionGenerator> inputObjects = {};\n\n  /// List of visited enums\n  final Map<String, EnumDefinitionGenerator> enums = {};\n\n  @override\n  void visitEnumTypeDefinitionNode(EnumTypeDefinitionNode node) {\n    enums[node.name.value] = () {\n      final enumName = EnumName(name: node.name.value);\n\n      final nextContext = context.sameTypeWithNoPath(\n        alias: enumName,\n        ofUnion: Nullable<TypeDefinitionNode?>(null),\n      );\n\n      logFn(context, nextContext.align, '-> Enum');\n      logFn(context, nextContext.align,\n          '<- Generated enum ${enumName.namePrintable}.');\n\n      return EnumDefinition(\n        name: enumName,\n        values: node.values\n            .map((ev) => EnumValueDefinition(\n                  name: EnumValueName(name: ev.name.value),\n                  annotations: proceedDeprecated(ev.directives),\n                ))\n            .toList()\n          ..add(artemisUnknown),\n      );\n    };\n  }\n\n  @override\n  void visitInputObjectTypeDefinitionNode(InputObjectTypeDefinitionNode node) {\n    inputObjects[node.name.value] = () {\n      final name = ClassName(name: node.name.value);\n      final nextContext = context.sameTypeWithNoPath(\n        alias: name,\n        ofUnion: Nullable<TypeDefinitionNode?>(null),\n      );\n\n      logFn(context, nextContext.align, '-> Input class');\n      logFn(context, nextContext.align,\n          '┌ ${nextContext.path}[${node.name.value}]');\n      final properties = <ClassProperty>[];\n\n      properties.addAll(node.fields.map((i) {\n        final nextType =\n            gql.getTypeByName(nextContext.typeDefinitionNodeVisitor, i.type);\n        return createClassProperty(\n          fieldName: ClassPropertyName(name: i.name.value),\n          context: nextContext.nextTypeWithNoPath(\n            nextType: node,\n            nextClassName: ClassName(name: nextType.name.value),\n            nextFieldName: ClassName(name: i.name.value),\n            ofUnion: Nullable<TypeDefinitionNode?>(null),\n          ),\n          markAsUsed: false,\n        );\n      }));\n\n      logFn(context, nextContext.align,\n          '└ ${nextContext.path}[${node.name.value}]');\n      logFn(context, nextContext.align,\n          '<- Generated input class ${name.namePrintable}.');\n\n      return ClassDefinition(\n        isInput: true,\n        name: name,\n        properties: properties,\n      );\n    };\n  }\n}\n"
  },
  {
    "path": "lib/visitor/generator_visitor.dart",
    "content": "import 'package:artemis/generator.dart';\nimport 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/nullable.dart';\nimport 'package:artemis/generator/ephemeral_data.dart';\nimport 'package:artemis/generator/graphql_helpers.dart' as gql;\nimport 'package:artemis/generator/helpers.dart';\nimport 'package:collection/collection.dart' show IterableExtension;\nimport 'package:gql/ast.dart';\n\n/// Visitor for types generation\nclass GeneratorVisitor extends RecursiveVisitor {\n  /// Constructor\n  GeneratorVisitor({\n    required this.context,\n  });\n\n  /// Current context\n  final Context context;\n\n  /// Selection nodes\n  SelectionSetNode? selectionSetNode;\n\n  /// Class properties\n  final List<ClassProperty> _classProperties = [];\n\n  /// Mixnis\n  final List<FragmentName> _mixins = [];\n\n  @override\n  void visitSelectionSetNode(SelectionSetNode node) {\n    final nextContext = context.withAlias();\n\n    logFn(context, nextContext.align, '-> Class');\n    logFn(context, nextContext.align,\n        '┌ ${nextContext.path}[${nextContext.currentType!.name.value}][${nextContext.currentClassName} ${nextContext.currentFieldName}] (${nextContext.alias ?? ''})');\n    super.visitSelectionSetNode(node);\n\n    final possibleTypes = <String, Name>{};\n\n    if (nextContext.currentType is UnionTypeDefinitionNode ||\n        nextContext.currentType is InterfaceTypeDefinitionNode) {\n      // Filter by requested types\n      final keys = node.selections\n          .whereType<InlineFragmentNode>()\n          .map((n) => n.typeCondition?.on.name.value)\n          .whereType<String>();\n\n      final values = keys.map((t) => ClassName.fromPath(\n          path:\n              nextContext.withAlias(alias: ClassName(name: t)).fullPathName()));\n\n      possibleTypes.addAll(Map.fromIterables(keys, values));\n    }\n\n    final partOfUnion = nextContext.ofUnion != null;\n    if (partOfUnion) {}\n\n    final name = ClassName.fromPath(path: nextContext.fullPathName());\n    logFn(context, nextContext.align,\n        '└ ${nextContext.path}[${nextContext.currentType!.name.value}][${nextContext.currentClassName} ${nextContext.currentFieldName}] (${nextContext.alias ?? ''})');\n    logFn(context, nextContext.align,\n        '<- Generated class ${name.namePrintable}.');\n\n    nextContext.generatedClasses.add(ClassDefinition(\n      name: name,\n      properties: _classProperties,\n      mixins: _mixins,\n      extension: partOfUnion\n          ? ClassName.fromPath(path: nextContext.rollbackPath().fullPathName())\n          : null,\n      factoryPossibilities: possibleTypes,\n    ));\n  }\n\n  @override\n  void visitFieldNode(FieldNode node) {\n    final fieldName = node.name.value;\n    final name = node.alias?.value;\n\n    final property = createClassProperty(\n      fieldName: ClassPropertyName(name: fieldName),\n      fieldAlias: name != null ? ClassPropertyName(name: name) : null,\n      context: context,\n      onNewClassFound: (nextContext) {\n        node.visitChildren(GeneratorVisitor(\n          context: nextContext,\n        ));\n      },\n    );\n    _classProperties.add(property);\n  }\n\n  @override\n  void visitInlineFragmentNode(InlineFragmentNode node) {\n    logFn(context, context.align + 1,\n        '${context.path}: ... on ${node.typeCondition!.on.name.value}');\n    final nextType = gql.getTypeByName(\n        context.typeDefinitionNodeVisitor, node.typeCondition!.on);\n\n    if (nextType.name.value == context.currentType!.name.value) {\n      final visitor = GeneratorVisitor(\n        context: context.nextTypeWithSamePath(\n          nextType: nextType,\n          nextClassName: null,\n          nextFieldName: null,\n          ofUnion: Nullable<TypeDefinitionNode?>(context.currentType),\n          inputsClasses: [],\n          fragments: [],\n        ),\n      );\n      node.selectionSet.visitChildren(visitor);\n    } else {\n      final visitor = GeneratorVisitor(\n        context: context.next(\n          nextType: nextType,\n          nextClassName: ClassName(name: nextType.name.value),\n          nextFieldName: ClassPropertyName(name: nextType.name.value),\n          ofUnion: Nullable<TypeDefinitionNode?>(context.currentType),\n          inputsClasses: [],\n          fragments: [],\n        ),\n      );\n      node.visitChildren(visitor);\n    }\n  }\n\n  ///\n  void addUsedInputObjectsAndEnums(InputObjectTypeDefinitionNode node) {\n    if (context.usedInputObjects.contains(ClassName(name: node.name.value))) {\n      return;\n    }\n    context.usedInputObjects.add(ClassName(name: node.name.value));\n\n    for (final field in node.fields) {\n      final type =\n          gql.getTypeByName(context.typeDefinitionNodeVisitor, field.type);\n\n      if (type is InputObjectTypeDefinitionNode) {\n        addUsedInputObjectsAndEnums(type);\n      } else if (type is EnumTypeDefinitionNode) {\n        context.usedEnums.add(EnumName(name: type.name.value));\n      }\n    }\n  }\n\n  @override\n  void visitVariableDefinitionNode(VariableDefinitionNode node) {\n    final leafType =\n        gql.getTypeByName(context.typeDefinitionNodeVisitor, node.type);\n\n    final nextClassName = context\n        .nextTypeWithNoPath(\n          nextType: leafType,\n          nextClassName: ClassName(name: leafType.name.value),\n          nextFieldName: ClassName(name: node.variable.name.value),\n          ofUnion: Nullable<TypeDefinitionNode?>(null),\n        )\n        .fullPathName();\n\n    final dartTypeName = gql.buildTypeName(\n      node.type,\n      context.options,\n      dartType: true,\n      replaceLeafWith: ClassName.fromPath(path: nextClassName),\n      typeDefinitionNodeVisitor: context.typeDefinitionNodeVisitor,\n    );\n\n    final jsonKeyAnnotation = <String, String>{};\n\n    if (leafType is EnumTypeDefinitionNode) {\n      context.usedEnums.add(EnumName(name: leafType.name.value));\n      final variableNodeType = node.type;\n      if (variableNodeType is ListTypeNode) {\n        final innerDartTypeName = gql.buildTypeName(\n          variableNodeType.type,\n          context.options,\n          dartType: true,\n          replaceLeafWith: ClassName.fromPath(path: nextClassName),\n          typeDefinitionNodeVisitor: context.typeDefinitionNodeVisitor,\n        );\n        jsonKeyAnnotation['unknownEnumValue'] =\n            '${EnumName(name: innerDartTypeName.name).dartTypeSafe}.${artemisUnknown.name.namePrintable}';\n      } else {\n        jsonKeyAnnotation['unknownEnumValue'] =\n            '${EnumName(name: dartTypeName.name).dartTypeSafe}.${artemisUnknown.name.namePrintable}';\n      }\n    } else if (leafType is InputObjectTypeDefinitionNode) {\n      addUsedInputObjectsAndEnums(leafType);\n    } else if (leafType is ScalarTypeDefinitionNode) {\n      final scalar =\n          gql.getSingleScalarMap(context.options, leafType.name.value);\n\n      if (scalar?.customParserImport != null &&\n          leafType.name.value == scalar?.graphQLType) {\n        final graphqlTypeName = gql.buildTypeName(\n          node.type,\n          context.options,\n          dartType: false,\n          typeDefinitionNodeVisitor: context.typeDefinitionNodeVisitor,\n        );\n\n        jsonKeyAnnotation['fromJson'] =\n            'fromGraphQL${graphqlTypeName.parserSafe}ToDart${dartTypeName.parserSafe}';\n        jsonKeyAnnotation['toJson'] =\n            'fromDart${dartTypeName.parserSafe}ToGraphQL${graphqlTypeName.parserSafe}';\n      }\n    }\n\n    final inputName = QueryInputName(name: node.variable.name.value);\n\n    if (inputName.namePrintable != inputName.name) {\n      jsonKeyAnnotation['name'] = '\\'${inputName.name}\\'';\n    }\n\n    var annotations = <String>[];\n\n    if (jsonKeyAnnotation.isNotEmpty) {\n      final jsonKey = jsonKeyAnnotation.entries\n          .map<String>((e) => '${e.key}: ${e.value}')\n          .join(', ');\n      annotations.add('JsonKey($jsonKey)');\n    }\n\n    context.inputsClasses.add(QueryInput(\n      type: dartTypeName,\n      name: inputName,\n      annotations: annotations,\n    ));\n  }\n\n  @override\n  void visitFragmentSpreadNode(FragmentSpreadNode node) {\n    logFn(context, context.align + 1,\n        '${context.path}: ... expanding ${node.name.value}');\n    final fragmentName = FragmentName.fromPath(\n        path: context\n            .sameTypeWithNoPath(\n              alias: FragmentName(name: node.name.value),\n              ofUnion: Nullable<TypeDefinitionNode?>(null),\n            )\n            .fullPathName());\n\n    final visitor = GeneratorVisitor(\n      context: context.sameTypeWithNextPath(\n        alias: fragmentName,\n        generatedClasses: [],\n        ofUnion: Nullable<TypeDefinitionNode?>(null),\n        log: false,\n      ),\n    );\n    final fragmentDef = context.fragments\n        .firstWhereOrNull((fragment) => fragment.name.value == node.name.value);\n    fragmentDef?.visitChildren(visitor);\n\n    _mixins\n      ..add(fragmentName)\n      ..addAll(visitor._mixins);\n  }\n\n  @override\n  void visitFragmentDefinitionNode(FragmentDefinitionNode node) {\n    final partName = FragmentName(name: node.name.value);\n    final nextContext = context.sameTypeWithNoPath(\n      alias: partName,\n      ofUnion: Nullable<TypeDefinitionNode?>(null),\n    );\n\n    logFn(context, nextContext.align, '-> Fragment');\n    logFn(context, nextContext.align,\n        '┌ ${nextContext.path}[${node.name.value}]');\n    nextContext.fragments.add(node);\n\n    final nextType = gql.getTypeByName(\n        nextContext.typeDefinitionNodeVisitor, node.typeCondition.on);\n\n    final visitorContext = Context(\n      schema: context.schema,\n      typeDefinitionNodeVisitor: context.typeDefinitionNodeVisitor,\n      options: context.options,\n      schemaMap: context.schemaMap,\n      path: [nextContext.alias].whereType<Name>().toList(),\n      currentType: nextType,\n      currentFieldName: null,\n      currentClassName: null,\n      alias: nextContext.alias,\n      generatedClasses: nextContext.generatedClasses,\n      inputsClasses: [],\n      fragments: [],\n      usedEnums: nextContext.usedEnums,\n      usedInputObjects: nextContext.usedInputObjects,\n    );\n\n    final visitor = GeneratorVisitor(context: visitorContext);\n\n    node.selectionSet.visitChildren(visitor);\n\n    final otherMixinsProps = nextContext.generatedClasses\n        .whereType<FragmentClassDefinition>()\n        .where((def) => visitor._mixins.contains(def.name))\n        .map((def) => def.properties)\n        .expand((a) => a)\n        .mergeDuplicatesBy((a) => a.name, (a, b) => a);\n\n    final fragmentName =\n        FragmentName.fromPath(path: nextContext.fullPathName());\n    logFn(context, nextContext.align,\n        '└ ${nextContext.path}[${node.name.value}]');\n    logFn(context, nextContext.align,\n        '<- Generated fragment ${fragmentName.namePrintable}.');\n\n    nextContext.generatedClasses.add(\n      FragmentClassDefinition(\n        name: fragmentName,\n        properties:\n            visitor._classProperties.followedBy(otherMixinsProps).toList(),\n      ),\n    );\n  }\n}\n"
  },
  {
    "path": "lib/visitor/object_type_definition_visitor.dart",
    "content": "import 'package:gql/ast.dart';\n\n/// Visits all object definition nodes recursively\nclass ObjectTypeDefinitionVisitor extends RecursiveVisitor {\n  /// Stores all object definition nodes\n  Iterable<ObjectTypeDefinitionNode> types = [];\n\n  @override\n  void visitObjectTypeDefinitionNode(\n    ObjectTypeDefinitionNode node,\n  ) {\n    types = types.followedBy([node]);\n    super.visitObjectTypeDefinitionNode(node);\n  }\n\n  /// Gets object type definition node by operation name\n  ObjectTypeDefinitionNode? getByName(String name) {\n    final type = types.where((type) => type.name.value == name);\n\n    if (type.isNotEmpty) {\n      return type.first;\n    }\n\n    return null;\n  }\n}\n"
  },
  {
    "path": "lib/visitor/operation_type_definition_visitor.dart",
    "content": "import 'package:gql/ast.dart';\n\n/// Visits all operation definition nodes recursively\nclass OperationTypeDefinitionNodeVisitor extends RecursiveVisitor {\n  /// Stores all operation definition nodes\n  Iterable<OperationTypeDefinitionNode> types = [];\n\n  @override\n  void visitOperationTypeDefinitionNode(\n    OperationTypeDefinitionNode node,\n  ) {\n    types = types.followedBy([node]);\n    super.visitOperationTypeDefinitionNode(node);\n  }\n\n  /// Gets operation type definition node by operation name\n  OperationTypeDefinitionNode? getByType(OperationType operationType) {\n    final type = types.where((type) => type.operation == operationType);\n\n    if (type.isNotEmpty) {\n      return type.first;\n    }\n\n    return null;\n  }\n}\n"
  },
  {
    "path": "lib/visitor/schema_definition_visitor.dart",
    "content": "import 'package:gql/ast.dart';\n\n/// Visits the schema definition node.\nclass SchemaDefinitionVisitor extends RecursiveVisitor {\n  /// Store the schema definition.\n  SchemaDefinitionNode? schemaDefinitionNode;\n\n  @override\n  void visitSchemaDefinitionNode(\n    SchemaDefinitionNode node,\n  ) {\n    schemaDefinitionNode = node;\n  }\n}\n"
  },
  {
    "path": "lib/visitor/type_definition_node_visitor.dart",
    "content": "import 'package:gql/ast.dart';\n\nList<MapEntry<String, TypeDefinitionNode>> _defaultScalars =\n    ['Boolean', 'Float', 'ID', 'Int', 'String']\n        .map((e) => MapEntry(\n            e,\n            ScalarTypeDefinitionNode(\n              name: NameNode(value: e),\n            )))\n        .toList();\n\n/// Visits all type definition nodes recursively\nclass TypeDefinitionNodeVisitor extends RecursiveVisitor {\n  /// Stores all type definition nodes\n  Map<String, TypeDefinitionNode> types = Map.fromEntries(_defaultScalars);\n\n  @override\n  void visitObjectTypeDefinitionNode(\n    ObjectTypeDefinitionNode node,\n  ) {\n    types[node.name.value] = node;\n    super.visitObjectTypeDefinitionNode(node);\n  }\n\n  @override\n  void visitScalarTypeDefinitionNode(\n    ScalarTypeDefinitionNode node,\n  ) {\n    types[node.name.value] = node;\n    super.visitScalarTypeDefinitionNode(node);\n  }\n\n  @override\n  void visitInterfaceTypeDefinitionNode(\n    InterfaceTypeDefinitionNode node,\n  ) {\n    types[node.name.value] = node;\n    super.visitInterfaceTypeDefinitionNode(node);\n  }\n\n  @override\n  void visitUnionTypeDefinitionNode(\n    UnionTypeDefinitionNode node,\n  ) {\n    types[node.name.value] = node;\n    super.visitUnionTypeDefinitionNode(node);\n  }\n\n  @override\n  void visitInputObjectTypeDefinitionNode(\n    InputObjectTypeDefinitionNode node,\n  ) {\n    types[node.name.value] = node;\n    super.visitInputObjectTypeDefinitionNode(node);\n  }\n\n  @override\n  void visitEnumTypeDefinitionNode(\n    EnumTypeDefinitionNode node,\n  ) {\n    types[node.name.value] = node;\n    super.visitEnumTypeDefinitionNode(node);\n  }\n\n  /// Gets type definition node by type name\n  TypeDefinitionNode? getByName(String name) {\n    final type = types[name];\n\n    if (type != null) {\n      return type;\n    }\n\n    return null;\n  }\n}\n"
  },
  {
    "path": "pubspec.yaml",
    "content": "name: artemis\nversion: 7.13.1\n\ndescription: Build dart types from GraphQL schemas and queries (using Introspection Query).\nhomepage: https://github.com/comigor/artemis\n\nenvironment:\n  sdk: \">=2.18.0 <3.0.0\"\n\ndependencies:\n  build_config: ^1.1.1\n  code_builder: ^4.4.0\n  build: ^2.3.1\n  collection: ^1.17.1\n  dart_style: ^2.3.0\n  equatable: ^2.0.5\n  glob: ^2.1.1\n  gql_code_builder: ^0.7.1\n  gql_dedupe_link: ^2.0.3+1\n  gql_exec: ^0.4.3\n  gql_http_link: ^0.4.5\n  gql_link: ^0.5.1\n  gql: ^0.14.0\n  http: ^0.13.5\n  json_annotation: ^4.8.0\n  path: ^1.8.3\n  recase: ^4.1.0\n  source_gen: ^1.2.7\n  yaml: ^3.1.1\n\ndev_dependencies:\n  args: ^2.4.0\n  build_runner: ^2.3.3\n  build_test: ^2.1.7\n  json_serializable: ^6.6.1\n  build_resolvers: ^2.2.0\n  test: ^1.22.2\n  logging: ^1.1.1\n  lints: ^2.0.1\n"
  },
  {
    "path": "test/generator/helpers_test.dart",
    "content": "import 'package:test/test.dart';\nimport 'package:artemis/generator/helpers.dart';\n\nvoid main() {\n  group('On removeDuplicatedBy helper', () {\n    test('It will return a new iterable.', () {\n      final it = [\n        {'a': 1},\n        {'a': 2},\n      ];\n      final anotherIt = it.removeDuplicatedBy((i) => i['a']);\n\n      expect(anotherIt == it, false);\n    });\n\n    test('It will not mutate the old iterable.', () {\n      final it = [\n        {'a': 1},\n        {'a': 2},\n        {'a': 2},\n        {'a': 1},\n      ];\n      final copyOfIt = List.from(it);\n      it.removeDuplicatedBy((i) => i['a']);\n\n      expect(it, equals(copyOfIt));\n    });\n\n    test('It will keep only the first entry that matches the function.', () {\n      final it = [\n        {'a': 1, 'first': true},\n        {'a': 2, 'first': true},\n        {'a': 2, 'first': false},\n        {'a': 1, 'first': false},\n      ];\n      final anotherIt = it.removeDuplicatedBy((i) => i['a']);\n\n      expect(\n          anotherIt,\n          equals([\n            {'a': 1, 'first': true},\n            {'a': 2, 'first': true},\n          ]));\n    });\n\n    test('Iterable function can return anything.', () {\n      final it = [\n        {'a': 1, 'first': true},\n        {'a': 2, 'first': true},\n        {'a': 2, 'first': false},\n        {'a': 1, 'first': false},\n      ];\n      final anotherIt = it.removeDuplicatedBy((i) => i);\n\n      expect(anotherIt, equals(it));\n    });\n  });\n\n  group('On mergeDuplicatesBy helper', () {\n    test('It will return a new iterable.', () {\n      final it = [\n        {'a': 1},\n        {'a': 2},\n      ];\n      final anotherIt = it.mergeDuplicatesBy((i) => i, (i, _) => i);\n\n      expect(anotherIt == it, false);\n    });\n\n    test('It can behave like removeDuplicatedBy.', () {\n      final it = [\n        {'a': 1, 'first': true},\n        {'a': 2, 'first': true},\n        {'a': 2, 'first': false},\n        {'a': 1, 'first': false},\n      ];\n      final anotherIt = it.mergeDuplicatesBy((i) => i['a'], (i, _) => i);\n\n      expect(\n          anotherIt,\n          equals([\n            {'a': 1, 'first': true},\n            {'a': 2, 'first': true},\n          ]));\n    });\n\n    test('It can return a list of the last elements based on fn.', () {\n      final it = [\n        {'a': 1, 'last': false},\n        {'a': 2, 'last': false},\n        {'a': 2, 'last': true},\n        {'a': 1, 'last': true},\n      ];\n      final anotherIt = it.mergeDuplicatesBy((i) => i['a'], (_, i) => i);\n\n      expect(\n          anotherIt,\n          equals([\n            {'a': 1, 'last': true},\n            {'a': 2, 'last': true},\n          ]));\n    });\n  });\n}\n"
  },
  {
    "path": "test/generator/print_helpers_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:artemis/generator/print_helpers.dart';\nimport 'package:gql/language.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  group('On printCustomEnum', () {\n    test('It will throw if name is empty.', () {\n      expect(\n          () => enumDefinitionToSpec(\n              EnumDefinition(name: EnumName(name: ''), values: [])),\n          throwsA(TypeMatcher<AssertionError>()));\n    });\n\n    test('It will throw if values is empty.', () {\n      // expect(\n      //     () => enumDefinitionToSpec(\n      //         EnumDefinition(name: EnumName(name: 'Name'), values: null)),\n      //     throwsA(TypeMatcher<AssertionError>()));\n      expect(\n          () => enumDefinitionToSpec(\n              EnumDefinition(name: EnumName(name: 'Name'), values: [])),\n          throwsA(TypeMatcher<AssertionError>()));\n    });\n\n    test('It will generate an Enum declaration.', () {\n      final definition = EnumDefinition(name: EnumName(name: 'Name'), values: [\n        EnumValueDefinition(\n          name: EnumValueName(name: 'Option'),\n        ),\n        EnumValueDefinition(\n          name: EnumValueName(name: 'anotherOption'),\n        ),\n        EnumValueDefinition(\n          name: EnumValueName(name: 'third_option'),\n        ),\n        EnumValueDefinition(\n          name: EnumValueName(name: 'FORTH_OPTION'),\n        ),\n      ]);\n\n      final str = specToString(enumDefinitionToSpec(definition));\n\n      expect(str, '''enum Name {\n  @JsonValue('Option')\n  option,\n  @JsonValue('anotherOption')\n  anotherOption,\n  @JsonValue('third_option')\n  thirdOption,\n  @JsonValue('FORTH_OPTION')\n  forthOption,\n}\n''');\n    });\n\n    test('It will ignore duplicate options.', () {\n      final definition = EnumDefinition(name: EnumName(name: 'Name'), values: [\n        EnumValueDefinition(\n          name: EnumValueName(name: 'Option'),\n        ),\n        EnumValueDefinition(\n          name: EnumValueName(name: 'AnotherOption'),\n        ),\n        EnumValueDefinition(\n          name: EnumValueName(name: 'Option'),\n        ),\n        EnumValueDefinition(\n          name: EnumValueName(name: 'AnotherOption'),\n        ),\n      ]);\n\n      final str = specToString(enumDefinitionToSpec(definition));\n\n      expect(str, '''enum Name {\n  @JsonValue('Option')\n  option,\n  @JsonValue('AnotherOption')\n  anotherOption,\n}\n''');\n    });\n  });\n\n  group('On printCustomFragmentClass', () {\n    test('It will throw if name is null or empty.', () {\n      expect(\n          () => fragmentClassDefinitionToSpec(FragmentClassDefinition(\n              name: FragmentName(name: ''), properties: [])),\n          throwsA(TypeMatcher<AssertionError>()));\n    });\n\n    test('It will generate an Mixins declarations.', () {\n      final definition = FragmentClassDefinition(\n          name: FragmentName(name: 'FragmentMixin'),\n          properties: [\n            ClassProperty(\n                type: TypeName(name: 'Type'),\n                name: ClassPropertyName(name: 'name')),\n            ClassProperty(\n                type: TypeName(name: 'Type'),\n                name: ClassPropertyName(name: 'name'),\n                annotations: ['override']),\n            ClassProperty(\n                type: TypeName(name: 'Type'),\n                name: ClassPropertyName(name: 'name'),\n                annotations: ['Test']),\n          ]);\n\n      final str = specToString(fragmentClassDefinitionToSpec(definition));\n\n      expect(str, '''mixin FragmentMixin {\n  Type? name;\n  @override\n  Type? name;\n  @Test\n  Type? name;\n}\n''');\n    });\n  });\n\n  group('On printCustomClass', () {\n    test('It will throw if name is empty.', () {\n      // expect(\n      //     () => classDefinitionToSpec(\n      //         ClassDefinition(name: null, properties: []), [], []),\n      //     throwsA(TypeMatcher<AssertionError>()));\n      expect(\n          () => classDefinitionToSpec(\n              ClassDefinition(name: ClassName(name: ''), properties: []),\n              [],\n              []),\n          throwsA(TypeMatcher<AssertionError>()));\n    });\n\n    test('It can generate a class without properties.', () {\n      final definition =\n          ClassDefinition(name: ClassName(name: 'AClass'), properties: []);\n\n      final str = specToString(classDefinitionToSpec(definition, [], []));\n\n      expect(str, '''@JsonSerializable(explicitToJson: true)\nclass AClass extends JsonSerializable with EquatableMixin {\n  AClass();\n\n  factory AClass.fromJson(Map<String, dynamic> json) => _\\$AClassFromJson(json);\n\n  @override\n  List<Object?> get props => [];\n  @override\n  Map<String, dynamic> toJson() => _\\$AClassToJson(this);\n}\n''');\n    });\n\n    test('\"Mixins\" will be included to class.', () {\n      final definition = ClassDefinition(\n          name: ClassName(name: 'AClass'),\n          properties: [],\n          extension: ClassName(name: 'AnotherClass'));\n\n      final str = specToString(classDefinitionToSpec(definition, [], []));\n\n      expect(str, '''@JsonSerializable(explicitToJson: true)\nclass AClass extends AnotherClass with EquatableMixin {\n  AClass();\n\n  factory AClass.fromJson(Map<String, dynamic> json) => _\\$AClassFromJson(json);\n\n  @override\n  List<Object?> get props => [];\n  @override\n  Map<String, dynamic> toJson() => _\\$AClassToJson(this);\n}\n''');\n    });\n\n    test(\n        'factoryPossibilities and typeNameField are used to generated a branch factory.',\n        () {\n      final definition = ClassDefinition(\n        name: ClassName(name: 'AClass'),\n        properties: [],\n        factoryPossibilities: {\n          'ASubClass': ClassName(name: 'ASubClass'),\n          'BSubClass': ClassName(name: 'BSubClass'),\n        },\n        typeNameField: ClassPropertyName(name: '__typename'),\n      );\n\n      final str = specToString(classDefinitionToSpec(definition, [], []));\n\n      expect(str, r'''@JsonSerializable(explicitToJson: true)\nclass AClass extends JsonSerializable with EquatableMixin {\n  AClass();\n\n  factory AClass.fromJson(Map<String, dynamic> json) {\n    switch (json['__typename'].toString()) {\n      case r'ASubClass':\n        return ASubClass.fromJson(json);\n      case r'BSubClass':\n        return BSubClass.fromJson(json);\n      default:\n    }\n    return _$AClassFromJson(json);\n  }\n\n  @override\n  List<Object?> get props => [];\n  @override\n  Map<String, dynamic> toJson() {\n    switch ($$typename) {\n      case r'ASubClass':\n        return (this as ASubClass).toJson();\n      case r'BSubClass':\n        return (this as BSubClass).toJson();\n      default:\n    }\n    return _$AClassToJson(this);\n  }\n}\n''');\n    });\n\n    test('It can have properties.', () {\n      final definition =\n          ClassDefinition(name: ClassName(name: 'AClass'), properties: [\n        ClassProperty(\n            type: TypeName(name: 'Type'),\n            name: ClassPropertyName(name: 'name')),\n        ClassProperty(\n            type: TypeName(name: 'AnotherType'),\n            name: ClassPropertyName(name: 'anotherName')),\n      ]);\n\n      final str = specToString(classDefinitionToSpec(definition, [], []));\n\n      expect(str, '''@JsonSerializable(explicitToJson: true)\nclass AClass extends JsonSerializable with EquatableMixin {\n  AClass();\n\n  factory AClass.fromJson(Map<String, dynamic> json) => _\\$AClassFromJson(json);\n\n  Type? name;\n\n  AnotherType? anotherName;\n\n  @override\n  List<Object?> get props => [name, anotherName];\n  @override\n  Map<String, dynamic> toJson() => _\\$AClassToJson(this);\n}\n''');\n    });\n\n    test(\n        'Its properties can be an override or have a custom annotation, or both.',\n        () {\n      final definition =\n          ClassDefinition(name: ClassName(name: 'AClass'), properties: [\n        ClassProperty(\n            type: TypeName(name: 'Type'),\n            name: ClassPropertyName(name: 'nameA')),\n        ClassProperty(\n            type: TypeName(name: 'AnnotatedProperty'),\n            name: ClassPropertyName(name: 'nameB'),\n            annotations: ['Hey()']),\n        ClassProperty(\n            type: TypeName(name: 'OverridenProperty'),\n            name: ClassPropertyName(name: 'nameC'),\n            annotations: ['override']),\n        ClassProperty(\n            type: TypeName(name: 'AllAtOnce'),\n            name: ClassPropertyName(name: 'nameD'),\n            annotations: ['override', 'Ho()']),\n      ]);\n\n      final str = specToString(classDefinitionToSpec(definition, [], []));\n\n      expect(str, '''@JsonSerializable(explicitToJson: true)\nclass AClass extends JsonSerializable with EquatableMixin {\n  AClass();\n\n  factory AClass.fromJson(Map<String, dynamic> json) => _\\$AClassFromJson(json);\n\n  Type? nameA;\n\n  @Hey()\n  AnnotatedProperty? nameB;\n\n  @override\n  OverridenProperty? nameC;\n\n  @override\n  @Ho()\n  AllAtOnce? nameD;\n\n  @override\n  List<Object?> get props => [nameA, nameB, nameC, nameD];\n  @override\n  Map<String, dynamic> toJson() => _\\$AClassToJson(this);\n}\n''');\n    });\n\n    test(\n        'Mixins can be included and its properties will be considered on props getter',\n        () {\n      final definition = ClassDefinition(\n          name: ClassName(name: 'AClass'),\n          properties: [],\n          mixins: [FragmentName(name: 'FragmentMixin')]);\n\n      final str = specToString(classDefinitionToSpec(definition, [\n        FragmentClassDefinition(\n            name: FragmentName(name: 'FragmentMixin'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: 'Type'),\n                  name: ClassPropertyName(name: 'name')),\n            ])\n      ], []));\n\n      expect(str, '''@JsonSerializable(explicitToJson: true)\nclass AClass extends JsonSerializable with EquatableMixin, FragmentMixin {\n  AClass();\n\n  factory AClass.fromJson(Map<String, dynamic> json) => _\\$AClassFromJson(json);\n\n  @override\n  List<Object?> get props => [name];\n  @override\n  Map<String, dynamic> toJson() => _\\$AClassToJson(this);\n}\n''');\n    });\n\n    test('It can be an input object (and have a named parameter constructor).',\n        () {\n      final definition = ClassDefinition(\n        name: ClassName(name: 'AClass'),\n        properties: [\n          ClassProperty(\n              type: TypeName(name: 'Type'),\n              name: ClassPropertyName(name: 'name')),\n          ClassProperty(\n              type: TypeName(name: 'AnotherType', isNonNull: true),\n              name: ClassPropertyName(name: 'anotherName')),\n        ],\n        isInput: true,\n      );\n\n      final str = specToString(classDefinitionToSpec(definition, [], []));\n\n      expect(str, '''@JsonSerializable(explicitToJson: true)\nclass AClass extends JsonSerializable with EquatableMixin {\n  AClass({\n    this.name,\n    required this.anotherName,\n  });\n\n  factory AClass.fromJson(Map<String, dynamic> json) => _\\$AClassFromJson(json);\n\n  Type? name;\n\n  late AnotherType anotherName;\n\n  @override\n  List<Object?> get props => [name, anotherName];\n  @override\n  Map<String, dynamic> toJson() => _\\$AClassToJson(this);\n}\n''');\n    });\n  });\n\n  group('On generateQueryClassSpec', () {\n    test('It will throw if basename is null or empty.', () {\n      expect(() => generateLibrarySpec(LibraryDefinition(basename: '')),\n          throwsA(TypeMatcher<AssertionError>()));\n    });\n\n    test('It will throw if query name/type is null or empty.', () {\n      expect(\n        () => generateQueryClassSpec(\n          QueryDefinition(\n              name: QueryName(name: ''),\n              operationName: 'Type',\n              document: parseString('query test_query {}')),\n        ),\n        throwsA(TypeMatcher<AssertionError>()),\n      );\n      expect(\n        () => generateQueryClassSpec(\n          QueryDefinition(\n              name: QueryName(name: 'Type'),\n              operationName: '',\n              document: parseString('query test_query {}')),\n        ),\n        throwsA(\n          TypeMatcher<AssertionError>(),\n        ),\n      );\n      expect(\n        () => generateQueryClassSpec(\n          QueryDefinition(\n              name: QueryName(name: ''),\n              operationName: 'test_query',\n              document: parseString('query test_query {}')),\n        ),\n        throwsA(\n          TypeMatcher<AssertionError>(),\n        ),\n      );\n    });\n\n    test('It should generated an empty file by default.', () {\n      final buffer = StringBuffer();\n      final definition = LibraryDefinition(basename: r'test_query.graphql');\n      final ignoreForFile = <String>[];\n      writeLibraryDefinitionToBuffer(buffer, ignoreForFile, definition);\n\n      expect(buffer.toString(), '''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'test_query.graphql.g.dart';\n''');\n    });\n\n    test('When there are custom imports, they are included.', () {\n      final buffer = StringBuffer();\n      final definition = LibraryDefinition(\n          basename: r'test_query.graphql', customImports: ['some_file.dart']);\n      final ignoreForFile = <String>[];\n\n      writeLibraryDefinitionToBuffer(buffer, ignoreForFile, definition);\n\n      expect(buffer.toString(), '''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\nimport 'some_file.dart';\npart 'test_query.graphql.g.dart';\n''');\n    });\n\n    test('When generateHelpers is true, an execute fn is generated.', () {\n      final buffer = StringBuffer();\n      final definition = LibraryDefinition(\n        basename: r'test_query.graphql',\n        queries: [\n          QueryDefinition(\n            name: QueryName(name: 'test_query'),\n            operationName: 'test_query',\n            document: parseString('query test_query {}'),\n            generateHelpers: true,\n          )\n        ],\n      );\n      final ignoreForFile = <String>[];\n\n      writeLibraryDefinitionToBuffer(buffer, ignoreForFile, definition);\n\n      expect(buffer.toString(), '''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'test_query.graphql.g.dart';\n\nfinal TEST_QUERY_QUERY_DOCUMENT_OPERATION_NAME = 'test_query';\nfinal TEST_QUERY_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'test_query'),\n    variableDefinitions: [],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: []),\n  )\n]);\n\nclass TestQueryQuery extends GraphQLQuery<TestQuery, JsonSerializable> {\n  TestQueryQuery();\n\n  @override\n  final DocumentNode document = TEST_QUERY_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = TEST_QUERY_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  List<Object?> get props => [document, operationName];\n  @override\n  TestQuery parse(Map<String, dynamic> json) => TestQuery.fromJson(json);\n}\n''');\n    });\n\n    test(\n        'When generateHelpers is false and generateQueries is true, an execute fn is generated.',\n        () {\n      final buffer = StringBuffer();\n      final definition = LibraryDefinition(\n        basename: r'test_query.graphql',\n        queries: [\n          QueryDefinition(\n            name: QueryName(name: 'test_query'),\n            operationName: 'test_query',\n            document: parseString('query test_query {}'),\n            generateHelpers: false,\n            generateQueries: true,\n          )\n        ],\n      );\n      final ignoreForFile = <String>[];\n\n      writeLibraryDefinitionToBuffer(buffer, ignoreForFile, definition);\n\n      expect(buffer.toString(), '''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'test_query.graphql.g.dart';\n\nfinal TEST_QUERY_QUERY_DOCUMENT_OPERATION_NAME = 'test_query';\nfinal TEST_QUERY_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'test_query'),\n    variableDefinitions: [],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: []),\n  )\n]);\n''');\n    });\n\n    test('The generated execute fn could have input.', () {\n      final buffer = StringBuffer();\n      final definition =\n          LibraryDefinition(basename: r'test_query.graphql', queries: [\n        QueryDefinition(\n          name: QueryName(name: 'test_query'),\n          operationName: 'test_query',\n          document: parseString('query test_query {}'),\n          generateHelpers: true,\n          inputs: [\n            QueryInput(\n                type: TypeName(name: 'Type'),\n                name: QueryInputName(name: 'name'))\n          ],\n        ),\n      ]);\n      final ignoreForFile = <String>[];\n\n      writeLibraryDefinitionToBuffer(buffer, ignoreForFile, definition);\n\n      expect(buffer.toString(), r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'test_query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass TestQueryArguments extends JsonSerializable with EquatableMixin {\n  TestQueryArguments({this.name});\n\n  @override\n  factory TestQueryArguments.fromJson(Map<String, dynamic> json) =>\n      _$TestQueryArgumentsFromJson(json);\n\n  final Type? name;\n\n  @override\n  List<Object?> get props => [name];\n  @override\n  Map<String, dynamic> toJson() => _$TestQueryArgumentsToJson(this);\n}\n\nfinal TEST_QUERY_QUERY_DOCUMENT_OPERATION_NAME = 'test_query';\nfinal TEST_QUERY_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'test_query'),\n    variableDefinitions: [],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: []),\n  )\n]);\n\nclass TestQueryQuery extends GraphQLQuery<TestQuery, TestQueryArguments> {\n  TestQueryQuery({required this.variables});\n\n  @override\n  final DocumentNode document = TEST_QUERY_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = TEST_QUERY_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final TestQueryArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  TestQuery parse(Map<String, dynamic> json) => TestQuery.fromJson(json);\n}\n''');\n    });\n\n    test('Will generate an Arguments class', () {\n      final definition = QueryDefinition(\n        name: QueryName(name: 'test_query'),\n        operationName: 'test_query',\n        document: parseString('query test_query {}'),\n        generateHelpers: true,\n        inputs: [\n          QueryInput(\n              type: TypeName(name: 'Type'), name: QueryInputName(name: 'name'))\n        ],\n      );\n\n      final str = specToString(generateArgumentClassSpec(definition));\n\n      expect(str, '''@JsonSerializable(explicitToJson: true)\nclass TestQueryArguments extends JsonSerializable with EquatableMixin {\n  TestQueryArguments({this.name});\n\n  @override\n  factory TestQueryArguments.fromJson(Map<String, dynamic> json) =>\n      _\\$TestQueryArgumentsFromJson(json);\n\n  final Type? name;\n\n  @override\n  List<Object?> get props => [name];\n  @override\n  Map<String, dynamic> toJson() => _\\$TestQueryArgumentsToJson(this);\n}\n''');\n    });\n\n    test('Will generate a Query Class', () {\n      final definition = QueryDefinition(\n        name: QueryName(name: 'test_query'),\n        operationName: 'test_query',\n        document: parseString('query test_query {}'),\n        generateHelpers: true,\n        inputs: [\n          QueryInput(\n              type: TypeName(name: 'Type'), name: QueryInputName(name: 'name'))\n        ],\n        suffix: 'Query',\n      );\n\n      final str = specToString(generateQuerySpec(definition)) +\n          specToString(generateQueryClassSpec(definition));\n\n      expect(str,\n          r'''final TEST_QUERY_QUERY_DOCUMENT_OPERATION_NAME = 'test_query';\nfinal TEST_QUERY_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'test_query'),\n    variableDefinitions: [],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: []),\n  )\n]);\nclass TestQueryQuery extends GraphQLQuery<TestQuery, TestQueryArguments> {\n  TestQueryQuery({required this.variables});\n\n  @override\n  final DocumentNode document = TEST_QUERY_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = TEST_QUERY_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final TestQueryArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  TestQuery parse(Map<String, dynamic> json) => TestQuery.fromJson(json);\n}\n''');\n    });\n\n    test('It will accept and write class/enum definitions.', () {\n      final buffer = StringBuffer();\n      final definition =\n          LibraryDefinition(basename: r'test_query.graphql', queries: [\n        QueryDefinition(\n          name: QueryName(name: 'test_query'),\n          operationName: 'test_query',\n          document: parseString('query test_query {}'),\n          classes: [\n            EnumDefinition(name: EnumName(name: 'SomeEnum'), values: [\n              EnumValueDefinition(\n                name: EnumValueName(name: 'Value'),\n              )\n            ]),\n            ClassDefinition(name: ClassName(name: 'AClass'), properties: [])\n          ],\n        ),\n      ]);\n      final ignoreForFile = <String>[];\n\n      writeLibraryDefinitionToBuffer(buffer, ignoreForFile, definition);\n\n      expect(buffer.toString(), '''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'test_query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass AClass extends JsonSerializable with EquatableMixin {\n  AClass();\n\n  factory AClass.fromJson(Map<String, dynamic> json) => _\\$AClassFromJson(json);\n\n  @override\n  List<Object?> get props => [];\n  @override\n  Map<String, dynamic> toJson() => _\\$AClassToJson(this);\n}\n\nenum SomeEnum {\n  @JsonValue('Value')\n  value,\n}\n''');\n    });\n  });\n\n  test('Should not add ignore_for_file when ignoreForFile is null', () {\n    final buffer = StringBuffer();\n    final definition = LibraryDefinition(basename: r'test_query.graphql');\n    final ignoreForFile = <String>[];\n\n    writeLibraryDefinitionToBuffer(buffer, ignoreForFile, definition);\n\n    expect(buffer.toString(), '''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'test_query.graphql.g.dart';\n''');\n  });\n\n  test('Should not add ignore_for_file when ignoreForFile is empty', () {\n    final buffer = StringBuffer();\n    final definition = LibraryDefinition(basename: r'test_query.graphql');\n    final ignoreForFile = <String>[];\n\n    writeLibraryDefinitionToBuffer(buffer, ignoreForFile, definition);\n\n    expect(buffer.toString(), '''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'test_query.graphql.g.dart';\n''');\n  });\n\n  test('Should add // ignore_for_file: ... when ignoreForFile is not empty',\n      () {\n    final buffer = StringBuffer();\n    final definition = LibraryDefinition(basename: r'test_query.graphql');\n    final ignoreForFile = <String>['my_rule_1', 'my_rule_2'];\n\n    writeLibraryDefinitionToBuffer(buffer, ignoreForFile, definition);\n\n    expect(buffer.toString(), '''// GENERATED CODE - DO NOT MODIFY BY HAND\n// ignore_for_file: my_rule_1, my_rule_2\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'test_query.graphql.g.dart';\n''');\n  });\n}\n"
  },
  {
    "path": "test/helpers.dart",
    "content": "import 'package:artemis/builder.dart';\nimport 'package:artemis/generator/data/data.dart';\nimport 'package:build/build.dart';\nimport 'package:build_test/build_test.dart';\nimport 'package:logging/logging.dart';\nimport 'package:test/test.dart';\nimport 'package:collection/collection.dart';\n\nfinal bool Function(Iterable, Iterable) listEquals =\n    const DeepCollectionEquality.unordered().equals;\n\nFuture testGenerator({\n  required String query,\n  required LibraryDefinition libraryDefinition,\n  required String generatedFile,\n  required String schema,\n  String namingScheme = 'pathedWithTypes',\n  bool appendTypeName = false,\n  bool generateHelpers = false,\n  bool generateQueries = false,\n  Map<String, dynamic> builderOptionsMap = const {},\n  Map<String, Object> sourceAssetsMap = const {},\n  Map<String, Object> outputsMap = const {},\n}) async {\n  Logger.root.level = Level.INFO;\n\n  final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n    if (!generateHelpers) 'generate_helpers': false,\n    if (!generateQueries) 'generate_queries': false,\n    'schema_mapping': [\n      {\n        'schema': 'api.schema.graphql',\n        'queries_glob': 'queries/**.graphql',\n        'output': 'lib/query.graphql.dart',\n        'naming_scheme': namingScheme,\n        'append_type_name': appendTypeName,\n      }\n    ],\n    ...builderOptionsMap,\n  }));\n\n  anotherBuilder.onBuild = expectAsync1((definition) {\n    log.fine(definition);\n    expect(definition, libraryDefinition);\n  }, count: 1);\n\n  return await testBuilder(\n    anotherBuilder,\n    {\n      'a|api.schema.graphql': schema,\n      'a|queries/query.graphql': query,\n      ...sourceAssetsMap,\n    },\n    outputs: {\n      'a|lib/query.graphql.dart': generatedFile,\n      ...outputsMap,\n    },\n    onLog: print,\n  );\n}\n\nFuture testNaming({\n  required String query,\n  required String schema,\n  required List<String> expectedNames,\n  required String namingScheme,\n  bool shouldFail = false,\n}) {\n  final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n    'generate_helpers': false,\n    'generate_queries': false,\n    'schema_mapping': [\n      {\n        'schema': 'api.schema.graphql',\n        'queries_glob': 'queries/**.graphql',\n        'output': 'lib/query.dart',\n        'naming_scheme': namingScheme,\n      }\n    ],\n  }));\n\n  if (!shouldFail) {\n    anotherBuilder.onBuild = expectAsync1((definition) {\n      final names = definition.queries.first.classes\n          .map((e) => e.name.namePrintable)\n          .toSet();\n      log.fine(names);\n      expect(names.toSet(), equals(expectedNames.toSet()));\n    }, count: 1);\n  }\n\n  return testBuilder(\n    anotherBuilder,\n    {\n      'a|api.schema.graphql': schema,\n      'a|queries/query.graphql': query,\n    },\n    onLog: print,\n  );\n}\n"
  },
  {
    "path": "test/query_generator/aliases/alias_on_leaves_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On aliases', () {\n    test(\n      'Leaves can be aliased',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          schema {\n            query: Response\n          }\n\n          type Response {\n            s: String\n            o: SomeObject\n            ob: [SomeObject]\n          }\n\n          type SomeObject {\n            e: MyEnum\n          }\n          \n          enum MyEnum {\n            A\n            B\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nconst query = r'''\n        query some_query {\n          thisIsAString: s\n          o {\n            thisIsAnEnum: e\n          }\n        }\n        ''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'SomeQuery$_Response'),\n      operationName: r'some_query',\n      classes: [\n        EnumDefinition(name: EnumName(name: r'MyEnum'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'A')),\n          EnumValueDefinition(name: EnumValueName(name: r'B')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_Response$_SomeObject'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'MyEnum'),\n                  name: ClassPropertyName(name: r'thisIsAnEnum'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: MyEnum.artemisUnknown)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_Response'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'thisIsAString'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'SomeQuery$_Response$_SomeObject'),\n                  name: ClassPropertyName(name: r'o'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$Response$SomeObject extends JsonSerializable\n    with EquatableMixin {\n  SomeQuery$Response$SomeObject();\n\n  factory SomeQuery$Response$SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$Response$SomeObjectFromJson(json);\n\n  @JsonKey(unknownEnumValue: MyEnum.artemisUnknown)\n  MyEnum? thisIsAnEnum;\n\n  @override\n  List<Object?> get props => [thisIsAnEnum];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$Response$SomeObjectToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$Response extends JsonSerializable with EquatableMixin {\n  SomeQuery$Response();\n\n  factory SomeQuery$Response.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$ResponseFromJson(json);\n\n  String? thisIsAString;\n\n  SomeQuery$Response$SomeObject? o;\n\n  @override\n  List<Object?> get props => [thisIsAString, o];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$ResponseToJson(this);\n}\n\nenum MyEnum {\n  @JsonValue('A')\n  a,\n  @JsonValue('B')\n  b,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n''';\n"
  },
  {
    "path": "test/query_generator/aliases/alias_on_object_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On aliases', () {\n    test(\n      'Objects can be aliased',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          schema {\n            query: QueryResponse\n          }\n\n          type QueryResponse {\n            s: String\n            o: SomeObject\n            ob: [SomeObject]\n          }\n\n          type SomeObject {\n            st: String\n            str: String\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nconst query = r'''\n  query some_query {\n    s\n    o {\n      st\n    }\n    anotherObject: ob {\n      str\n    }\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'SomeQuery$_QueryResponse'),\n      operationName: r'some_query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_QueryResponse$_SomeObject'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'st'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_QueryResponse$_anotherObject'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'str'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_QueryResponse'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'SomeQuery$_QueryResponse$_SomeObject'),\n                  name: ClassPropertyName(name: r'o'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: TypeName(\n                          name: r'SomeQuery$_QueryResponse$_anotherObject'),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'anotherObject'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$QueryResponse$SomeObject extends JsonSerializable\n    with EquatableMixin {\n  SomeQuery$QueryResponse$SomeObject();\n\n  factory SomeQuery$QueryResponse$SomeObject.fromJson(\n          Map<String, dynamic> json) =>\n      _$SomeQuery$QueryResponse$SomeObjectFromJson(json);\n\n  String? st;\n\n  @override\n  List<Object?> get props => [st];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$SomeQuery$QueryResponse$SomeObjectToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$QueryResponse$AnotherObject extends JsonSerializable\n    with EquatableMixin {\n  SomeQuery$QueryResponse$AnotherObject();\n\n  factory SomeQuery$QueryResponse$AnotherObject.fromJson(\n          Map<String, dynamic> json) =>\n      _$SomeQuery$QueryResponse$AnotherObjectFromJson(json);\n\n  String? str;\n\n  @override\n  List<Object?> get props => [str];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$SomeQuery$QueryResponse$AnotherObjectToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$QueryResponse extends JsonSerializable with EquatableMixin {\n  SomeQuery$QueryResponse();\n\n  factory SomeQuery$QueryResponse.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$QueryResponseFromJson(json);\n\n  String? s;\n\n  SomeQuery$QueryResponse$SomeObject? o;\n\n  List<SomeQuery$QueryResponse$AnotherObject?>? anotherObject;\n\n  @override\n  List<Object?> get props => [s, o, anotherObject];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$QueryResponseToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/append_type_name_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../helpers.dart';\n\nvoid main() {\n  group('On query generation', () {\n    test(\n        'Appends typename',\n        () async => testGenerator(\n            appendTypeName: true,\n            namingScheme: 'pathedWithFields',\n            query: r'''\n              query custom {\n                q {\n                  e\n                }\n              }\n            ''',\n            schema: r'''\n            schema {\n              query: QueryRoot\n            }\n            \n            type QueryRoot {\n              q: QueryResponse\n            }\n            \n            type QueryResponse {\n              e: String\n            }\n            ''',\n            libraryDefinition:\n                LibraryDefinition(basename: r'query.graphql', queries: [\n              QueryDefinition(\n                  name: QueryName(name: r'Custom$_QueryRoot'),\n                  operationName: r'custom',\n                  classes: [\n                    ClassDefinition(\n                        name: ClassName(name: r'Custom$_QueryRoot$_q'),\n                        properties: [\n                          ClassProperty(\n                              type: DartTypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'e'),\n                              isResolveType: false),\n                          ClassProperty(\n                              type: TypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'__typename'),\n                              annotations: [r'''JsonKey(name: '__typename')'''],\n                              isResolveType: true)\n                        ],\n                        factoryPossibilities: {},\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false),\n                    ClassDefinition(\n                        name: ClassName(name: r'Custom$_QueryRoot'),\n                        properties: [\n                          ClassProperty(\n                              type: TypeName(name: r'Custom$_QueryRoot$_q'),\n                              name: ClassPropertyName(name: r'q'),\n                              isResolveType: false),\n                          ClassProperty(\n                              type: TypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'__typename'),\n                              annotations: [r'''JsonKey(name: '__typename')'''],\n                              isResolveType: true)\n                        ],\n                        factoryPossibilities: {},\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false)\n                  ],\n                  generateHelpers: false,\n                  suffix: r'Query')\n            ]),\n            generatedFile: r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot$Q extends JsonSerializable with EquatableMixin {\n  Custom$QueryRoot$Q();\n\n  factory Custom$QueryRoot$Q.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRoot$QFromJson(json);\n\n  String? e;\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [e, $$typename];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRoot$QToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot extends JsonSerializable with EquatableMixin {\n  Custom$QueryRoot();\n\n  factory Custom$QueryRoot.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRootFromJson(json);\n\n  Custom$QueryRoot$Q? q;\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [q, $$typename];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRootToJson(this);\n}\n''',\n            generateHelpers: false));\n\n    test(\n        'Do not appends typename if it exist',\n        () async => testGenerator(\n            appendTypeName: true,\n            namingScheme: 'pathedWithFields',\n            query: r'''\n              query custom {\n                q {\n                  e\n                  __typename\n                }\n                __typename\n              }\n            ''',\n            schema: r'''\n            schema {\n              query: QueryRoot\n            }\n            \n            type QueryRoot {\n              q: QueryResponse\n            }\n            \n            type QueryResponse {\n              e: String\n            }\n            ''',\n            libraryDefinition:\n                LibraryDefinition(basename: r'query.graphql', queries: [\n              QueryDefinition(\n                  name: QueryName(name: r'Custom$_QueryRoot'),\n                  operationName: r'custom',\n                  classes: [\n                    ClassDefinition(\n                        name: ClassName(name: r'Custom$_QueryRoot$_q'),\n                        properties: [\n                          ClassProperty(\n                              type: DartTypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'e'),\n                              isResolveType: false),\n                          ClassProperty(\n                              type: TypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'__typename'),\n                              annotations: [r'''JsonKey(name: '__typename')'''],\n                              isResolveType: true)\n                        ],\n                        factoryPossibilities: {},\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false),\n                    ClassDefinition(\n                        name: ClassName(name: r'Custom$_QueryRoot'),\n                        properties: [\n                          ClassProperty(\n                              type: TypeName(name: r'Custom$_QueryRoot$_q'),\n                              name: ClassPropertyName(name: r'q'),\n                              isResolveType: false),\n                          ClassProperty(\n                              type: TypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'__typename'),\n                              annotations: [r'''JsonKey(name: '__typename')'''],\n                              isResolveType: true)\n                        ],\n                        factoryPossibilities: {},\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false)\n                  ],\n                  generateHelpers: false,\n                  suffix: r'Query')\n            ]),\n            generatedFile: r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot$Q extends JsonSerializable with EquatableMixin {\n  Custom$QueryRoot$Q();\n\n  factory Custom$QueryRoot$Q.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRoot$QFromJson(json);\n\n  String? e;\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [e, $$typename];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRoot$QToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot extends JsonSerializable with EquatableMixin {\n  Custom$QueryRoot();\n\n  factory Custom$QueryRoot.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRootFromJson(json);\n\n  Custom$QueryRoot$Q? q;\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [q, $$typename];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRootToJson(this);\n}\n''',\n            generateHelpers: false));\n\n    test(\n        'Appends typename on fragment',\n        () async => testGenerator(\n            appendTypeName: true,\n            namingScheme: 'pathedWithFields',\n            query: r'''\n              query custom {\n                q {\n                  ...QueryResponse\n                }\n              }\n              \n              fragment QueryResponse on QueryResponse {\n                e\n              }\n            ''',\n            schema: r'''\n            schema {\n              query: QueryRoot\n            }\n            \n            type QueryRoot {\n              q: QueryResponse\n            }\n            \n            type QueryResponse {\n              e: String\n            }\n            ''',\n            libraryDefinition:\n                LibraryDefinition(basename: r'query.graphql', queries: [\n              QueryDefinition(\n                  name: QueryName(name: r'Custom$_QueryRoot'),\n                  operationName: r'custom',\n                  classes: [\n                    ClassDefinition(\n                        name: ClassName(name: r'Custom$_QueryRoot$_q'),\n                        properties: [\n                          ClassProperty(\n                              type: TypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'__typename'),\n                              annotations: [r'''JsonKey(name: '__typename')'''],\n                              isResolveType: true)\n                        ],\n                        mixins: [FragmentName(name: r'QueryResponseMixin')],\n                        factoryPossibilities: {},\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false),\n                    ClassDefinition(\n                        name: ClassName(name: r'Custom$_QueryRoot'),\n                        properties: [\n                          ClassProperty(\n                              type: TypeName(name: r'Custom$_QueryRoot$_q'),\n                              name: ClassPropertyName(name: r'q'),\n                              isResolveType: false),\n                          ClassProperty(\n                              type: TypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'__typename'),\n                              annotations: [r'''JsonKey(name: '__typename')'''],\n                              isResolveType: true)\n                        ],\n                        factoryPossibilities: {},\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false),\n                    FragmentClassDefinition(\n                        name: FragmentName(name: r'QueryResponseMixin'),\n                        properties: [\n                          ClassProperty(\n                              type: DartTypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'e'),\n                              isResolveType: false),\n                          ClassProperty(\n                              type: TypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'__typename'),\n                              annotations: [r'''JsonKey(name: '__typename')'''],\n                              isResolveType: true)\n                        ])\n                  ],\n                  generateHelpers: false,\n                  suffix: r'Query')\n            ]),\n            generatedFile: r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\nmixin QueryResponseMixin {\n  String? e;\n  @JsonKey(name: '__typename')\n  String? $$typename;\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot$Q extends JsonSerializable\n    with EquatableMixin, QueryResponseMixin {\n  Custom$QueryRoot$Q();\n\n  factory Custom$QueryRoot$Q.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRoot$QFromJson(json);\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [e, $$typename];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRoot$QToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot extends JsonSerializable with EquatableMixin {\n  Custom$QueryRoot();\n\n  factory Custom$QueryRoot.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRootFromJson(json);\n\n  Custom$QueryRoot$Q? q;\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [q, $$typename];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRootToJson(this);\n}\n''',\n            generateHelpers: false));\n\n    test(\n        'Appends typename on union',\n        () async => testGenerator(\n            appendTypeName: true,\n            namingScheme: 'pathedWithFields',\n            query: r'''\n              query custom {\n                q {\n                  ... on TypeA { \n                    a\n                  }, \n                  ... on TypeB { \n                    b\n                  }\n                }\n              }\n            ''',\n            schema: r'''\n            schema {\n              query: QueryRoot\n            }\n            \n            type QueryRoot {\n              q: SomeUnion\n            }\n            \n            union SomeUnion = TypeA | TypeB\n            \n            type TypeA {\n              a: Int\n            }\n            \n            type TypeB {\n              b: Int\n            }\n            ''',\n            libraryDefinition:\n                LibraryDefinition(basename: r'query.graphql', queries: [\n              QueryDefinition(\n                  name: QueryName(name: r'Custom$_QueryRoot'),\n                  operationName: r'custom',\n                  classes: [\n                    ClassDefinition(\n                        name: ClassName(name: r'Custom$_QueryRoot$_q$_typeA'),\n                        properties: [\n                          ClassProperty(\n                              type: DartTypeName(name: r'int'),\n                              name: ClassPropertyName(name: r'a'),\n                              isResolveType: false),\n                          ClassProperty(\n                              type: TypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'__typename'),\n                              annotations: [r'''JsonKey(name: '__typename')'''],\n                              isResolveType: true)\n                        ],\n                        extension: ClassName(name: r'Custom$_QueryRoot$_q'),\n                        factoryPossibilities: {},\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false),\n                    ClassDefinition(\n                        name: ClassName(name: r'Custom$_QueryRoot$_q$_typeB'),\n                        properties: [\n                          ClassProperty(\n                              type: DartTypeName(name: r'int'),\n                              name: ClassPropertyName(name: r'b'),\n                              isResolveType: false),\n                          ClassProperty(\n                              type: TypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'__typename'),\n                              annotations: [r'''JsonKey(name: '__typename')'''],\n                              isResolveType: true)\n                        ],\n                        extension: ClassName(name: r'Custom$_QueryRoot$_q'),\n                        factoryPossibilities: {},\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false),\n                    ClassDefinition(\n                        name: ClassName(name: r'Custom$_QueryRoot$_q'),\n                        properties: [\n                          ClassProperty(\n                              type: TypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'__typename'),\n                              annotations: [r'''JsonKey(name: '__typename')'''],\n                              isResolveType: true)\n                        ],\n                        factoryPossibilities: {\n                          r'TypeA':\n                              ClassName(name: r'Custom$_QueryRoot$_q$_TypeA'),\n                          r'TypeB':\n                              ClassName(name: r'Custom$_QueryRoot$_q$_TypeB')\n                        },\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false),\n                    ClassDefinition(\n                        name: ClassName(name: r'Custom$_QueryRoot'),\n                        properties: [\n                          ClassProperty(\n                              type: TypeName(name: r'Custom$_QueryRoot$_q'),\n                              name: ClassPropertyName(name: r'q'),\n                              isResolveType: false),\n                          ClassProperty(\n                              type: TypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'__typename'),\n                              annotations: [r'''JsonKey(name: '__typename')'''],\n                              isResolveType: true)\n                        ],\n                        factoryPossibilities: {},\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false)\n                  ],\n                  generateHelpers: false,\n                  suffix: r'Query')\n            ]),\n            generatedFile: r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot$Q$TypeA extends Custom$QueryRoot$Q with EquatableMixin {\n  Custom$QueryRoot$Q$TypeA();\n\n  factory Custom$QueryRoot$Q$TypeA.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRoot$Q$TypeAFromJson(json);\n\n  int? a;\n\n  @JsonKey(name: '__typename')\n  @override\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [a, $$typename];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRoot$Q$TypeAToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot$Q$TypeB extends Custom$QueryRoot$Q with EquatableMixin {\n  Custom$QueryRoot$Q$TypeB();\n\n  factory Custom$QueryRoot$Q$TypeB.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRoot$Q$TypeBFromJson(json);\n\n  int? b;\n\n  @JsonKey(name: '__typename')\n  @override\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [b, $$typename];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRoot$Q$TypeBToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot$Q extends JsonSerializable with EquatableMixin {\n  Custom$QueryRoot$Q();\n\n  factory Custom$QueryRoot$Q.fromJson(Map<String, dynamic> json) {\n    switch (json['__typename'].toString()) {\n      case r'TypeA':\n        return Custom$QueryRoot$Q$TypeA.fromJson(json);\n      case r'TypeB':\n        return Custom$QueryRoot$Q$TypeB.fromJson(json);\n      default:\n    }\n    return _$Custom$QueryRoot$QFromJson(json);\n  }\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [$$typename];\n  @override\n  Map<String, dynamic> toJson() {\n    switch ($$typename) {\n      case r'TypeA':\n        return (this as Custom$QueryRoot$Q$TypeA).toJson();\n      case r'TypeB':\n        return (this as Custom$QueryRoot$Q$TypeB).toJson();\n      default:\n    }\n    return _$Custom$QueryRoot$QToJson(this);\n  }\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot extends JsonSerializable with EquatableMixin {\n  Custom$QueryRoot();\n\n  factory Custom$QueryRoot.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRootFromJson(json);\n\n  Custom$QueryRoot$Q? q;\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [q, $$typename];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRootToJson(this);\n}\n''',\n            generateHelpers: false));\n\n    test(\n      'Appends typename to common fragments',\n      () async => testGenerator(\n        appendTypeName: true,\n        query: r'''\n          query custom {\n            q {\n              ...QueryResponse\n            }\n          }\n        ''',\n        schema: r'''\n          schema {\n            query: QueryRoot\n          }\n          \n          type QueryRoot {\n            q: QueryResponse\n          }\n          \n          type QueryResponse {\n            e: String\n          }\n        ''',\n        libraryDefinition:\n            LibraryDefinition(basename: r'query.graphql', queries: [\n          QueryDefinition(\n              name: QueryName(name: r'Custom$_QueryRoot'),\n              operationName: r'custom',\n              classes: [\n                ClassDefinition(\n                    name: ClassName(name: r'Custom$_QueryRoot$_QueryResponse'),\n                    properties: [\n                      ClassProperty(\n                          type: TypeName(name: r'String'),\n                          name: ClassPropertyName(name: r'__typename'),\n                          annotations: [r'''JsonKey(name: '__typename')'''],\n                          isResolveType: true)\n                    ],\n                    mixins: [FragmentName(name: r'QueryResponseMixin')],\n                    factoryPossibilities: {},\n                    typeNameField: ClassPropertyName(name: r'__typename'),\n                    isInput: false),\n                ClassDefinition(\n                    name: ClassName(name: r'Custom$_QueryRoot'),\n                    properties: [\n                      ClassProperty(\n                          type: TypeName(\n                              name: r'Custom$_QueryRoot$_QueryResponse'),\n                          name: ClassPropertyName(name: r'q'),\n                          isResolveType: false),\n                      ClassProperty(\n                          type: TypeName(name: r'String'),\n                          name: ClassPropertyName(name: r'__typename'),\n                          annotations: [r'''JsonKey(name: '__typename')'''],\n                          isResolveType: true)\n                    ],\n                    factoryPossibilities: {},\n                    typeNameField: ClassPropertyName(name: r'__typename'),\n                    isInput: false),\n                FragmentClassDefinition(\n                    name: FragmentName(name: r'QueryResponseMixin'),\n                    properties: [\n                      ClassProperty(\n                          type: DartTypeName(name: r'String'),\n                          name: ClassPropertyName(name: r'e'),\n                          isResolveType: false),\n                      ClassProperty(\n                          type: TypeName(name: r'String'),\n                          name: ClassPropertyName(name: r'__typename'),\n                          annotations: [r'''JsonKey(name: '__typename')'''],\n                          isResolveType: true)\n                    ])\n              ],\n              generateHelpers: true,\n              suffix: r'Query')\n        ]),\n        generatedFile: r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\nmixin QueryResponseMixin {\n  String? e;\n  @JsonKey(name: '__typename')\n  String? $$typename;\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot$QueryResponse extends JsonSerializable\n    with EquatableMixin, QueryResponseMixin {\n  Custom$QueryRoot$QueryResponse();\n\n  factory Custom$QueryRoot$QueryResponse.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRoot$QueryResponseFromJson(json);\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [e, $$typename];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRoot$QueryResponseToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot extends JsonSerializable with EquatableMixin {\n  Custom$QueryRoot();\n\n  factory Custom$QueryRoot.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRootFromJson(json);\n\n  Custom$QueryRoot$QueryResponse? q;\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [q, $$typename];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRootToJson(this);\n}\n\nfinal CUSTOM_QUERY_DOCUMENT_OPERATION_NAME = 'custom';\nfinal CUSTOM_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'custom'),\n    variableDefinitions: [],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'q'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FragmentSpreadNode(\n            name: NameNode(value: 'QueryResponse'),\n            directives: [],\n          ),\n          FieldNode(\n            name: NameNode(value: '__typename'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n        ]),\n      ),\n      FieldNode(\n        name: NameNode(value: '__typename'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      ),\n    ]),\n  ),\n  FragmentDefinitionNode(\n    name: NameNode(value: 'QueryResponse'),\n    typeCondition: TypeConditionNode(\n        on: NamedTypeNode(\n      name: NameNode(value: 'QueryResponse'),\n      isNonNull: false,\n    )),\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'e'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      ),\n      FieldNode(\n        name: NameNode(value: '__typename'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      ),\n    ]),\n  ),\n]);\n\nclass CustomQuery extends GraphQLQuery<Custom$QueryRoot, JsonSerializable> {\n  CustomQuery();\n\n  @override\n  final DocumentNode document = CUSTOM_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = CUSTOM_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  List<Object?> get props => [document, operationName];\n  @override\n  Custom$QueryRoot parse(Map<String, dynamic> json) =>\n      Custom$QueryRoot.fromJson(json);\n}\n''',\n        builderOptionsMap: {'fragments_glob': '**.frag'},\n        sourceAssetsMap: {\n          'a|fragment.frag': r'''\n          fragment QueryResponse on QueryResponse {\n            e\n          }\n        '''\n        },\n        generateHelpers: true,\n      ),\n    );\n  });\n}\n"
  },
  {
    "path": "test/query_generator/ast_schema/field_not_found_mutation_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On AST schema', () {\n    test(\n      'Field was not found on mutation',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          schema {\n            mutation: MutationRoot\n          }\n\n          input CreateThingInput {\n            clientId: ID!\n            message: String\n          }\n\n          type Thing {\n            id: ID!\n            message: String\n          }\n\n          type CreateThingResponse {\n            thing: Thing\n          }\n\n          type MutationRoot {\n            createThing(input: CreateThingInput): CreateThingResponse\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nconst query = r'''\nmutation createThing($createThingInput: CreateThingInput) {\n  createThing(input: $createThingInput) {\n    thing {\n      id\n      message\n    }\n  }\n}\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'CreateThing$_MutationRoot'),\n      operationName: r'createThing',\n      classes: [\n        ClassDefinition(\n            name: ClassName(\n                name: r'CreateThing$_MutationRoot$_CreateThingResponse$_Thing'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'message'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(\n                name: r'CreateThing$_MutationRoot$_CreateThingResponse'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(\n                      name:\n                          r'CreateThing$_MutationRoot$_CreateThingResponse$_Thing'),\n                  name: ClassPropertyName(name: r'thing'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'CreateThing$_MutationRoot'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(\n                      name: r'CreateThing$_MutationRoot$_CreateThingResponse'),\n                  name: ClassPropertyName(name: r'createThing'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'CreateThingInput'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'clientId'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'message'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: TypeName(name: r'CreateThingInput'),\n            name: QueryInputName(name: r'createThingInput'))\n      ],\n      generateHelpers: false,\n      suffix: r'Mutation')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass CreateThing$MutationRoot$CreateThingResponse$Thing\n    extends JsonSerializable with EquatableMixin {\n  CreateThing$MutationRoot$CreateThingResponse$Thing();\n\n  factory CreateThing$MutationRoot$CreateThingResponse$Thing.fromJson(\n          Map<String, dynamic> json) =>\n      _$CreateThing$MutationRoot$CreateThingResponse$ThingFromJson(json);\n\n  late String id;\n\n  String? message;\n\n  @override\n  List<Object?> get props => [id, message];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$CreateThing$MutationRoot$CreateThingResponse$ThingToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CreateThing$MutationRoot$CreateThingResponse extends JsonSerializable\n    with EquatableMixin {\n  CreateThing$MutationRoot$CreateThingResponse();\n\n  factory CreateThing$MutationRoot$CreateThingResponse.fromJson(\n          Map<String, dynamic> json) =>\n      _$CreateThing$MutationRoot$CreateThingResponseFromJson(json);\n\n  CreateThing$MutationRoot$CreateThingResponse$Thing? thing;\n\n  @override\n  List<Object?> get props => [thing];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$CreateThing$MutationRoot$CreateThingResponseToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CreateThing$MutationRoot extends JsonSerializable with EquatableMixin {\n  CreateThing$MutationRoot();\n\n  factory CreateThing$MutationRoot.fromJson(Map<String, dynamic> json) =>\n      _$CreateThing$MutationRootFromJson(json);\n\n  CreateThing$MutationRoot$CreateThingResponse? createThing;\n\n  @override\n  List<Object?> get props => [createThing];\n  @override\n  Map<String, dynamic> toJson() => _$CreateThing$MutationRootToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CreateThingInput extends JsonSerializable with EquatableMixin {\n  CreateThingInput({\n    required this.clientId,\n    this.message,\n  });\n\n  factory CreateThingInput.fromJson(Map<String, dynamic> json) =>\n      _$CreateThingInputFromJson(json);\n\n  late String clientId;\n\n  String? message;\n\n  @override\n  List<Object?> get props => [clientId, message];\n  @override\n  Map<String, dynamic> toJson() => _$CreateThingInputToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/ast_schema/input_types_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On AST schema', () {\n    test(\n      'Input object was not generated',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          schema {\n            mutation: MutationRoot\n          }\n\n          input OtherObjectInput {\n            id: ID!\n          }\n\n          input CreateThingInput {\n            clientId: ID!\n            message: String\n            shares: [OtherObjectInput!]\n          }\n\n          type Thing {\n            id: ID!\n            message: String\n          }\n\n          type CreateThingResponse {\n            thing: Thing\n          }\n\n          type MutationRoot {\n            createThing(input: CreateThingInput): CreateThingResponse\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nconst query = r'''\nmutation createThing($createThingInput: CreateThingInput) {\n  createThing(input: $createThingInput) {\n    thing {\n      id\n      message\n    }\n  }\n}\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'CreateThing$_MutationRoot'),\n      operationName: r'createThing',\n      classes: [\n        ClassDefinition(\n            name: ClassName(\n                name: r'CreateThing$_MutationRoot$_CreateThingResponse$_Thing'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'message'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(\n                name: r'CreateThing$_MutationRoot$_CreateThingResponse'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(\n                      name:\n                          r'CreateThing$_MutationRoot$_CreateThingResponse$_Thing'),\n                  name: ClassPropertyName(name: r'thing'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'CreateThing$_MutationRoot'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(\n                      name: r'CreateThing$_MutationRoot$_CreateThingResponse'),\n                  name: ClassPropertyName(name: r'createThing'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'CreateThingInput'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'clientId'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'message'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName:\n                          TypeName(name: r'OtherObjectInput', isNonNull: true),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'shares'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true),\n        ClassDefinition(\n            name: ClassName(name: r'OtherObjectInput'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: TypeName(name: r'CreateThingInput'),\n            name: QueryInputName(name: r'createThingInput'))\n      ],\n      generateHelpers: false,\n      suffix: r'Mutation')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass CreateThing$MutationRoot$CreateThingResponse$Thing\n    extends JsonSerializable with EquatableMixin {\n  CreateThing$MutationRoot$CreateThingResponse$Thing();\n\n  factory CreateThing$MutationRoot$CreateThingResponse$Thing.fromJson(\n          Map<String, dynamic> json) =>\n      _$CreateThing$MutationRoot$CreateThingResponse$ThingFromJson(json);\n\n  late String id;\n\n  String? message;\n\n  @override\n  List<Object?> get props => [id, message];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$CreateThing$MutationRoot$CreateThingResponse$ThingToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CreateThing$MutationRoot$CreateThingResponse extends JsonSerializable\n    with EquatableMixin {\n  CreateThing$MutationRoot$CreateThingResponse();\n\n  factory CreateThing$MutationRoot$CreateThingResponse.fromJson(\n          Map<String, dynamic> json) =>\n      _$CreateThing$MutationRoot$CreateThingResponseFromJson(json);\n\n  CreateThing$MutationRoot$CreateThingResponse$Thing? thing;\n\n  @override\n  List<Object?> get props => [thing];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$CreateThing$MutationRoot$CreateThingResponseToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CreateThing$MutationRoot extends JsonSerializable with EquatableMixin {\n  CreateThing$MutationRoot();\n\n  factory CreateThing$MutationRoot.fromJson(Map<String, dynamic> json) =>\n      _$CreateThing$MutationRootFromJson(json);\n\n  CreateThing$MutationRoot$CreateThingResponse? createThing;\n\n  @override\n  List<Object?> get props => [createThing];\n  @override\n  Map<String, dynamic> toJson() => _$CreateThing$MutationRootToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CreateThingInput extends JsonSerializable with EquatableMixin {\n  CreateThingInput({\n    required this.clientId,\n    this.message,\n    this.shares,\n  });\n\n  factory CreateThingInput.fromJson(Map<String, dynamic> json) =>\n      _$CreateThingInputFromJson(json);\n\n  late String clientId;\n\n  String? message;\n\n  List<OtherObjectInput>? shares;\n\n  @override\n  List<Object?> get props => [clientId, message, shares];\n  @override\n  Map<String, dynamic> toJson() => _$CreateThingInputToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass OtherObjectInput extends JsonSerializable with EquatableMixin {\n  OtherObjectInput({required this.id});\n\n  factory OtherObjectInput.fromJson(Map<String, dynamic> json) =>\n      _$OtherObjectInputFromJson(json);\n\n  late String id;\n\n  @override\n  List<Object?> get props => [id];\n  @override\n  Map<String, dynamic> toJson() => _$OtherObjectInputToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/ast_schema/missing_schema_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On AST schema', () {\n    test(\n      'When schema declaration is missing',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          type Query {\n            a: String\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nconst query = r'''\nquery {\n  a\n}\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Query$_Query'),\n      operationName: r'query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Query$_Query'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'a'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Query$Query extends JsonSerializable with EquatableMixin {\n  Query$Query();\n\n  factory Query$Query.fromJson(Map<String, dynamic> json) =>\n      _$Query$QueryFromJson(json);\n\n  String? a;\n\n  @override\n  List<Object?> get props => [a];\n  @override\n  Map<String, dynamic> toJson() => _$Query$QueryToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/ast_schema/multiple_schema_mappint_test.dart",
    "content": "import 'package:artemis/builder.dart';\nimport 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:build/build.dart';\nimport 'package:build_test/build_test.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  group('Multiple schema mapping', () {\n    test(\n      'Should search for definitions in correct schema',\n      () async {\n        final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n          'generate_helpers': true,\n          'schema_mapping': [\n            {\n              'schema': 'schemaA.graphql',\n              'queries_glob': 'queries/queryA.graphql',\n              'output': 'lib/outputA.graphql.dart',\n              'naming_scheme': 'pathedWithFields',\n            },\n            {\n              'schema': 'schemaB.graphql',\n              'queries_glob': 'queries/queryB.graphql',\n              'output': 'lib/outputB.graphql.dart',\n              'naming_scheme': 'pathedWithFields',\n            }\n          ],\n        }));\n\n        var count = 0;\n        anotherBuilder.onBuild = expectAsync1((definition) {\n          log.fine(definition);\n          if (count == 0) {\n            expect(definition, libraryDefinitionA);\n          }\n\n          if (count == 1) {\n            expect(definition, libraryDefinitionB);\n          }\n\n          count++;\n        }, count: 2);\n\n        return await testBuilder(\n          anotherBuilder,\n          {\n            'a|schemaA.graphql': schemaA,\n            'a|schemaB.graphql': schemaB,\n            'a|queries/queryA.graphql': queryA,\n            'a|queries/queryB.graphql': queryB,\n          },\n          outputs: {\n            'a|lib/outputA.graphql.dart': generatedFileA,\n            'a|lib/outputB.graphql.dart': generatedFileB,\n          },\n          onLog: print,\n        );\n      },\n    );\n  });\n}\n\nconst schemaA = r'''\n  schema {\n    query: Query\n  }\n  \n  type Query {\n      articles: [Article!]\n  }\n  \n  type Article {\n    id: ID!\n    title: String!\n    articleType: ArticleType!\n  }\n  \n  enum ArticleType {\n    NEWS\n    TUTORIAL\n  }\n''';\n\nconst schemaB = r'''\n  schema {\n    query: Query\n  }\n  \n  type Query {\n      repositories(notificationTypes: [NotificationOptionInput]): [Repository!]\n  }\n  \n  type Repository {\n    id: ID!\n    title: String!\n    privacy: Privacy!\n    status: Status!\n  }\n  \n  enum Privacy {\n    PRIVATE\n    PUBLIC\n  }\n  \n  enum Status {\n    ARCHIVED\n    NORMAL\n  }\n  \n  input NotificationOptionInput {\n    type: NotificationType\n    enabled: Boolean\n  }\n  \n  enum NotificationType {\n    ACTIVITY_MESSAGE\n    ACTIVITY_REPLY\n    FOLLOWING\n    ACTIVITY_MENTION\n  }\n''';\n\nconst queryA = r'''\n  query BrowseArticles {\n    articles {\n        id\n        title\n        articleType\n    }\n  }\n''';\n\nconst queryB = r'''\n  query BrowseRepositories($notificationTypes: [NotificationOptionInput]) {\n    repositories(notificationTypes: $notificationTypes) {\n        id\n        title\n        privacy\n        status\n    }\n  }\n''';\n\nfinal LibraryDefinition libraryDefinitionA =\n    LibraryDefinition(basename: r'outputA.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'BrowseArticles$_Query'),\n      operationName: r'BrowseArticles',\n      classes: [\n        EnumDefinition(name: EnumName(name: r'ArticleType'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'NEWS')),\n          EnumValueDefinition(name: EnumValueName(name: r'TUTORIAL')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        ClassDefinition(\n            name: ClassName(name: r'BrowseArticles$_Query$_articles'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'title'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'ArticleType', isNonNull: true),\n                  name: ClassPropertyName(name: r'articleType'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: ArticleType.artemisUnknown)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'BrowseArticles$_Query'),\n            properties: [\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: TypeName(\n                          name: r'BrowseArticles$_Query$_articles',\n                          isNonNull: true),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'articles'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: true,\n      suffix: r'Query')\n]);\n\nfinal libraryDefinitionB =\n    LibraryDefinition(basename: r'outputB.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'BrowseRepositories$_Query'),\n      operationName: r'BrowseRepositories',\n      classes: [\n        EnumDefinition(name: EnumName(name: r'Privacy'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'PRIVATE')),\n          EnumValueDefinition(name: EnumValueName(name: r'PUBLIC')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        EnumDefinition(name: EnumName(name: r'Status'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'ARCHIVED')),\n          EnumValueDefinition(name: EnumValueName(name: r'NORMAL')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        EnumDefinition(name: EnumName(name: r'NotificationType'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'ACTIVITY_MESSAGE')),\n          EnumValueDefinition(name: EnumValueName(name: r'ACTIVITY_REPLY')),\n          EnumValueDefinition(name: EnumValueName(name: r'FOLLOWING')),\n          EnumValueDefinition(name: EnumValueName(name: r'ACTIVITY_MENTION')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        ClassDefinition(\n            name: ClassName(name: r'BrowseRepositories$_Query$_repositories'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'title'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'Privacy', isNonNull: true),\n                  name: ClassPropertyName(name: r'privacy'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: Privacy.artemisUnknown)'\n                  ],\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'Status', isNonNull: true),\n                  name: ClassPropertyName(name: r'status'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: Status.artemisUnknown)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'BrowseRepositories$_Query'),\n            properties: [\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: TypeName(\n                          name: r'BrowseRepositories$_Query$_repositories',\n                          isNonNull: true),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'repositories'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'NotificationOptionInput'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'NotificationType'),\n                  name: ClassPropertyName(name: r'type'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: NotificationType.artemisUnknown)'\n                  ],\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'bool'),\n                  name: ClassPropertyName(name: r'enabled'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: ListOfTypeName(\n                typeName: TypeName(name: r'NotificationOptionInput'),\n                isNonNull: false),\n            name: QueryInputName(name: r'notificationTypes'))\n      ],\n      generateHelpers: true,\n      suffix: r'Query')\n]);\n\nconst generatedFileA = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'outputA.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass BrowseArticles$Query$Articles extends JsonSerializable\n    with EquatableMixin {\n  BrowseArticles$Query$Articles();\n\n  factory BrowseArticles$Query$Articles.fromJson(Map<String, dynamic> json) =>\n      _$BrowseArticles$Query$ArticlesFromJson(json);\n\n  late String id;\n\n  late String title;\n\n  @JsonKey(unknownEnumValue: ArticleType.artemisUnknown)\n  late ArticleType articleType;\n\n  @override\n  List<Object?> get props => [id, title, articleType];\n  @override\n  Map<String, dynamic> toJson() => _$BrowseArticles$Query$ArticlesToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass BrowseArticles$Query extends JsonSerializable with EquatableMixin {\n  BrowseArticles$Query();\n\n  factory BrowseArticles$Query.fromJson(Map<String, dynamic> json) =>\n      _$BrowseArticles$QueryFromJson(json);\n\n  List<BrowseArticles$Query$Articles>? articles;\n\n  @override\n  List<Object?> get props => [articles];\n  @override\n  Map<String, dynamic> toJson() => _$BrowseArticles$QueryToJson(this);\n}\n\nenum ArticleType {\n  @JsonValue('NEWS')\n  news,\n  @JsonValue('TUTORIAL')\n  tutorial,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n\nfinal BROWSE_ARTICLES_QUERY_DOCUMENT_OPERATION_NAME = 'BrowseArticles';\nfinal BROWSE_ARTICLES_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'BrowseArticles'),\n    variableDefinitions: [],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'articles'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 'id'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n          FieldNode(\n            name: NameNode(value: 'title'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n          FieldNode(\n            name: NameNode(value: 'articleType'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass BrowseArticlesQuery\n    extends GraphQLQuery<BrowseArticles$Query, JsonSerializable> {\n  BrowseArticlesQuery();\n\n  @override\n  final DocumentNode document = BROWSE_ARTICLES_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = BROWSE_ARTICLES_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  List<Object?> get props => [document, operationName];\n  @override\n  BrowseArticles$Query parse(Map<String, dynamic> json) =>\n      BrowseArticles$Query.fromJson(json);\n}\n''';\n\nconst generatedFileB = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'outputB.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass BrowseRepositories$Query$Repositories extends JsonSerializable\n    with EquatableMixin {\n  BrowseRepositories$Query$Repositories();\n\n  factory BrowseRepositories$Query$Repositories.fromJson(\n          Map<String, dynamic> json) =>\n      _$BrowseRepositories$Query$RepositoriesFromJson(json);\n\n  late String id;\n\n  late String title;\n\n  @JsonKey(unknownEnumValue: Privacy.artemisUnknown)\n  late Privacy privacy;\n\n  @JsonKey(unknownEnumValue: Status.artemisUnknown)\n  late Status status;\n\n  @override\n  List<Object?> get props => [id, title, privacy, status];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$BrowseRepositories$Query$RepositoriesToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass BrowseRepositories$Query extends JsonSerializable with EquatableMixin {\n  BrowseRepositories$Query();\n\n  factory BrowseRepositories$Query.fromJson(Map<String, dynamic> json) =>\n      _$BrowseRepositories$QueryFromJson(json);\n\n  List<BrowseRepositories$Query$Repositories>? repositories;\n\n  @override\n  List<Object?> get props => [repositories];\n  @override\n  Map<String, dynamic> toJson() => _$BrowseRepositories$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass NotificationOptionInput extends JsonSerializable with EquatableMixin {\n  NotificationOptionInput({\n    this.type,\n    this.enabled,\n  });\n\n  factory NotificationOptionInput.fromJson(Map<String, dynamic> json) =>\n      _$NotificationOptionInputFromJson(json);\n\n  @JsonKey(unknownEnumValue: NotificationType.artemisUnknown)\n  NotificationType? type;\n\n  bool? enabled;\n\n  @override\n  List<Object?> get props => [type, enabled];\n  @override\n  Map<String, dynamic> toJson() => _$NotificationOptionInputToJson(this);\n}\n\nenum Privacy {\n  @JsonValue('PRIVATE')\n  private,\n  @JsonValue('PUBLIC')\n  public,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n\nenum Status {\n  @JsonValue('ARCHIVED')\n  archived,\n  @JsonValue('NORMAL')\n  normal,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n\nenum NotificationType {\n  @JsonValue('ACTIVITY_MESSAGE')\n  activityMessage,\n  @JsonValue('ACTIVITY_REPLY')\n  activityReply,\n  @JsonValue('FOLLOWING')\n  following,\n  @JsonValue('ACTIVITY_MENTION')\n  activityMention,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n\n@JsonSerializable(explicitToJson: true)\nclass BrowseRepositoriesArguments extends JsonSerializable with EquatableMixin {\n  BrowseRepositoriesArguments({this.notificationTypes});\n\n  @override\n  factory BrowseRepositoriesArguments.fromJson(Map<String, dynamic> json) =>\n      _$BrowseRepositoriesArgumentsFromJson(json);\n\n  final List<NotificationOptionInput?>? notificationTypes;\n\n  @override\n  List<Object?> get props => [notificationTypes];\n  @override\n  Map<String, dynamic> toJson() => _$BrowseRepositoriesArgumentsToJson(this);\n}\n\nfinal BROWSE_REPOSITORIES_QUERY_DOCUMENT_OPERATION_NAME = 'BrowseRepositories';\nfinal BROWSE_REPOSITORIES_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'BrowseRepositories'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'notificationTypes')),\n        type: ListTypeNode(\n          type: NamedTypeNode(\n            name: NameNode(value: 'NotificationOptionInput'),\n            isNonNull: false,\n          ),\n          isNonNull: false,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      )\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'repositories'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'notificationTypes'),\n            value: VariableNode(name: NameNode(value: 'notificationTypes')),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 'id'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n          FieldNode(\n            name: NameNode(value: 'title'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n          FieldNode(\n            name: NameNode(value: 'privacy'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n          FieldNode(\n            name: NameNode(value: 'status'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass BrowseRepositoriesQuery extends GraphQLQuery<BrowseRepositories$Query,\n    BrowseRepositoriesArguments> {\n  BrowseRepositoriesQuery({required this.variables});\n\n  @override\n  final DocumentNode document = BROWSE_REPOSITORIES_QUERY_DOCUMENT;\n\n  @override\n  final String operationName =\n      BROWSE_REPOSITORIES_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final BrowseRepositoriesArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  BrowseRepositories$Query parse(Map<String, dynamic> json) =>\n      BrowseRepositories$Query.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/deprecated/deprecated_enum_value_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:gql/language.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On deprecated value', () {\n    test(\n      'Enum values can be deprecated',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          schema {\n            query: QueryResponse\n          }\n\n          type QueryResponse {\n            someValue: StarWarsMovies\n          }\n\n          enum StarWarsMovies {\n            NEW_HOPE @deprecated(reason: \"deprecated movie\")\n            EMPIRE\n            JEDI\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nconst query = r'''\n  query some_query {\n    someValue\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      document: parseString(query),\n      name: QueryName(name: r'SomeQuery$_QueryResponse'),\n      operationName: 'some_query',\n      classes: [\n        EnumDefinition(\n          name: EnumName(name: r'StarWarsMovies'),\n          values: [\n            EnumValueDefinition(\n              name: EnumValueName(name: 'NEW_HOPE'),\n              annotations: [\n                r\"Deprecated('deprecated movie')\",\n              ],\n            ),\n            EnumValueDefinition(\n              name: EnumValueName(name: 'EMPIRE'),\n            ),\n            EnumValueDefinition(\n              name: EnumValueName(name: 'JEDI'),\n            ),\n            EnumValueDefinition(\n              name: EnumValueName(name: 'ARTEMIS_UNKNOWN'),\n            ),\n          ],\n        ),\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_QueryResponse'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'StarWarsMovies'),\n                  name: ClassPropertyName(name: r'someValue'),\n                  // isOverride: false,\n\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: StarWarsMovies.artemisUnknown)',\n                  ])\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$QueryResponse extends JsonSerializable with EquatableMixin {\n  SomeQuery$QueryResponse();\n\n  factory SomeQuery$QueryResponse.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$QueryResponseFromJson(json);\n\n  @JsonKey(unknownEnumValue: StarWarsMovies.artemisUnknown)\n  StarWarsMovies? someValue;\n\n  @override\n  List<Object?> get props => [someValue];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$QueryResponseToJson(this);\n}\n\nenum StarWarsMovies {\n  @Deprecated('deprecated movie')\n  @JsonValue('NEW_HOPE')\n  newHope,\n  @JsonValue('EMPIRE')\n  empire,\n  @JsonValue('JEDI')\n  jedi,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n''';\n"
  },
  {
    "path": "test/query_generator/deprecated/deprecated_field_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On deprecated', () {\n    test(\n      'Fields can be deprecated',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          schema {\n            query: QueryResponse\n          }\n\n          type QueryResponse {\n            someObject: SomeObject @deprecated(reason: \"message\")\n            someObjects: [SomeObject]\n          }\n\n          type SomeObject {\n            someField: String\n            deprecatedField: String @deprecated(reason: \"message 2\")\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nconst query = r'''\n  query some_query {\n    deprecatedObject: someObject {\n      someField\n      deprecatedField\n    }\n    someObjects {\n      someField\n      deprecatedField\n    }\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'SomeQuery$_QueryResponse'),\n      operationName: r'some_query',\n      classes: [\n        ClassDefinition(\n            name:\n                ClassName(name: r'SomeQuery$_QueryResponse$_deprecatedObject'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'someField'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'deprecatedField'),\n                  annotations: [r'''Deprecated('message 2')'''],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_QueryResponse$_SomeObject'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'someField'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'deprecatedField'),\n                  annotations: [r'''Deprecated('message 2')'''],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_QueryResponse'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(\n                      name: r'SomeQuery$_QueryResponse$_deprecatedObject'),\n                  name: ClassPropertyName(name: r'deprecatedObject'),\n                  annotations: [r'''Deprecated('message')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: TypeName(\n                          name: r'SomeQuery$_QueryResponse$_SomeObject'),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'someObjects'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$QueryResponse$DeprecatedObject extends JsonSerializable\n    with EquatableMixin {\n  SomeQuery$QueryResponse$DeprecatedObject();\n\n  factory SomeQuery$QueryResponse$DeprecatedObject.fromJson(\n          Map<String, dynamic> json) =>\n      _$SomeQuery$QueryResponse$DeprecatedObjectFromJson(json);\n\n  String? someField;\n\n  @Deprecated('message 2')\n  String? deprecatedField;\n\n  @override\n  List<Object?> get props => [someField, deprecatedField];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$SomeQuery$QueryResponse$DeprecatedObjectToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$QueryResponse$SomeObject extends JsonSerializable\n    with EquatableMixin {\n  SomeQuery$QueryResponse$SomeObject();\n\n  factory SomeQuery$QueryResponse$SomeObject.fromJson(\n          Map<String, dynamic> json) =>\n      _$SomeQuery$QueryResponse$SomeObjectFromJson(json);\n\n  String? someField;\n\n  @Deprecated('message 2')\n  String? deprecatedField;\n\n  @override\n  List<Object?> get props => [someField, deprecatedField];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$SomeQuery$QueryResponse$SomeObjectToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$QueryResponse extends JsonSerializable with EquatableMixin {\n  SomeQuery$QueryResponse();\n\n  factory SomeQuery$QueryResponse.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$QueryResponseFromJson(json);\n\n  @Deprecated('message')\n  SomeQuery$QueryResponse$DeprecatedObject? deprecatedObject;\n\n  List<SomeQuery$QueryResponse$SomeObject?>? someObjects;\n\n  @override\n  List<Object?> get props => [deprecatedObject, someObjects];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$QueryResponseToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/deprecated/deprecated_input_object_field_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On mutations', () {\n    test(\n      'The mutation class will be suffixed as Mutation',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          schema {\n            mutation: MutationRoot\n          }\n          \n          type MutationRoot {\n            mut(input: Input!): MutationResponse\n          }\n          \n          type MutationResponse {\n            s: String\n          }\n          \n          input Input {\n            s: String!\n            d: String @deprecated(reason: \"deprecated input field\")\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        generateHelpers: true,\n      ),\n    );\n  });\n}\n\nconst query = r'''\nmutation custom($input: Input!) {\n  mut(input: $input) {\n    s\n  }\n}\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Custom$_MutationRoot'),\n      operationName: r'custom',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_MutationRoot$_MutationResponse'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_MutationRoot'),\n            properties: [\n              ClassProperty(\n                  type:\n                      TypeName(name: r'Custom$_MutationRoot$_MutationResponse'),\n                  name: ClassPropertyName(name: r'mut'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Input'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'd'),\n                  annotations: [r'''Deprecated('deprecated input field')'''],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: TypeName(name: r'Input', isNonNull: true),\n            name: QueryInputName(name: r'input'))\n      ],\n      generateHelpers: true,\n      suffix: r'Mutation')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$MutationRoot$MutationResponse extends JsonSerializable\n    with EquatableMixin {\n  Custom$MutationRoot$MutationResponse();\n\n  factory Custom$MutationRoot$MutationResponse.fromJson(\n          Map<String, dynamic> json) =>\n      _$Custom$MutationRoot$MutationResponseFromJson(json);\n\n  String? s;\n\n  @override\n  List<Object?> get props => [s];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$Custom$MutationRoot$MutationResponseToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$MutationRoot extends JsonSerializable with EquatableMixin {\n  Custom$MutationRoot();\n\n  factory Custom$MutationRoot.fromJson(Map<String, dynamic> json) =>\n      _$Custom$MutationRootFromJson(json);\n\n  Custom$MutationRoot$MutationResponse? mut;\n\n  @override\n  List<Object?> get props => [mut];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$MutationRootToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Input extends JsonSerializable with EquatableMixin {\n  Input({\n    required this.s,\n    this.d,\n  });\n\n  factory Input.fromJson(Map<String, dynamic> json) => _$InputFromJson(json);\n\n  late String s;\n\n  @Deprecated('deprecated input field')\n  String? d;\n\n  @override\n  List<Object?> get props => [s, d];\n  @override\n  Map<String, dynamic> toJson() => _$InputToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CustomArguments extends JsonSerializable with EquatableMixin {\n  CustomArguments({required this.input});\n\n  @override\n  factory CustomArguments.fromJson(Map<String, dynamic> json) =>\n      _$CustomArgumentsFromJson(json);\n\n  late Input input;\n\n  @override\n  List<Object?> get props => [input];\n  @override\n  Map<String, dynamic> toJson() => _$CustomArgumentsToJson(this);\n}\n\nfinal CUSTOM_MUTATION_DOCUMENT_OPERATION_NAME = 'custom';\nfinal CUSTOM_MUTATION_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.mutation,\n    name: NameNode(value: 'custom'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'input')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'Input'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      )\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'mut'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'input'),\n            value: VariableNode(name: NameNode(value: 'input')),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 's'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          )\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass CustomMutation\n    extends GraphQLQuery<Custom$MutationRoot, CustomArguments> {\n  CustomMutation({required this.variables});\n\n  @override\n  final DocumentNode document = CUSTOM_MUTATION_DOCUMENT;\n\n  @override\n  final String operationName = CUSTOM_MUTATION_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final CustomArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  Custom$MutationRoot parse(Map<String, dynamic> json) =>\n      Custom$MutationRoot.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/deprecated/deprecated_interface_field_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On interfaces', () {\n    test(\n      'On interfaces',\n      () async => testGenerator(\n        query: query,\n        schema: graphQLSchema,\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nconst query = r'''\n  query custom($id: ID!) {\n    nodeById(id: $id) {\n      id\n      deprecatedField\n      ... on User {\n        ...UserFrag\n      }\n      ... on ChatMessage {\n        message\n        user {\n          ...UserFrag\n        }\n      }\n    }\n  }\n  \n  fragment UserFrag on User {\n    id\n    username\n  }\n''';\n\n// https://graphql-code-generator.com/#live-demo\nfinal String graphQLSchema = r'''\n  scalar String\n  scalar ID\n  \n  schema {\n    query: Query\n  }\n  \n  type Query {\n    nodeById(id: ID!): Node\n  }\n  \n  interface Node {\n    id: ID!\n    deprecatedField: String @deprecated(reason: \"deprecated interface field\")\n  }\n  \n  type User implements Node {\n    id: ID!\n    username: String!\n    deprecatedField: String\n  }\n  \n  type ChatMessage implements Node {\n    id: ID!\n    message: String!\n    user: User!\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Custom$_Query'),\n      operationName: r'custom',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query$_Node$_User'),\n            extension: ClassName(name: r'Custom$_Query$_Node'),\n            mixins: [FragmentName(name: r'UserFragMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query$_Node$_ChatMessage$_User'),\n            mixins: [FragmentName(name: r'UserFragMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query$_Node$_ChatMessage'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'message'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(\n                      name: r'Custom$_Query$_Node$_ChatMessage$_User',\n                      isNonNull: true),\n                  name: ClassPropertyName(name: r'user'),\n                  isResolveType: false)\n            ],\n            extension: ClassName(name: r'Custom$_Query$_Node'),\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query$_Node'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'deprecatedField'),\n                  annotations: [\n                    r'''Deprecated('deprecated interface field')'''\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {\n              r'User': ClassName(name: r'Custom$_Query$_Node$_User'),\n              r'ChatMessage':\n                  ClassName(name: r'Custom$_Query$_Node$_ChatMessage')\n            },\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'Custom$_Query$_Node'),\n                  name: ClassPropertyName(name: r'nodeById'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'UserFragMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'username'),\n                  isResolveType: false)\n            ])\n      ],\n      inputs: [\n        QueryInput(\n            type: DartTypeName(name: r'String', isNonNull: true),\n            name: QueryInputName(name: r'id'))\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\nmixin UserFragMixin {\n  late String id;\n  late String username;\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$Node$User extends Custom$Query$Node\n    with EquatableMixin, UserFragMixin {\n  Custom$Query$Node$User();\n\n  factory Custom$Query$Node$User.fromJson(Map<String, dynamic> json) =>\n      _$Custom$Query$Node$UserFromJson(json);\n\n  @override\n  List<Object?> get props => [id, username];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$Query$Node$UserToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$Node$ChatMessage$User extends JsonSerializable\n    with EquatableMixin, UserFragMixin {\n  Custom$Query$Node$ChatMessage$User();\n\n  factory Custom$Query$Node$ChatMessage$User.fromJson(\n          Map<String, dynamic> json) =>\n      _$Custom$Query$Node$ChatMessage$UserFromJson(json);\n\n  @override\n  List<Object?> get props => [id, username];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$Custom$Query$Node$ChatMessage$UserToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$Node$ChatMessage extends Custom$Query$Node\n    with EquatableMixin {\n  Custom$Query$Node$ChatMessage();\n\n  factory Custom$Query$Node$ChatMessage.fromJson(Map<String, dynamic> json) =>\n      _$Custom$Query$Node$ChatMessageFromJson(json);\n\n  late String message;\n\n  late Custom$Query$Node$ChatMessage$User user;\n\n  @override\n  List<Object?> get props => [message, user];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$Query$Node$ChatMessageToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$Node extends JsonSerializable with EquatableMixin {\n  Custom$Query$Node();\n\n  factory Custom$Query$Node.fromJson(Map<String, dynamic> json) {\n    switch (json['__typename'].toString()) {\n      case r'User':\n        return Custom$Query$Node$User.fromJson(json);\n      case r'ChatMessage':\n        return Custom$Query$Node$ChatMessage.fromJson(json);\n      default:\n    }\n    return _$Custom$Query$NodeFromJson(json);\n  }\n\n  late String id;\n\n  @Deprecated('deprecated interface field')\n  String? deprecatedField;\n\n  @override\n  List<Object?> get props => [id, deprecatedField];\n  @override\n  Map<String, dynamic> toJson() {\n    switch ($$typename) {\n      case r'User':\n        return (this as Custom$Query$Node$User).toJson();\n      case r'ChatMessage':\n        return (this as Custom$Query$Node$ChatMessage).toJson();\n      default:\n    }\n    return _$Custom$Query$NodeToJson(this);\n  }\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query extends JsonSerializable with EquatableMixin {\n  Custom$Query();\n\n  factory Custom$Query.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryFromJson(json);\n\n  Custom$Query$Node? nodeById;\n\n  @override\n  List<Object?> get props => [nodeById];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/enums/enum_duplication_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('Enum duplication', () {\n    test(\n      'Enum duplication should be properly handeled',\n      () async => testGenerator(\n        query: query,\n        namingScheme: 'pathedWithFields',\n        schema: r'''\n          schema {\n            query: Query\n          }\n          \n          type Query {\n            q: QueryResponse\n            qList: [QueryResponse]\n          }\n          \n          type QueryResponse {\n            e: MyEnum\n          }\n          \n          enum MyEnum {\n            A\n            B\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        sourceAssetsMap: {\n          'a|queries/another_query.graphql': anotherQuery,\n        },\n      ),\n    );\n  });\n}\n\nconst query = r'''\n  query custom {\n    q {\n      e\n    }\n  }\n''';\n\nconst anotherQuery = r'''\n  query customList {\n    qList {\n      e\n    }\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Custom$_Query'),\n      operationName: r'custom',\n      classes: [\n        EnumDefinition(name: EnumName(name: r'MyEnum'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'A')),\n          EnumValueDefinition(name: EnumValueName(name: r'B')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query$_q'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'MyEnum'),\n                  name: ClassPropertyName(name: r'e'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: MyEnum.artemisUnknown)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'Custom$_Query$_q'),\n                  name: ClassPropertyName(name: r'q'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query'),\n  QueryDefinition(\n      name: QueryName(name: r'CustomList$_Query'),\n      operationName: r'customList',\n      classes: [\n        EnumDefinition(name: EnumName(name: r'MyEnum'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'A')),\n          EnumValueDefinition(name: EnumValueName(name: r'B')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        ClassDefinition(\n            name: ClassName(name: r'CustomList$_Query$_qList'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'MyEnum'),\n                  name: ClassPropertyName(name: r'e'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: MyEnum.artemisUnknown)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'CustomList$_Query'),\n            properties: [\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: TypeName(name: r'CustomList$_Query$_qList'),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'qList'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$Q extends JsonSerializable with EquatableMixin {\n  Custom$Query$Q();\n\n  factory Custom$Query$Q.fromJson(Map<String, dynamic> json) =>\n      _$Custom$Query$QFromJson(json);\n\n  @JsonKey(unknownEnumValue: MyEnum.artemisUnknown)\n  MyEnum? e;\n\n  @override\n  List<Object?> get props => [e];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$Query$QToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query extends JsonSerializable with EquatableMixin {\n  Custom$Query();\n\n  factory Custom$Query.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryFromJson(json);\n\n  Custom$Query$Q? q;\n\n  @override\n  List<Object?> get props => [q];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CustomList$Query$QList extends JsonSerializable with EquatableMixin {\n  CustomList$Query$QList();\n\n  factory CustomList$Query$QList.fromJson(Map<String, dynamic> json) =>\n      _$CustomList$Query$QListFromJson(json);\n\n  @JsonKey(unknownEnumValue: MyEnum.artemisUnknown)\n  MyEnum? e;\n\n  @override\n  List<Object?> get props => [e];\n  @override\n  Map<String, dynamic> toJson() => _$CustomList$Query$QListToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CustomList$Query extends JsonSerializable with EquatableMixin {\n  CustomList$Query();\n\n  factory CustomList$Query.fromJson(Map<String, dynamic> json) =>\n      _$CustomList$QueryFromJson(json);\n\n  List<CustomList$Query$QList?>? qList;\n\n  @override\n  List<Object?> get props => [qList];\n  @override\n  Map<String, dynamic> toJson() => _$CustomList$QueryToJson(this);\n}\n\nenum MyEnum {\n  @JsonValue('A')\n  a,\n  @JsonValue('B')\n  b,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n''';\n"
  },
  {
    "path": "test/query_generator/enums/enum_list_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On enum list', () {\n    test(\n      'Enums as lists are generated correctly',\n      () async => testGenerator(\n        query: query,\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        schema: r'''\n          schema {\n            query: QueryRoot\n          }\n          \n          type QueryRoot {\n            q: QueryResponse\n          }\n          \n          type QueryResponse {\n            le: [MyEnum]\n          }\n          \n          enum MyEnum {\n            A\n            B\n          }''',\n      ),\n    );\n  });\n}\n\nconst query = r'''\nquery custom {\n  q {\n    le\n  }\n}\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Custom$_QueryRoot'),\n      operationName: r'custom',\n      classes: [\n        EnumDefinition(name: EnumName(name: r'MyEnum'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'A')),\n          EnumValueDefinition(name: EnumValueName(name: r'B')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_QueryRoot$_QueryResponse'),\n            properties: [\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: TypeName(name: r'MyEnum'), isNonNull: false),\n                  name: ClassPropertyName(name: r'le'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: MyEnum.artemisUnknown)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_QueryRoot'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'Custom$_QueryRoot$_QueryResponse'),\n                  name: ClassPropertyName(name: r'q'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot$QueryResponse extends JsonSerializable\n    with EquatableMixin {\n  Custom$QueryRoot$QueryResponse();\n\n  factory Custom$QueryRoot$QueryResponse.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRoot$QueryResponseFromJson(json);\n\n  @JsonKey(unknownEnumValue: MyEnum.artemisUnknown)\n  List<MyEnum?>? le;\n\n  @override\n  List<Object?> get props => [le];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRoot$QueryResponseToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot extends JsonSerializable with EquatableMixin {\n  Custom$QueryRoot();\n\n  factory Custom$QueryRoot.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRootFromJson(json);\n\n  Custom$QueryRoot$QueryResponse? q;\n\n  @override\n  List<Object?> get props => [q];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRootToJson(this);\n}\n\nenum MyEnum {\n  @JsonValue('A')\n  a,\n  @JsonValue('B')\n  b,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n''';\n"
  },
  {
    "path": "test/query_generator/enums/filter_enum_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On enums', () {\n    test(\n      'Enums that are not used on result or input will be filtered out',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          schema {\n            query: QueryRoot\n          }\n\n          type QueryRoot {\n            q(e: input_enum!, i: Input!): QueryResponse\n          }\n\n          input Input {\n            e: _InputInputEnum\n          }\n\n          type QueryResponse {\n            e: MyEnum\n          }\n\n          enum MyEnum {\n            A\n            B\n          }\n\n          enum input_enum {\n            C\n            D\n          }\n\n          enum _InputInputEnum {\n            _E\n            _F\n            _new\n            new\n          }\n\n          type UnusedObject {\n            e: UnusedEnum\n          }\n\n          input UnusedInput {\n            u: UnusedEnum\n          }\n\n          enum UnusedEnum {\n            G\n            H\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nconst query = r'''\n  query custom($e: input_enum!, $i: Input!) {\n    q(e: $e, i: $i) {\n      e\n    }\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Custom$_QueryRoot'),\n      operationName: r'custom',\n      classes: [\n        EnumDefinition(name: EnumName(name: r'MyEnum'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'A')),\n          EnumValueDefinition(name: EnumValueName(name: r'B')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        EnumDefinition(name: EnumName(name: r'input_enum'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'C')),\n          EnumValueDefinition(name: EnumValueName(name: r'D')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        EnumDefinition(name: EnumName(name: r'_InputInputEnum'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'_E')),\n          EnumValueDefinition(name: EnumValueName(name: r'_F')),\n          EnumValueDefinition(name: EnumValueName(name: r'_new')),\n          EnumValueDefinition(name: EnumValueName(name: r'new')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_QueryRoot$_QueryResponse'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'MyEnum'),\n                  name: ClassPropertyName(name: r'e'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: MyEnum.artemisUnknown)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_QueryRoot'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'Custom$_QueryRoot$_QueryResponse'),\n                  name: ClassPropertyName(name: r'q'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Input'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'_InputInputEnum'),\n                  name: ClassPropertyName(name: r'e'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: $InputInputEnum.artemisUnknown)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: TypeName(name: r'input_enum', isNonNull: true),\n            name: QueryInputName(name: r'e'),\n            annotations: [\n              r'JsonKey(unknownEnumValue: InputEnum.artemisUnknown)'\n            ]),\n        QueryInput(\n            type: TypeName(name: r'Input', isNonNull: true),\n            name: QueryInputName(name: r'i'))\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot$QueryResponse extends JsonSerializable\n    with EquatableMixin {\n  Custom$QueryRoot$QueryResponse();\n\n  factory Custom$QueryRoot$QueryResponse.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRoot$QueryResponseFromJson(json);\n\n  @JsonKey(unknownEnumValue: MyEnum.artemisUnknown)\n  MyEnum? e;\n\n  @override\n  List<Object?> get props => [e];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRoot$QueryResponseToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot extends JsonSerializable with EquatableMixin {\n  Custom$QueryRoot();\n\n  factory Custom$QueryRoot.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRootFromJson(json);\n\n  Custom$QueryRoot$QueryResponse? q;\n\n  @override\n  List<Object?> get props => [q];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRootToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Input extends JsonSerializable with EquatableMixin {\n  Input({this.e});\n\n  factory Input.fromJson(Map<String, dynamic> json) => _$InputFromJson(json);\n\n  @JsonKey(unknownEnumValue: $InputInputEnum.artemisUnknown)\n  $InputInputEnum? e;\n\n  @override\n  List<Object?> get props => [e];\n  @override\n  Map<String, dynamic> toJson() => _$InputToJson(this);\n}\n\nenum MyEnum {\n  @JsonValue('A')\n  a,\n  @JsonValue('B')\n  b,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n\nenum InputEnum {\n  @JsonValue('C')\n  c,\n  @JsonValue('D')\n  d,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n\nenum $InputInputEnum {\n  @JsonValue('_E')\n  $e,\n  @JsonValue('_F')\n  $f,\n  @JsonValue('_new')\n  $new,\n  @JsonValue('new')\n  kw$new,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n''';\n"
  },
  {
    "path": "test/query_generator/enums/input_enum_list_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On enums', () {\n    test(\n      'List of enums as input',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          schema {\n            query: Query\n          }\n          \n          type Query {\n            articles(article_type_in: [ArticleType!]): [Article!]\n          }\n          \n          type Article {\n            id: ID!\n            title: String!\n            article_type: ArticleType!\n          }\n          \n          enum ArticleType {\n            NEWS\n            TUTORIAL\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        generateHelpers: true,\n      ),\n    );\n  });\n}\n\nconst query = r'''\n  query BrowseArticles($article_type_in: [ArticleType!]) {\n    articles(article_type_in: $article_type_in) {\n        id\n        title\n        article_type\n    }\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'BrowseArticles$_Query'),\n      operationName: r'BrowseArticles',\n      classes: [\n        EnumDefinition(name: EnumName(name: r'ArticleType'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'NEWS')),\n          EnumValueDefinition(name: EnumValueName(name: r'TUTORIAL')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        ClassDefinition(\n            name: ClassName(name: r'BrowseArticles$_Query$_Article'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'title'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'ArticleType', isNonNull: true),\n                  name: ClassPropertyName(name: r'article_type'),\n                  annotations: [\n                    r'''JsonKey(name: 'article_type', unknownEnumValue: ArticleType.artemisUnknown)'''\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'BrowseArticles$_Query'),\n            properties: [\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: TypeName(\n                          name: r'BrowseArticles$_Query$_Article',\n                          isNonNull: true),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'articles'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      inputs: [\n        QueryInput(\n            type: ListOfTypeName(\n                typeName: TypeName(name: r'ArticleType', isNonNull: true),\n                isNonNull: false),\n            name: QueryInputName(name: r'article_type_in'),\n            annotations: [\n              r'JsonKey(unknownEnumValue: ArticleType.artemisUnknown)'\n            ])\n      ],\n      generateHelpers: true,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass BrowseArticles$Query$Article extends JsonSerializable\n    with EquatableMixin {\n  BrowseArticles$Query$Article();\n\n  factory BrowseArticles$Query$Article.fromJson(Map<String, dynamic> json) =>\n      _$BrowseArticles$Query$ArticleFromJson(json);\n\n  late String id;\n\n  late String title;\n\n  @JsonKey(name: 'article_type', unknownEnumValue: ArticleType.artemisUnknown)\n  late ArticleType articleType;\n\n  @override\n  List<Object?> get props => [id, title, articleType];\n  @override\n  Map<String, dynamic> toJson() => _$BrowseArticles$Query$ArticleToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass BrowseArticles$Query extends JsonSerializable with EquatableMixin {\n  BrowseArticles$Query();\n\n  factory BrowseArticles$Query.fromJson(Map<String, dynamic> json) =>\n      _$BrowseArticles$QueryFromJson(json);\n\n  List<BrowseArticles$Query$Article>? articles;\n\n  @override\n  List<Object?> get props => [articles];\n  @override\n  Map<String, dynamic> toJson() => _$BrowseArticles$QueryToJson(this);\n}\n\nenum ArticleType {\n  @JsonValue('NEWS')\n  news,\n  @JsonValue('TUTORIAL')\n  tutorial,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n\n@JsonSerializable(explicitToJson: true)\nclass BrowseArticlesArguments extends JsonSerializable with EquatableMixin {\n  BrowseArticlesArguments({this.article_type_in});\n\n  @override\n  factory BrowseArticlesArguments.fromJson(Map<String, dynamic> json) =>\n      _$BrowseArticlesArgumentsFromJson(json);\n\n  @JsonKey(unknownEnumValue: ArticleType.artemisUnknown)\n  final List<ArticleType>? article_type_in;\n\n  @override\n  List<Object?> get props => [article_type_in];\n  @override\n  Map<String, dynamic> toJson() => _$BrowseArticlesArgumentsToJson(this);\n}\n\nfinal BROWSE_ARTICLES_QUERY_DOCUMENT_OPERATION_NAME = 'BrowseArticles';\nfinal BROWSE_ARTICLES_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'BrowseArticles'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'article_type_in')),\n        type: ListTypeNode(\n          type: NamedTypeNode(\n            name: NameNode(value: 'ArticleType'),\n            isNonNull: true,\n          ),\n          isNonNull: false,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      )\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'articles'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'article_type_in'),\n            value: VariableNode(name: NameNode(value: 'article_type_in')),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 'id'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n          FieldNode(\n            name: NameNode(value: 'title'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n          FieldNode(\n            name: NameNode(value: 'article_type'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass BrowseArticlesQuery\n    extends GraphQLQuery<BrowseArticles$Query, BrowseArticlesArguments> {\n  BrowseArticlesQuery({required this.variables});\n\n  @override\n  final DocumentNode document = BROWSE_ARTICLES_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = BROWSE_ARTICLES_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final BrowseArticlesArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  BrowseArticles$Query parse(Map<String, dynamic> json) =>\n      BrowseArticles$Query.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/enums/input_enum_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On enums', () {\n    test(\n      'Enums can be part of input objects',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          schema {\n            query: QueryRoot\n          }\n          \n          type QueryRoot {\n            q(_id: ID!, input: Input!, o: OtherEnum!): QueryResponse\n          }\n          \n          type QueryResponse {\n            s: String\n            my: MyEnum\n            other: OtherEnum\n          }\n          \n          input Input {\n            e: MyEnum!\n          }\n          \n          enum MyEnum {\n            A\n            B\n          }\n          \n          enum OtherEnum {\n            O1\n            O2\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        generateHelpers: true,\n      ),\n    );\n  });\n}\n\nconst query = r'''\n  query custom($_id: ID!, $input: Input!, $o: OtherEnum!) {\n    q(_id: $_id, input: $input, o: $o) {\n      s\n      my\n      other\n    }\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Custom$_QueryRoot'),\n      operationName: r'custom',\n      classes: [\n        EnumDefinition(name: EnumName(name: r'MyEnum'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'A')),\n          EnumValueDefinition(name: EnumValueName(name: r'B')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        EnumDefinition(name: EnumName(name: r'OtherEnum'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'O1')),\n          EnumValueDefinition(name: EnumValueName(name: r'O2')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_QueryRoot$_QueryResponse'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'MyEnum'),\n                  name: ClassPropertyName(name: r'my'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: MyEnum.artemisUnknown)'\n                  ],\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'OtherEnum'),\n                  name: ClassPropertyName(name: r'other'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: OtherEnum.artemisUnknown)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_QueryRoot'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'Custom$_QueryRoot$_QueryResponse'),\n                  name: ClassPropertyName(name: r'q'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Input'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'MyEnum', isNonNull: true),\n                  name: ClassPropertyName(name: r'e'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: MyEnum.artemisUnknown)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: DartTypeName(name: r'String', isNonNull: true),\n            name: QueryInputName(name: r'_id'),\n            annotations: [r'''JsonKey(name: '_id')''']),\n        QueryInput(\n            type: TypeName(name: r'Input', isNonNull: true),\n            name: QueryInputName(name: r'input')),\n        QueryInput(\n            type: TypeName(name: r'OtherEnum', isNonNull: true),\n            name: QueryInputName(name: r'o'),\n            annotations: [\n              r'JsonKey(unknownEnumValue: OtherEnum.artemisUnknown)'\n            ])\n      ],\n      generateHelpers: true,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot$QueryResponse extends JsonSerializable\n    with EquatableMixin {\n  Custom$QueryRoot$QueryResponse();\n\n  factory Custom$QueryRoot$QueryResponse.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRoot$QueryResponseFromJson(json);\n\n  String? s;\n\n  @JsonKey(unknownEnumValue: MyEnum.artemisUnknown)\n  MyEnum? my;\n\n  @JsonKey(unknownEnumValue: OtherEnum.artemisUnknown)\n  OtherEnum? other;\n\n  @override\n  List<Object?> get props => [s, my, other];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRoot$QueryResponseToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot extends JsonSerializable with EquatableMixin {\n  Custom$QueryRoot();\n\n  factory Custom$QueryRoot.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRootFromJson(json);\n\n  Custom$QueryRoot$QueryResponse? q;\n\n  @override\n  List<Object?> get props => [q];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRootToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Input extends JsonSerializable with EquatableMixin {\n  Input({required this.e});\n\n  factory Input.fromJson(Map<String, dynamic> json) => _$InputFromJson(json);\n\n  @JsonKey(unknownEnumValue: MyEnum.artemisUnknown)\n  late MyEnum e;\n\n  @override\n  List<Object?> get props => [e];\n  @override\n  Map<String, dynamic> toJson() => _$InputToJson(this);\n}\n\nenum MyEnum {\n  @JsonValue('A')\n  a,\n  @JsonValue('B')\n  b,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n\nenum OtherEnum {\n  @JsonValue('O1')\n  o1,\n  @JsonValue('O2')\n  o2,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CustomArguments extends JsonSerializable with EquatableMixin {\n  CustomArguments({\n    required this.$id,\n    required this.input,\n    required this.o,\n  });\n\n  @override\n  factory CustomArguments.fromJson(Map<String, dynamic> json) =>\n      _$CustomArgumentsFromJson(json);\n\n  @JsonKey(name: '_id')\n  late String $id;\n\n  late Input input;\n\n  @JsonKey(unknownEnumValue: OtherEnum.artemisUnknown)\n  late OtherEnum o;\n\n  @override\n  List<Object?> get props => [$id, input, o];\n  @override\n  Map<String, dynamic> toJson() => _$CustomArgumentsToJson(this);\n}\n\nfinal CUSTOM_QUERY_DOCUMENT_OPERATION_NAME = 'custom';\nfinal CUSTOM_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'custom'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: '_id')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'ID'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'input')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'Input'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'o')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'OtherEnum'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'q'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: '_id'),\n            value: VariableNode(name: NameNode(value: '_id')),\n          ),\n          ArgumentNode(\n            name: NameNode(value: 'input'),\n            value: VariableNode(name: NameNode(value: 'input')),\n          ),\n          ArgumentNode(\n            name: NameNode(value: 'o'),\n            value: VariableNode(name: NameNode(value: 'o')),\n          ),\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 's'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n          FieldNode(\n            name: NameNode(value: 'my'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n          FieldNode(\n            name: NameNode(value: 'other'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass CustomQuery extends GraphQLQuery<Custom$QueryRoot, CustomArguments> {\n  CustomQuery({required this.variables});\n\n  @override\n  final DocumentNode document = CUSTOM_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = CUSTOM_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final CustomArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  Custom$QueryRoot parse(Map<String, dynamic> json) =>\n      Custom$QueryRoot.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/enums/kw_prefix_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On enums', () {\n    test(\n      'Should correctly proceed enum fields with `kw` prefix',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          type Query {\n            articles(titleWhere: ArticleTitleWhereConditions): [Article!]\n          }\n          \n          input ArticleTitleWhereConditions {\n            operator: SQLOperator\n            value: String\n          }\n          \n          type Article {\n            id: ID!\n            title: String!\n          }\n          \n          enum SQLOperator {\n            EQ\n            IN\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nconst query = r'''\n  query SearchArticles($titleWhere: ArticleTitleWhereConditions) {\n    articles(titleWhere: $titleWhere) {\n        id\n        title\n    }\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'SearchArticles$_Query'),\n      operationName: r'SearchArticles',\n      classes: [\n        EnumDefinition(name: EnumName(name: r'SQLOperator'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'EQ')),\n          EnumValueDefinition(name: EnumValueName(name: r'IN')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        ClassDefinition(\n            name: ClassName(name: r'SearchArticles$_Query$_Article'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'title'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'SearchArticles$_Query'),\n            properties: [\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: TypeName(\n                          name: r'SearchArticles$_Query$_Article',\n                          isNonNull: true),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'articles'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'ArticleTitleWhereConditions'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'SQLOperator'),\n                  name: ClassPropertyName(name: r'operator'),\n                  annotations: [\n                    r'''JsonKey(name: 'operator', unknownEnumValue: SQLOperator.artemisUnknown)'''\n                  ],\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'value'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: TypeName(name: r'ArticleTitleWhereConditions'),\n            name: QueryInputName(name: r'titleWhere'))\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SearchArticles$Query$Article extends JsonSerializable\n    with EquatableMixin {\n  SearchArticles$Query$Article();\n\n  factory SearchArticles$Query$Article.fromJson(Map<String, dynamic> json) =>\n      _$SearchArticles$Query$ArticleFromJson(json);\n\n  late String id;\n\n  late String title;\n\n  @override\n  List<Object?> get props => [id, title];\n  @override\n  Map<String, dynamic> toJson() => _$SearchArticles$Query$ArticleToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SearchArticles$Query extends JsonSerializable with EquatableMixin {\n  SearchArticles$Query();\n\n  factory SearchArticles$Query.fromJson(Map<String, dynamic> json) =>\n      _$SearchArticles$QueryFromJson(json);\n\n  List<SearchArticles$Query$Article>? articles;\n\n  @override\n  List<Object?> get props => [articles];\n  @override\n  Map<String, dynamic> toJson() => _$SearchArticles$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass ArticleTitleWhereConditions extends JsonSerializable with EquatableMixin {\n  ArticleTitleWhereConditions({\n    this.kw$operator,\n    this.value,\n  });\n\n  factory ArticleTitleWhereConditions.fromJson(Map<String, dynamic> json) =>\n      _$ArticleTitleWhereConditionsFromJson(json);\n\n  @JsonKey(name: 'operator', unknownEnumValue: SQLOperator.artemisUnknown)\n  SQLOperator? kw$operator;\n\n  String? value;\n\n  @override\n  List<Object?> get props => [kw$operator, value];\n  @override\n  Map<String, dynamic> toJson() => _$ArticleTitleWhereConditionsToJson(this);\n}\n\nenum SQLOperator {\n  @JsonValue('EQ')\n  eq,\n  @JsonValue('IN')\n  kw$IN,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n''';\n"
  },
  {
    "path": "test/query_generator/enums/query_enum_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On enums', () {\n    test(\n      'Enums can be part of queries responses',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          schema {\n            query: QueryRoot\n          }\n          \n          type QueryRoot {\n            q: QueryResponse\n          }\n          \n          type QueryResponse {\n            e: MyEnum\n          }\n          \n          enum MyEnum {\n            A\n            B\n            IN\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nconst query = r'''\n  query custom {\n    q {\n      e\n    }\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Custom$_QueryRoot'),\n      operationName: r'custom',\n      classes: [\n        EnumDefinition(name: EnumName(name: r'MyEnum'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'A')),\n          EnumValueDefinition(name: EnumValueName(name: r'B')),\n          EnumValueDefinition(name: EnumValueName(name: r'IN')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_QueryRoot$_QueryResponse'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'MyEnum'),\n                  name: ClassPropertyName(name: r'e'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: MyEnum.artemisUnknown)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_QueryRoot'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'Custom$_QueryRoot$_QueryResponse'),\n                  name: ClassPropertyName(name: r'q'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot$QueryResponse extends JsonSerializable\n    with EquatableMixin {\n  Custom$QueryRoot$QueryResponse();\n\n  factory Custom$QueryRoot$QueryResponse.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRoot$QueryResponseFromJson(json);\n\n  @JsonKey(unknownEnumValue: MyEnum.artemisUnknown)\n  MyEnum? e;\n\n  @override\n  List<Object?> get props => [e];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRoot$QueryResponseToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot extends JsonSerializable with EquatableMixin {\n  Custom$QueryRoot();\n\n  factory Custom$QueryRoot.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRootFromJson(json);\n\n  Custom$QueryRoot$QueryResponse? q;\n\n  @override\n  List<Object?> get props => [q];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRootToJson(this);\n}\n\nenum MyEnum {\n  @JsonValue('A')\n  a,\n  @JsonValue('B')\n  b,\n  @JsonValue('IN')\n  kw$IN,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n''';\n"
  },
  {
    "path": "test/query_generator/errors/fragment_not_found_test.dart",
    "content": "import 'package:artemis/builder.dart';\nimport 'package:artemis/generator/errors.dart';\nimport 'package:build/build.dart';\nimport 'package:build_test/build_test.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  group('On errors', () {\n    test('When there\\'s a missing fragment being used', () async {\n      final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n        'generate_helpers': false,\n        'schema_mapping': [\n          {\n            'schema': 'api.schema.graphql',\n            'queries_glob': 'lib/queries/some_query.graphql',\n            'output': 'lib/output/some_query.graphql.dart',\n          },\n        ],\n      }));\n\n      expect(\n        () => testBuilder(\n          anotherBuilder,\n          {\n            'a|api.schema.graphql': '''\n                type Query {\n                  a: String!\n                }\n                ''',\n            'a|lib/queries/some_query.graphql':\n                'query { ...nonExistentFragment }',\n          },\n          onLog: print,\n        ),\n        throwsA(predicate((e) =>\n            e is MissingFragmentException &&\n            e.fragmentName == 'NonExistentFragmentMixin' &&\n            e.className == r'SomeQuery$Query')),\n      );\n    });\n  });\n}\n"
  },
  {
    "path": "test/query_generator/errors/generation_errors_test.dart",
    "content": "import 'package:artemis/builder.dart';\nimport 'package:artemis/generator/errors.dart';\nimport 'package:build/build.dart';\nimport 'package:build_test/build_test.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  group('On errors', () {\n    test('When the schema glob matches queries glob', () async {\n      final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n        'generate_helpers': false,\n        'schema_mapping': [\n          {\n            'schema': 'non_existent_api.schema.graphql',\n            'queries_glob': '**.graphql',\n            'output': 'lib/some_query.dart',\n          },\n        ],\n      }));\n\n      anotherBuilder.onBuild = expectAsync1((_) {}, count: 0);\n\n      expect(\n          () => testBuilder(\n              anotherBuilder,\n              {\n                'a|api.schema.json': '',\n                'a|api.schema.grqphql': '',\n                'a|some_query.query.graphql': 'query some_query { s }',\n              },\n              onLog: print),\n          throwsA(predicate((e) => e is QueryGlobsSchemaException)));\n    });\n\n    test(\"When user hasn't configured an output\", () async {\n      expect(\n        () {\n          graphQLQueryBuilder(BuilderOptions({\n            'generate_helpers': false,\n            'schema_mapping': [\n              {\n                'schema': 'api.schema.grqphql',\n                'queries_glob': 'queries/**.graphql',\n              },\n            ],\n          }));\n        },\n        throwsA(predicate((e) {\n          return e is MissingBuildConfigurationException &&\n              e.name == 'schema_mapping => output';\n        })),\n      );\n    });\n\n    test(\"When user hasn't configured an queries_glob\", () async {\n      final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n        'generate_helpers': false,\n        'schema_mapping': [\n          {\n            'schema': 'api.schema.grqphql',\n            'output': 'lib/some_query.dart',\n          },\n        ],\n      }));\n\n      try {\n        await testBuilder(\n            anotherBuilder,\n            {\n              'a|api.schema.graphql': ''' ''',\n              'a|queries/query.graphql': ''' ''',\n              'a|fragment.frag': ''' '''\n            },\n            onLog: print);\n      } on MissingBuildConfigurationException catch (e) {\n        expect(e.name, 'schema_map => queries_glob');\n        return;\n      }\n\n      throw Exception('Expected MissingBuildConfigurationException');\n    });\n\n    test('When user fragments_glob return empty file', () async {\n      final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n        'generate_helpers': false,\n        'fragments_glob': '**.frag',\n        'schema_mapping': [\n          {\n            'schema': 'api.schema.grqphql',\n            'output': 'lib/some_query.dart',\n          },\n        ],\n      }));\n\n      try {\n        await testBuilder(\n            anotherBuilder,\n            {\n              'a|api.schema.graphql': ''' ''',\n              'a|queries/query.graphql': ''' ''',\n            },\n            onLog: print);\n      } on MissingFilesException catch (e) {\n        expect(e.globPattern, '**.frag');\n        return;\n      }\n      throw Exception('Expected MissingFilesException');\n    });\n\n    test('When user fragments_glob at schema level return empty file',\n        () async {\n      final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n        'generate_helpers': false,\n        'schema_mapping': [\n          {\n            'schema': 'api.schema.grqphql',\n            'fragments_glob': '**.schema',\n            'output': 'lib/some_query.dart',\n          },\n        ],\n      }));\n\n      try {\n        await testBuilder(\n            anotherBuilder,\n            {\n              'a|api.schema.graphql': ''' ''',\n              'a|queries/query.graphql': ''' ''',\n            },\n            onLog: print);\n      } on MissingFilesException catch (e) {\n        expect(e.globPattern, '**.schema');\n        return;\n      }\n      throw Exception('Expected MissingFilesException');\n    });\n\n    test('When schema_mapping is empty', () async {\n      try {\n        final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n          'generate_helpers': false,\n          'schema_mapping': [],\n        }));\n\n        await testBuilder(\n            anotherBuilder,\n            {\n              'a|api.schema.graphql': ''' ''',\n              'a|queries/query.graphql': ''' ''',\n            },\n            onLog: print);\n      } on MissingBuildConfigurationException catch (e) {\n        expect(e.name, 'schema_mapping');\n        return;\n      }\n\n      throw Exception('Expected MissingBuildConfigurationException');\n    });\n\n    test('When schema_mapping => schema is not defined', () async {\n      try {\n        final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n          'generate_helpers': false,\n          'schema_mapping': [\n            {\n              'queries_glob': '**.graphql',\n              'output': 'lib/some_query.dart',\n            }\n          ],\n        }));\n\n        await testBuilder(\n            anotherBuilder,\n            {\n              'a|api.schema.graphql': ''' ''',\n              'a|queries/query.graphql': ''' ''',\n            },\n            onLog: print);\n      } on MissingBuildConfigurationException catch (e) {\n        expect(e.name, 'schema_map => schema');\n        return;\n      }\n\n      throw Exception('Expected MissingBuildConfigurationException');\n    });\n\n    // test('When fragments_glob meets local fragments', () async {\n    //   final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n    //     'generate_helpers': false,\n    //     'schema_mapping': [\n    //       {\n    //         'schema': 'api.schema.graphql',\n    //         'output': 'lib/some_query.dart',\n    //         'queries_glob': 'queries/**.graphql',\n    //       },\n    //     ],\n    //     'fragments_glob': '**.frag',\n    //   }));\n    //\n    //   anotherBuilder.onBuild = expectAsync1((_) {}, count: 0);\n    //\n    //   expect(\n    //       () => testBuilder(\n    //           anotherBuilder,\n    //           {\n    //             'a|api.schema.graphql': '''\n    //             schema {\n    //               query: Query\n    //             }\n    //\n    //             type Query {\n    //               pokemon: Pokemon\n    //             }\n    //\n    //             type Pokemon {\n    //               id: String!\n    //             }\n    //             ''',\n    //             'a|queries/query.graphql': '''\n    //               {\n    //                   pokemon {\n    //                     ...Pokemon\n    //                   }\n    //               }\n    //\n    //               fragment Pokemon on Pokemon {\n    //                 id\n    //               }\n    //             ''',\n    //             'a|fragment.frag': '''fragment Pokemon on Pokemon {\n    //               id\n    //             }'''\n    //           },\n    //           onLog: print),\n    //       throwsA(predicate((e) => e is FragmentIgnoreException)));\n    // });\n\n    test('When the schema file is not found', () async {\n      final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n        'generate_helpers': false,\n        'schema_mapping': [\n          {\n            'schema': 'non_existent_api.schema.graphql',\n            'queries_glob': 'lib/**.graphql',\n            'output': 'lib/some_query.dart',\n          },\n        ],\n      }));\n\n      anotherBuilder.onBuild = expectAsync1((_) {}, count: 0);\n\n      expect(\n          () => testBuilder(\n              anotherBuilder,\n              {\n                'a|api.schema.json': '',\n                'a|api.schema.grqphql': '',\n                'a|some_query.query.graphql': 'query some_query { s }',\n              },\n              onLog: print),\n          throwsA(predicate(\n            (e) =>\n                e is MissingFilesException &&\n                e.globPattern == 'non_existent_api.schema.graphql',\n          )));\n    });\n\n    test('When the queries_glob files are not found', () async {\n      final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n        'generate_helpers': false,\n        'schema_mapping': [\n          {\n            'schema': 'api.schema.grqphql',\n            'queries_glob': 'lib/**.graphql',\n            'output': 'lib/some_query.dart',\n          },\n        ],\n      }));\n\n      anotherBuilder.onBuild = expectAsync1((_) {}, count: 0);\n\n      expect(\n          () => testBuilder(\n              anotherBuilder,\n              {\n                'a|api.schema.grqphql': '',\n                'a|some_query.query.graphql': 'query some_query { s }',\n              },\n              onLog: print),\n          throwsA(predicate(\n            (e) =>\n                e is MissingFilesException && e.globPattern == 'lib/**.graphql',\n          )));\n    });\n  });\n\n  test('Fragments with same name but with different selection set', () async {\n    final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n      'generate_helpers': false,\n      'schema_mapping': [\n        {\n          'schema': 'api.schema.graphql',\n          'output': 'lib/some_query.dart',\n          'queries_glob': 'queries/**.graphql',\n          'naming_scheme': 'pathedWithFields',\n        },\n      ],\n    }));\n\n    anotherBuilder.onBuild = expectAsync1((_) {}, count: 0);\n\n    expect(\n        () => testBuilder(\n            anotherBuilder,\n            {\n              'a|api.schema.graphql': '''\n                schema {\n                  query: Query\n                }\n      \n                type Query {\n                  pokemon: Pokemon\n                }\n      \n                type Pokemon {\n                  id: String!\n                  name: String!\n                }\n                ''',\n              'a|queries/query.graphql': '''\n                  {\n                      pokemon {\n                        ...Pokemon\n                      }\n                  }\n                  \n                  fragment Pokemon on Pokemon {\n                    id\n                  }\n                ''',\n              'a|queries/anotherQuery.graphql': '''\n                  {\n                      pokemon {\n                        ...Pokemon\n                      }\n                  }\n                  \n                  fragment Pokemon on Pokemon {\n                    id\n                    name\n                  }\n                ''',\n            },\n            onLog: print),\n        throwsA(predicate((e) => e is DuplicatedClassesException)));\n  });\n\n  test('When the query globs schema location', () async {\n    final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n      'generate_helpers': false,\n      'schema_mapping': [\n        {\n          'schema': 'lib/schema.graphql',\n          'queries_glob': 'lib/*.graphql',\n          'output': 'lib/output/some_query.dart',\n        },\n      ],\n    }));\n\n    anotherBuilder.onBuild = expectAsync1((_) {}, count: 0);\n\n    expect(\n        () => testBuilder(\n            anotherBuilder,\n            {\n              'a|api.schema.json': '',\n              'a|api.schema.grqphql': '',\n              'a|some_query.query.graphql': 'query some_query { s }',\n            },\n            onLog: print),\n        throwsA(predicate((e) => e is QueryGlobsSchemaException)));\n  });\n\n  test('When the query globs output location', () async {\n    final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n      'generate_helpers': false,\n      'schema_mapping': [\n        {\n          'schema': 'schema.graphql',\n          'queries_glob': 'lib/*',\n          'output': 'lib/output.dart',\n        },\n      ],\n    }));\n\n    anotherBuilder.onBuild = expectAsync1((_) {}, count: 0);\n\n    expect(\n        () => testBuilder(\n            anotherBuilder,\n            {\n              'a|api.schema.json': '',\n              'a|api.schema.grqphql': '',\n              'a|some_query.query.graphql': 'query some_query { s }',\n            },\n            onLog: print),\n        throwsA(predicate((e) => e is QueryGlobsOutputException)));\n  });\n\n  test('When scalar_mapping does not define a custom scalar', () async {\n    final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n      'generate_helpers': false,\n      'schema_mapping': [\n        {\n          'schema': 'api.schema.graphql',\n          'output': 'lib/output/some_query.dart',\n          'queries_glob': 'lib/queries/some_query.graphql',\n        },\n      ],\n    }));\n\n    anotherBuilder.onBuild = expectAsync1((_) {}, count: 0);\n\n    expect(\n        () => testBuilder(\n            anotherBuilder,\n            {\n              'a|api.schema.graphql': r'''\nscalar DateTime\n\ntype Query {\n  s: DateTime\n}\n''',\n              'a|lib/queries/some_query.graphql': 'query some_query { s }',\n            },\n            onLog: print),\n        throwsA(predicate((e) =>\n            e is MissingScalarConfigurationException &&\n            e.scalarName == 'DateTime')));\n  });\n}\n"
  },
  {
    "path": "test/query_generator/errors/root_type_not_found_test.dart",
    "content": "import 'package:artemis/builder.dart';\nimport 'package:artemis/generator/errors.dart';\nimport 'package:build/build.dart';\nimport 'package:build_test/build_test.dart';\nimport 'package:test/test.dart';\n\nvoid main() {\n  group('On errors', () {\n    test('When there\\'s no root type on schema', () async {\n      final anotherBuilder = graphQLQueryBuilder(BuilderOptions({\n        'generate_helpers': false,\n        'schema_mapping': [\n          {\n            'schema': 'lib/api.schema.graphql',\n            'queries_glob': 'lib/**.query.graphql',\n            'output': 'lib/some_query.graphql.dart',\n          },\n        ],\n      }));\n\n      anotherBuilder.onBuild = expectAsync1((_) {}, count: 0);\n\n      expect(\n        () => testBuilder(\n          anotherBuilder,\n          {\n            'a|lib/api.schema.graphql': '',\n            'a|lib/some.query.graphql': 'query { a }',\n          },\n          onLog: print,\n        ),\n        throwsA(predicate((e) => e is MissingRootTypeException)),\n      );\n    });\n  });\n}\n"
  },
  {
    "path": "test/query_generator/forwarder_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../helpers.dart';\n\nvoid main() {\n  group('On forwarder', () {\n    test(\n      'Forwarder are created if output file does not end with .graphql.dart',\n      () async => testGenerator(\n        query: query,\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        schema: r'''\n          schema {\n            query: QueryRoot\n          }\n\n          type QueryRoot {\n            a: String\n          }''',\n        builderOptionsMap: {\n          'schema_mapping': [\n            {\n              'schema': 'api.schema.graphql',\n              'queries_glob': 'queries/**.graphql',\n              'output': 'lib/query.dart',\n            }\n          ],\n        },\n        outputsMap: {\n          'a|lib/query.graphql.dart': generatedFile,\n          'a|lib/query.dart': r'''// GENERATED CODE - DO NOT MODIFY BY HAND\nexport 'query.graphql.dart';\n''',\n        },\n      ),\n    );\n  });\n}\n\nconst query = r'''\nquery custom {\n  a\n}\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Custom$_QueryRoot'),\n      operationName: r'custom',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_QueryRoot'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'a'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$QueryRoot extends JsonSerializable with EquatableMixin {\n  Custom$QueryRoot();\n\n  factory Custom$QueryRoot.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryRootFromJson(json);\n\n  String? a;\n\n  @override\n  List<Object?> get props => [a];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryRootToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/fragments/fragment_duplication_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('Fragment duplication', () {\n    test(\n      'Fragment duplication should be properly handeled',\n      () async => testGenerator(\n        namingScheme: 'pathedWithFields',\n        query: queryString,\n        schema: r'''\n          schema {\n            query: Query\n          }\n\n          type Query {\n            pokemon(id: String, name: String): Pokemon\n            allPokemons: [Pokemon]\n          }\n\n          type Pokemon {\n            id: String!\n            name: String\n            number: String\n            evolution: Pokemon\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        builderOptionsMap: {'fragments_glob': '**.frag'},\n        sourceAssetsMap: {\n          'a|fragment.frag': fragmentsString,\n          'a|queries/another_query.graphql': anotherQueryString,\n        },\n      ),\n    );\n  });\n}\n\nconst fragmentsString = '''\n  fragment PokemonParts on Pokemon {\n    number\n    name\n  }\n  \n  fragment PokemonName on Pokemon {\n    name\n  }\n  \n  fragment Pokemon on Pokemon {\n    id\n    ...PokemonParts\n    evolution {\n      ...PokemonName\n    }\n  }\n''';\n\nconst queryString = '''\n  query PokemonData {\n      pokemon(name: \"Pikachu\") {\n        ...Pokemon\n      }\n  }\n''';\n\nconst anotherQueryString = '''\n  query AllPokemonsData {\n      allPokemons {\n        ...Pokemon\n      }\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'PokemonData$_Query'),\n      operationName: r'PokemonData',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'PokemonData$_Query$_pokemon'),\n            mixins: [\n              FragmentName(name: r'PokemonMixin'),\n              FragmentName(name: r'PokemonPartsMixin')\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'PokemonData$_Query'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'PokemonData$_Query$_pokemon'),\n                  name: ClassPropertyName(name: r'pokemon'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'PokemonMixin$_evolution'),\n            mixins: [FragmentName(name: r'PokemonNameMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'PokemonMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'PokemonMixin$_evolution'),\n                  name: ClassPropertyName(name: r'evolution'),\n                  isResolveType: false)\n            ]),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'PokemonNameMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'name'),\n                  isResolveType: false)\n            ]),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'PokemonPartsMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'number'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'name'),\n                  isResolveType: false)\n            ])\n      ],\n      generateHelpers: false,\n      suffix: r'Query'),\n  QueryDefinition(\n      name: QueryName(name: r'AllPokemonsData$_Query'),\n      operationName: r'AllPokemonsData',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'AllPokemonsData$_Query$_allPokemons'),\n            mixins: [\n              FragmentName(name: r'PokemonMixin'),\n              FragmentName(name: r'PokemonPartsMixin')\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'AllPokemonsData$_Query'),\n            properties: [\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: TypeName(\n                          name: r'AllPokemonsData$_Query$_allPokemons'),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'allPokemons'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'PokemonMixin$_evolution'),\n            mixins: [FragmentName(name: r'PokemonNameMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'PokemonMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'PokemonMixin$_evolution'),\n                  name: ClassPropertyName(name: r'evolution'),\n                  isResolveType: false)\n            ]),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'PokemonNameMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'name'),\n                  isResolveType: false)\n            ]),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'PokemonPartsMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'number'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'name'),\n                  isResolveType: false)\n            ])\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\nmixin PokemonMixin {\n  late String id;\n  PokemonMixin$Evolution? evolution;\n}\nmixin PokemonNameMixin {\n  String? name;\n}\nmixin PokemonPartsMixin {\n  String? number;\n  String? name;\n}\n\n@JsonSerializable(explicitToJson: true)\nclass PokemonData$Query$Pokemon extends JsonSerializable\n    with EquatableMixin, PokemonMixin, PokemonPartsMixin {\n  PokemonData$Query$Pokemon();\n\n  factory PokemonData$Query$Pokemon.fromJson(Map<String, dynamic> json) =>\n      _$PokemonData$Query$PokemonFromJson(json);\n\n  @override\n  List<Object?> get props => [id, evolution, number, name];\n  @override\n  Map<String, dynamic> toJson() => _$PokemonData$Query$PokemonToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass PokemonData$Query extends JsonSerializable with EquatableMixin {\n  PokemonData$Query();\n\n  factory PokemonData$Query.fromJson(Map<String, dynamic> json) =>\n      _$PokemonData$QueryFromJson(json);\n\n  PokemonData$Query$Pokemon? pokemon;\n\n  @override\n  List<Object?> get props => [pokemon];\n  @override\n  Map<String, dynamic> toJson() => _$PokemonData$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass PokemonMixin$Evolution extends JsonSerializable\n    with EquatableMixin, PokemonNameMixin {\n  PokemonMixin$Evolution();\n\n  factory PokemonMixin$Evolution.fromJson(Map<String, dynamic> json) =>\n      _$PokemonMixin$EvolutionFromJson(json);\n\n  @override\n  List<Object?> get props => [name];\n  @override\n  Map<String, dynamic> toJson() => _$PokemonMixin$EvolutionToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass AllPokemonsData$Query$AllPokemons extends JsonSerializable\n    with EquatableMixin, PokemonMixin, PokemonPartsMixin {\n  AllPokemonsData$Query$AllPokemons();\n\n  factory AllPokemonsData$Query$AllPokemons.fromJson(\n          Map<String, dynamic> json) =>\n      _$AllPokemonsData$Query$AllPokemonsFromJson(json);\n\n  @override\n  List<Object?> get props => [id, evolution, number, name];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$AllPokemonsData$Query$AllPokemonsToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass AllPokemonsData$Query extends JsonSerializable with EquatableMixin {\n  AllPokemonsData$Query();\n\n  factory AllPokemonsData$Query.fromJson(Map<String, dynamic> json) =>\n      _$AllPokemonsData$QueryFromJson(json);\n\n  List<AllPokemonsData$Query$AllPokemons?>? allPokemons;\n\n  @override\n  List<Object?> get props => [allPokemons];\n  @override\n  Map<String, dynamic> toJson() => _$AllPokemonsData$QueryToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/fragments/fragment_glob_schema_level_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('[Fragment generation using schema level glob]', () {\n    test(\n      'Extracting',\n      () async => testGenerator(\n        query: queryString,\n        schema: r'''\n          schema {\n            query: Query\n          }\n\n          type Query {\n            pokemon(id: String, name: String): Pokemon\n          }\n\n          type Pokemon {\n            id: String!\n            name: String\n            evolutions: [Pokemon]\n            attacks: PokemonAttack\n            weight: PokemonDimension\n          }\n          \n          type PokemonAttack {\n            special: [Attack]\n          }\n          \n          type PokemonDimension {\n            minimum: String\n          }\n          type Attack {\n            name: String\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        builderOptionsMap: {\n          'fragments_glob': '**.frag',\n          'schema_mapping': [\n            {\n              'schema': 'api.schema.graphql',\n              'queries_glob': 'queries/**.graphql',\n              'fragments_glob': '**.schema',\n              'output': 'lib/query.graphql.dart',\n            }\n          ],\n        },\n        sourceAssetsMap: {\n          'a|fragment.frag': fragmentsString,\n          'a|fragment.schema': fragmentsSchemaLevelString,\n        },\n        generateHelpers: true,\n      ),\n    );\n  });\n}\n\nconst fragmentsString = '''\n  fragment Pokemon on Pokemon {\n    id\n    weight {\n      ...weight\n    }\n    attacks {\n      ...pokemonAttack\n    }\n  }\n  \n  fragment weight on PokemonDimension { \n    minimum \n  }\n''';\n\nconst fragmentsSchemaLevelString = '''\n  fragment pokemonAttack on PokemonAttack {\n    special { \n      ...attack \n    }\n  }\n  \n  fragment attack on Attack { \n    name \n  }\n''';\n\nconst queryString = '''\n  {\n      pokemon(name: \"Pikachu\") {\n        ...Pokemon\n        evolutions {\n          ...Pokemon\n        }\n      }\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Query$_Query'),\n      operationName: r'query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Query$_Query$_Pokemon$_Pokemon'),\n            mixins: [FragmentName(name: r'PokemonMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Query$_Query$_Pokemon'),\n            properties: [\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName:\n                          TypeName(name: r'Query$_Query$_Pokemon$_Pokemon'),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'evolutions'),\n                  isResolveType: false)\n            ],\n            mixins: [FragmentName(name: r'PokemonMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Query$_Query'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'Query$_Query$_Pokemon'),\n                  name: ClassPropertyName(name: r'pokemon'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'PokemonMixin$_PokemonDimension'),\n            mixins: [FragmentName(name: r'WeightMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'PokemonMixin$_PokemonAttack'),\n            mixins: [FragmentName(name: r'PokemonAttackMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'PokemonMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'PokemonMixin$_PokemonDimension'),\n                  name: ClassPropertyName(name: r'weight'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'PokemonMixin$_PokemonAttack'),\n                  name: ClassPropertyName(name: r'attacks'),\n                  isResolveType: false)\n            ]),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'WeightMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'minimum'),\n                  isResolveType: false)\n            ]),\n        ClassDefinition(\n            name: ClassName(name: r'PokemonAttackMixin$_Attack'),\n            mixins: [FragmentName(name: r'AttackMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'PokemonAttackMixin'),\n            properties: [\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: TypeName(name: r'PokemonAttackMixin$_Attack'),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'special'),\n                  isResolveType: false)\n            ]),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'AttackMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'name'),\n                  isResolveType: false)\n            ])\n      ],\n      generateHelpers: true,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\nmixin PokemonMixin {\n  late String id;\n  PokemonMixin$PokemonDimension? weight;\n  PokemonMixin$PokemonAttack? attacks;\n}\nmixin WeightMixin {\n  String? minimum;\n}\nmixin PokemonAttackMixin {\n  List<PokemonAttackMixin$Attack?>? special;\n}\nmixin AttackMixin {\n  String? name;\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Query$Query$Pokemon$Pokemon extends JsonSerializable\n    with EquatableMixin, PokemonMixin {\n  Query$Query$Pokemon$Pokemon();\n\n  factory Query$Query$Pokemon$Pokemon.fromJson(Map<String, dynamic> json) =>\n      _$Query$Query$Pokemon$PokemonFromJson(json);\n\n  @override\n  List<Object?> get props => [id, weight, attacks];\n  @override\n  Map<String, dynamic> toJson() => _$Query$Query$Pokemon$PokemonToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Query$Query$Pokemon extends JsonSerializable\n    with EquatableMixin, PokemonMixin {\n  Query$Query$Pokemon();\n\n  factory Query$Query$Pokemon.fromJson(Map<String, dynamic> json) =>\n      _$Query$Query$PokemonFromJson(json);\n\n  List<Query$Query$Pokemon$Pokemon?>? evolutions;\n\n  @override\n  List<Object?> get props => [id, weight, attacks, evolutions];\n  @override\n  Map<String, dynamic> toJson() => _$Query$Query$PokemonToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Query$Query extends JsonSerializable with EquatableMixin {\n  Query$Query();\n\n  factory Query$Query.fromJson(Map<String, dynamic> json) =>\n      _$Query$QueryFromJson(json);\n\n  Query$Query$Pokemon? pokemon;\n\n  @override\n  List<Object?> get props => [pokemon];\n  @override\n  Map<String, dynamic> toJson() => _$Query$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass PokemonMixin$PokemonDimension extends JsonSerializable\n    with EquatableMixin, WeightMixin {\n  PokemonMixin$PokemonDimension();\n\n  factory PokemonMixin$PokemonDimension.fromJson(Map<String, dynamic> json) =>\n      _$PokemonMixin$PokemonDimensionFromJson(json);\n\n  @override\n  List<Object?> get props => [minimum];\n  @override\n  Map<String, dynamic> toJson() => _$PokemonMixin$PokemonDimensionToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass PokemonMixin$PokemonAttack extends JsonSerializable\n    with EquatableMixin, PokemonAttackMixin {\n  PokemonMixin$PokemonAttack();\n\n  factory PokemonMixin$PokemonAttack.fromJson(Map<String, dynamic> json) =>\n      _$PokemonMixin$PokemonAttackFromJson(json);\n\n  @override\n  List<Object?> get props => [special];\n  @override\n  Map<String, dynamic> toJson() => _$PokemonMixin$PokemonAttackToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass PokemonAttackMixin$Attack extends JsonSerializable\n    with EquatableMixin, AttackMixin {\n  PokemonAttackMixin$Attack();\n\n  factory PokemonAttackMixin$Attack.fromJson(Map<String, dynamic> json) =>\n      _$PokemonAttackMixin$AttackFromJson(json);\n\n  @override\n  List<Object?> get props => [name];\n  @override\n  Map<String, dynamic> toJson() => _$PokemonAttackMixin$AttackToJson(this);\n}\n\nfinal QUERY_QUERY_DOCUMENT_OPERATION_NAME = 'query';\nfinal QUERY_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: null,\n    variableDefinitions: [],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'pokemon'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'name'),\n            value: StringValueNode(\n              value: 'Pikachu',\n              isBlock: false,\n            ),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FragmentSpreadNode(\n            name: NameNode(value: 'Pokemon'),\n            directives: [],\n          ),\n          FieldNode(\n            name: NameNode(value: 'evolutions'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FragmentSpreadNode(\n                name: NameNode(value: 'Pokemon'),\n                directives: [],\n              )\n            ]),\n          ),\n        ]),\n      )\n    ]),\n  ),\n  FragmentDefinitionNode(\n    name: NameNode(value: 'Pokemon'),\n    typeCondition: TypeConditionNode(\n        on: NamedTypeNode(\n      name: NameNode(value: 'Pokemon'),\n      isNonNull: false,\n    )),\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'id'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      ),\n      FieldNode(\n        name: NameNode(value: 'weight'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FragmentSpreadNode(\n            name: NameNode(value: 'weight'),\n            directives: [],\n          )\n        ]),\n      ),\n      FieldNode(\n        name: NameNode(value: 'attacks'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FragmentSpreadNode(\n            name: NameNode(value: 'pokemonAttack'),\n            directives: [],\n          )\n        ]),\n      ),\n    ]),\n  ),\n  FragmentDefinitionNode(\n    name: NameNode(value: 'weight'),\n    typeCondition: TypeConditionNode(\n        on: NamedTypeNode(\n      name: NameNode(value: 'PokemonDimension'),\n      isNonNull: false,\n    )),\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'minimum'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      )\n    ]),\n  ),\n  FragmentDefinitionNode(\n    name: NameNode(value: 'pokemonAttack'),\n    typeCondition: TypeConditionNode(\n        on: NamedTypeNode(\n      name: NameNode(value: 'PokemonAttack'),\n      isNonNull: false,\n    )),\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'special'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FragmentSpreadNode(\n            name: NameNode(value: 'attack'),\n            directives: [],\n          )\n        ]),\n      )\n    ]),\n  ),\n  FragmentDefinitionNode(\n    name: NameNode(value: 'attack'),\n    typeCondition: TypeConditionNode(\n        on: NamedTypeNode(\n      name: NameNode(value: 'Attack'),\n      isNonNull: false,\n    )),\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'name'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      )\n    ]),\n  ),\n]);\n\nclass QueryQuery extends GraphQLQuery<Query$Query, JsonSerializable> {\n  QueryQuery();\n\n  @override\n  final DocumentNode document = QUERY_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = QUERY_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  List<Object?> get props => [document, operationName];\n  @override\n  Query$Query parse(Map<String, dynamic> json) => Query$Query.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/fragments/fragment_glob_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('[Fragment generation]', () {\n    test(\n      'Extracting',\n      () async => testGenerator(\n        query: queryString,\n        schema: r'''\n          schema {\n            query: Query\n          }\n\n          type Query {\n            pokemon(id: String, name: String): Pokemon\n          }\n\n          type Pokemon {\n            id: String!\n            name: String\n            evolutions: [Pokemon]\n            attacks: PokemonAttack\n            weight: PokemonDimension\n          }\n          \n          type PokemonAttack {\n            special: [Attack]\n          }\n          \n          type PokemonDimension {\n            minimum: String\n          }\n          type Attack {\n            name: String\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        builderOptionsMap: {'fragments_glob': '**.frag'},\n        sourceAssetsMap: {'a|fragment.frag': fragmentsString},\n        generateHelpers: true,\n      ),\n    );\n  });\n}\n\nconst fragmentsString = '''\n  fragment Pokemon on Pokemon {\n    id\n    weight {\n      ...weight\n    }\n    attacks {\n      ...pokemonAttack\n    }\n  }\n  \n  fragment weight on PokemonDimension { \n    minimum \n  }\n  \n  fragment pokemonAttack on PokemonAttack {\n    special { \n      ...attack \n    }\n  }\n  \n  fragment attack on Attack { \n    name \n  }\n''';\n\nconst queryString = '''\n  {\n      pokemon(name: \"Pikachu\") {\n        ...Pokemon\n        evolutions {\n          ...Pokemon\n        }\n      }\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Query$_Query'),\n      operationName: r'query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Query$_Query$_Pokemon$_Pokemon'),\n            mixins: [FragmentName(name: r'PokemonMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Query$_Query$_Pokemon'),\n            properties: [\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName:\n                          TypeName(name: r'Query$_Query$_Pokemon$_Pokemon'),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'evolutions'),\n                  isResolveType: false)\n            ],\n            mixins: [FragmentName(name: r'PokemonMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Query$_Query'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'Query$_Query$_Pokemon'),\n                  name: ClassPropertyName(name: r'pokemon'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'PokemonMixin$_PokemonDimension'),\n            mixins: [FragmentName(name: r'WeightMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'PokemonMixin$_PokemonAttack'),\n            mixins: [FragmentName(name: r'PokemonAttackMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'PokemonMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'PokemonMixin$_PokemonDimension'),\n                  name: ClassPropertyName(name: r'weight'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'PokemonMixin$_PokemonAttack'),\n                  name: ClassPropertyName(name: r'attacks'),\n                  isResolveType: false)\n            ]),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'WeightMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'minimum'),\n                  isResolveType: false)\n            ]),\n        ClassDefinition(\n            name: ClassName(name: r'PokemonAttackMixin$_Attack'),\n            mixins: [FragmentName(name: r'AttackMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'PokemonAttackMixin'),\n            properties: [\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: TypeName(name: r'PokemonAttackMixin$_Attack'),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'special'),\n                  isResolveType: false)\n            ]),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'AttackMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'name'),\n                  isResolveType: false)\n            ])\n      ],\n      generateHelpers: true,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\nmixin PokemonMixin {\n  late String id;\n  PokemonMixin$PokemonDimension? weight;\n  PokemonMixin$PokemonAttack? attacks;\n}\nmixin WeightMixin {\n  String? minimum;\n}\nmixin PokemonAttackMixin {\n  List<PokemonAttackMixin$Attack?>? special;\n}\nmixin AttackMixin {\n  String? name;\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Query$Query$Pokemon$Pokemon extends JsonSerializable\n    with EquatableMixin, PokemonMixin {\n  Query$Query$Pokemon$Pokemon();\n\n  factory Query$Query$Pokemon$Pokemon.fromJson(Map<String, dynamic> json) =>\n      _$Query$Query$Pokemon$PokemonFromJson(json);\n\n  @override\n  List<Object?> get props => [id, weight, attacks];\n  @override\n  Map<String, dynamic> toJson() => _$Query$Query$Pokemon$PokemonToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Query$Query$Pokemon extends JsonSerializable\n    with EquatableMixin, PokemonMixin {\n  Query$Query$Pokemon();\n\n  factory Query$Query$Pokemon.fromJson(Map<String, dynamic> json) =>\n      _$Query$Query$PokemonFromJson(json);\n\n  List<Query$Query$Pokemon$Pokemon?>? evolutions;\n\n  @override\n  List<Object?> get props => [id, weight, attacks, evolutions];\n  @override\n  Map<String, dynamic> toJson() => _$Query$Query$PokemonToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Query$Query extends JsonSerializable with EquatableMixin {\n  Query$Query();\n\n  factory Query$Query.fromJson(Map<String, dynamic> json) =>\n      _$Query$QueryFromJson(json);\n\n  Query$Query$Pokemon? pokemon;\n\n  @override\n  List<Object?> get props => [pokemon];\n  @override\n  Map<String, dynamic> toJson() => _$Query$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass PokemonMixin$PokemonDimension extends JsonSerializable\n    with EquatableMixin, WeightMixin {\n  PokemonMixin$PokemonDimension();\n\n  factory PokemonMixin$PokemonDimension.fromJson(Map<String, dynamic> json) =>\n      _$PokemonMixin$PokemonDimensionFromJson(json);\n\n  @override\n  List<Object?> get props => [minimum];\n  @override\n  Map<String, dynamic> toJson() => _$PokemonMixin$PokemonDimensionToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass PokemonMixin$PokemonAttack extends JsonSerializable\n    with EquatableMixin, PokemonAttackMixin {\n  PokemonMixin$PokemonAttack();\n\n  factory PokemonMixin$PokemonAttack.fromJson(Map<String, dynamic> json) =>\n      _$PokemonMixin$PokemonAttackFromJson(json);\n\n  @override\n  List<Object?> get props => [special];\n  @override\n  Map<String, dynamic> toJson() => _$PokemonMixin$PokemonAttackToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass PokemonAttackMixin$Attack extends JsonSerializable\n    with EquatableMixin, AttackMixin {\n  PokemonAttackMixin$Attack();\n\n  factory PokemonAttackMixin$Attack.fromJson(Map<String, dynamic> json) =>\n      _$PokemonAttackMixin$AttackFromJson(json);\n\n  @override\n  List<Object?> get props => [name];\n  @override\n  Map<String, dynamic> toJson() => _$PokemonAttackMixin$AttackToJson(this);\n}\n\nfinal QUERY_QUERY_DOCUMENT_OPERATION_NAME = 'query';\nfinal QUERY_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: null,\n    variableDefinitions: [],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'pokemon'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'name'),\n            value: StringValueNode(\n              value: 'Pikachu',\n              isBlock: false,\n            ),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FragmentSpreadNode(\n            name: NameNode(value: 'Pokemon'),\n            directives: [],\n          ),\n          FieldNode(\n            name: NameNode(value: 'evolutions'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FragmentSpreadNode(\n                name: NameNode(value: 'Pokemon'),\n                directives: [],\n              )\n            ]),\n          ),\n        ]),\n      )\n    ]),\n  ),\n  FragmentDefinitionNode(\n    name: NameNode(value: 'Pokemon'),\n    typeCondition: TypeConditionNode(\n        on: NamedTypeNode(\n      name: NameNode(value: 'Pokemon'),\n      isNonNull: false,\n    )),\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'id'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      ),\n      FieldNode(\n        name: NameNode(value: 'weight'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FragmentSpreadNode(\n            name: NameNode(value: 'weight'),\n            directives: [],\n          )\n        ]),\n      ),\n      FieldNode(\n        name: NameNode(value: 'attacks'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FragmentSpreadNode(\n            name: NameNode(value: 'pokemonAttack'),\n            directives: [],\n          )\n        ]),\n      ),\n    ]),\n  ),\n  FragmentDefinitionNode(\n    name: NameNode(value: 'weight'),\n    typeCondition: TypeConditionNode(\n        on: NamedTypeNode(\n      name: NameNode(value: 'PokemonDimension'),\n      isNonNull: false,\n    )),\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'minimum'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      )\n    ]),\n  ),\n  FragmentDefinitionNode(\n    name: NameNode(value: 'pokemonAttack'),\n    typeCondition: TypeConditionNode(\n        on: NamedTypeNode(\n      name: NameNode(value: 'PokemonAttack'),\n      isNonNull: false,\n    )),\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'special'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FragmentSpreadNode(\n            name: NameNode(value: 'attack'),\n            directives: [],\n          )\n        ]),\n      )\n    ]),\n  ),\n  FragmentDefinitionNode(\n    name: NameNode(value: 'attack'),\n    typeCondition: TypeConditionNode(\n        on: NamedTypeNode(\n      name: NameNode(value: 'Attack'),\n      isNonNull: false,\n    )),\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'name'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      )\n    ]),\n  ),\n]);\n\nclass QueryQuery extends GraphQLQuery<Query$Query, JsonSerializable> {\n  QueryQuery();\n\n  @override\n  final DocumentNode document = QUERY_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = QUERY_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  List<Object?> get props => [document, operationName];\n  @override\n  Query$Query parse(Map<String, dynamic> json) => Query$Query.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/fragments/fragment_multiple_queries_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On fragments', () {\n    test(\n      'One fragment with multiple queries per file',\n      () async => testGenerator(\n        query: r'''\n          query getPokemon($name: String!) {\n            pokemon(name: $name) {\n              ...pokemonFragment\n            }\n          }\n          \n          query getAllPokemons($first: Int!) {\n            pokemons(first: $first) {\n              ...pokemonFragment\n            }\n          }\n        ''',\n        schema: r'''\n         schema {\n            query: Query\n          }\n\n          type Attack {\n            name: String\n            type: String\n            damage: Int\n          }\n          \n          type Pokemon {\n            id: ID!\n            number: String\n            name: String\n            weight: PokemonDimension\n            height: PokemonDimension\n            classification: String\n            types: [String]\n            resistant: [String]\n            attacks: PokemonAttack\n            weaknesses: [String]\n            fleeRate: Float\n            maxCP: Int\n            evolutions: [Pokemon]\n            evolutionRequirements: PokemonEvolutionRequirement\n            maxHP: Int\n            image: String\n          }\n          \n          type PokemonAttack {\n            fast: [Attack]\n            special: [Attack]\n          }\n          \n          type PokemonDimension {\n            minimum: String\n            maximum: String\n          }\n          \n          type PokemonEvolutionRequirement {\n            amount: Int\n            name: String\n          }\n          \n          type Query {\n            pokemons(first: Int!): [Pokemon]\n            pokemon(id: String, name: String): Pokemon\n          }\n\n        ''',\n        builderOptionsMap: {'fragments_glob': '**.frag'},\n        sourceAssetsMap: {'a|fragment.frag': fragmentsString},\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        generateHelpers: true,\n      ),\n    );\n  });\n}\n\nconst fragmentsString = '''\n  fragment pokemonFragment on Pokemon {\n    number\n    name\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'GetPokemon$_Query'),\n      operationName: r'getPokemon',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'GetPokemon$_Query$_Pokemon'),\n            mixins: [FragmentName(name: r'PokemonFragmentMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'GetPokemon$_Query'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'GetPokemon$_Query$_Pokemon'),\n                  name: ClassPropertyName(name: r'pokemon'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'PokemonFragmentMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'number'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'name'),\n                  isResolveType: false)\n            ])\n      ],\n      inputs: [\n        QueryInput(\n            type: DartTypeName(name: r'String', isNonNull: true),\n            name: QueryInputName(name: r'name'))\n      ],\n      generateHelpers: true,\n      suffix: r'Query'),\n  QueryDefinition(\n      name: QueryName(name: r'GetAllPokemons$_Query'),\n      operationName: r'getAllPokemons',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'GetAllPokemons$_Query$_Pokemon'),\n            mixins: [FragmentName(name: r'PokemonFragmentMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'GetAllPokemons$_Query'),\n            properties: [\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName:\n                          TypeName(name: r'GetAllPokemons$_Query$_Pokemon'),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'pokemons'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'PokemonFragmentMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'number'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'name'),\n                  isResolveType: false)\n            ])\n      ],\n      inputs: [\n        QueryInput(\n            type: DartTypeName(name: r'int', isNonNull: true),\n            name: QueryInputName(name: r'first'))\n      ],\n      generateHelpers: true,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\nmixin PokemonFragmentMixin {\n  String? number;\n  String? name;\n}\n\n@JsonSerializable(explicitToJson: true)\nclass GetPokemon$Query$Pokemon extends JsonSerializable\n    with EquatableMixin, PokemonFragmentMixin {\n  GetPokemon$Query$Pokemon();\n\n  factory GetPokemon$Query$Pokemon.fromJson(Map<String, dynamic> json) =>\n      _$GetPokemon$Query$PokemonFromJson(json);\n\n  @override\n  List<Object?> get props => [number, name];\n  @override\n  Map<String, dynamic> toJson() => _$GetPokemon$Query$PokemonToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass GetPokemon$Query extends JsonSerializable with EquatableMixin {\n  GetPokemon$Query();\n\n  factory GetPokemon$Query.fromJson(Map<String, dynamic> json) =>\n      _$GetPokemon$QueryFromJson(json);\n\n  GetPokemon$Query$Pokemon? pokemon;\n\n  @override\n  List<Object?> get props => [pokemon];\n  @override\n  Map<String, dynamic> toJson() => _$GetPokemon$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass GetAllPokemons$Query$Pokemon extends JsonSerializable\n    with EquatableMixin, PokemonFragmentMixin {\n  GetAllPokemons$Query$Pokemon();\n\n  factory GetAllPokemons$Query$Pokemon.fromJson(Map<String, dynamic> json) =>\n      _$GetAllPokemons$Query$PokemonFromJson(json);\n\n  @override\n  List<Object?> get props => [number, name];\n  @override\n  Map<String, dynamic> toJson() => _$GetAllPokemons$Query$PokemonToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass GetAllPokemons$Query extends JsonSerializable with EquatableMixin {\n  GetAllPokemons$Query();\n\n  factory GetAllPokemons$Query.fromJson(Map<String, dynamic> json) =>\n      _$GetAllPokemons$QueryFromJson(json);\n\n  List<GetAllPokemons$Query$Pokemon?>? pokemons;\n\n  @override\n  List<Object?> get props => [pokemons];\n  @override\n  Map<String, dynamic> toJson() => _$GetAllPokemons$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass GetPokemonArguments extends JsonSerializable with EquatableMixin {\n  GetPokemonArguments({required this.name});\n\n  @override\n  factory GetPokemonArguments.fromJson(Map<String, dynamic> json) =>\n      _$GetPokemonArgumentsFromJson(json);\n\n  late String name;\n\n  @override\n  List<Object?> get props => [name];\n  @override\n  Map<String, dynamic> toJson() => _$GetPokemonArgumentsToJson(this);\n}\n\nfinal GET_POKEMON_QUERY_DOCUMENT_OPERATION_NAME = 'getPokemon';\nfinal GET_POKEMON_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'getPokemon'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'name')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'String'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      )\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'pokemon'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'name'),\n            value: VariableNode(name: NameNode(value: 'name')),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FragmentSpreadNode(\n            name: NameNode(value: 'pokemonFragment'),\n            directives: [],\n          )\n        ]),\n      )\n    ]),\n  ),\n  FragmentDefinitionNode(\n    name: NameNode(value: 'pokemonFragment'),\n    typeCondition: TypeConditionNode(\n        on: NamedTypeNode(\n      name: NameNode(value: 'Pokemon'),\n      isNonNull: false,\n    )),\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'number'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      ),\n      FieldNode(\n        name: NameNode(value: 'name'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      ),\n    ]),\n  ),\n]);\n\nclass GetPokemonQuery\n    extends GraphQLQuery<GetPokemon$Query, GetPokemonArguments> {\n  GetPokemonQuery({required this.variables});\n\n  @override\n  final DocumentNode document = GET_POKEMON_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = GET_POKEMON_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final GetPokemonArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  GetPokemon$Query parse(Map<String, dynamic> json) =>\n      GetPokemon$Query.fromJson(json);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass GetAllPokemonsArguments extends JsonSerializable with EquatableMixin {\n  GetAllPokemonsArguments({required this.first});\n\n  @override\n  factory GetAllPokemonsArguments.fromJson(Map<String, dynamic> json) =>\n      _$GetAllPokemonsArgumentsFromJson(json);\n\n  late int first;\n\n  @override\n  List<Object?> get props => [first];\n  @override\n  Map<String, dynamic> toJson() => _$GetAllPokemonsArgumentsToJson(this);\n}\n\nfinal GET_ALL_POKEMONS_QUERY_DOCUMENT_OPERATION_NAME = 'getAllPokemons';\nfinal GET_ALL_POKEMONS_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'getAllPokemons'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'first')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'Int'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      )\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'pokemons'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'first'),\n            value: VariableNode(name: NameNode(value: 'first')),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FragmentSpreadNode(\n            name: NameNode(value: 'pokemonFragment'),\n            directives: [],\n          )\n        ]),\n      )\n    ]),\n  ),\n  FragmentDefinitionNode(\n    name: NameNode(value: 'pokemonFragment'),\n    typeCondition: TypeConditionNode(\n        on: NamedTypeNode(\n      name: NameNode(value: 'Pokemon'),\n      isNonNull: false,\n    )),\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'number'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      ),\n      FieldNode(\n        name: NameNode(value: 'name'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      ),\n    ]),\n  ),\n]);\n\nclass GetAllPokemonsQuery\n    extends GraphQLQuery<GetAllPokemons$Query, GetAllPokemonsArguments> {\n  GetAllPokemonsQuery({required this.variables});\n\n  @override\n  final DocumentNode document = GET_ALL_POKEMONS_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = GET_ALL_POKEMONS_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final GetAllPokemonsArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  GetAllPokemons$Query parse(Map<String, dynamic> json) =>\n      GetAllPokemons$Query.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/fragments/fragment_on_fragments_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On fragment spreads on other fragments', () {\n    test(\n      'Properties will be merged',\n      () async => testGenerator(\n        query: queryString,\n        schema: r'''\n          schema {\n            query: Query\n          }\n\n          type Query {\n            pokemon(id: String, name: String): Pokemon\n          }\n\n          type Pokemon {\n            id: String!\n            name: String\n            number: String\n            evolution: Pokemon\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        builderOptionsMap: {'fragments_glob': '**.frag'},\n        sourceAssetsMap: {'a|fragment.frag': fragmentsString},\n      ),\n    );\n  });\n}\n\nconst fragmentsString = '''\n  fragment PokemonParts on Pokemon {\n    number\n    name\n  }\n  \n  fragment PokemonName on Pokemon {\n    name\n  }\n  \n  fragment Pokemon on Pokemon {\n    id\n    ...PokemonParts\n    evolution {\n      ...PokemonName\n    }\n  }\n''';\n\nconst queryString = '''\n  {\n      pokemon(name: \"Pikachu\") {\n        ...Pokemon\n      }\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Query$_Query'),\n      operationName: r'query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Query$_Query$_Pokemon'),\n            mixins: [\n              FragmentName(name: r'PokemonMixin'),\n              FragmentName(name: r'PokemonPartsMixin')\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Query$_Query'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'Query$_Query$_Pokemon'),\n                  name: ClassPropertyName(name: r'pokemon'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'PokemonMixin$_Pokemon'),\n            mixins: [FragmentName(name: r'PokemonNameMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'PokemonMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'PokemonMixin$_Pokemon'),\n                  name: ClassPropertyName(name: r'evolution'),\n                  isResolveType: false)\n            ]),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'PokemonNameMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'name'),\n                  isResolveType: false)\n            ]),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'PokemonPartsMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'number'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'name'),\n                  isResolveType: false)\n            ])\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\nmixin PokemonMixin {\n  late String id;\n  PokemonMixin$Pokemon? evolution;\n}\nmixin PokemonNameMixin {\n  String? name;\n}\nmixin PokemonPartsMixin {\n  String? number;\n  String? name;\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Query$Query$Pokemon extends JsonSerializable\n    with EquatableMixin, PokemonMixin, PokemonPartsMixin {\n  Query$Query$Pokemon();\n\n  factory Query$Query$Pokemon.fromJson(Map<String, dynamic> json) =>\n      _$Query$Query$PokemonFromJson(json);\n\n  @override\n  List<Object?> get props => [id, evolution, number, name];\n  @override\n  Map<String, dynamic> toJson() => _$Query$Query$PokemonToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Query$Query extends JsonSerializable with EquatableMixin {\n  Query$Query();\n\n  factory Query$Query.fromJson(Map<String, dynamic> json) =>\n      _$Query$QueryFromJson(json);\n\n  Query$Query$Pokemon? pokemon;\n\n  @override\n  List<Object?> get props => [pokemon];\n  @override\n  Map<String, dynamic> toJson() => _$Query$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass PokemonMixin$Pokemon extends JsonSerializable\n    with EquatableMixin, PokemonNameMixin {\n  PokemonMixin$Pokemon();\n\n  factory PokemonMixin$Pokemon.fromJson(Map<String, dynamic> json) =>\n      _$PokemonMixin$PokemonFromJson(json);\n\n  @override\n  List<Object?> get props => [name];\n  @override\n  Map<String, dynamic> toJson() => _$PokemonMixin$PokemonToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/fragments/fragments_multiple_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On fragments multiple', () {\n    test(\n      'Fragments will have their own classes multiple',\n      () async => testGenerator(\n        namingScheme: 'pathedWithFields',\n        query: r'''\n          fragment Dst on Destination {\n            id\n            name\n          }\n\n          fragment Departure on Destination {\n            id\n          }\n\n          query VoyagesData($input: PaginationInput!) {\n            voyages(pagination: $input) {\n              voyages {\n                numberOfReports\n                voyage {\n                  dateFrom\n                  dateTo\n                  id\n                  voyageNumber\n                  arrival {\n                    ...Dst\n                  }\n                  departure {\n                    ...Departure\n                  }\n                }\n              }\n            }\n          }\n        ''',\n        schema: r'''\n          schema {\n            query: Query\n          }\n\n          scalar DateTime\n\n          type Query {\n            voyages(pagination: PaginationInput!): VoyageList!\n          }\n\n          type VoyageList {\n            voyages: [VoyageDetails!]!\n          }\n\n          type VoyageDetails {\n            numberOfReports: Int!\n            voyage: Voyage!\n          }\n\n          type Voyage {\n            arrival: Destination!\n            dateFrom: DateTime!\n            dateTo: DateTime\n            departure: Destination!\n            visitPoint: Destination!\n            id: ID\n            voyageNumber: String!\n          }\n\n          type Destination {\n            id: ID!\n            name: String!\n          }\n          \n          input PaginationInput {\n            limit: Int!\n            offset: Int!\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        generateHelpers: true,\n        builderOptionsMap: {\n          'scalar_mapping': [\n            {\n              'graphql_type': 'DateTime',\n              'dart_type': 'DateTime',\n            },\n          ],\n        },\n      ),\n    );\n  });\n}\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'VoyagesData$_Query'),\n      operationName: r'VoyagesData',\n      classes: [\n        ClassDefinition(\n            name: ClassName(\n                name: r'VoyagesData$_Query$_voyages$_voyages$_voyage$_arrival'),\n            mixins: [FragmentName(name: r'DstMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(\n                name:\n                    r'VoyagesData$_Query$_voyages$_voyages$_voyage$_departure'),\n            mixins: [FragmentName(name: r'DepartureMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(\n                name: r'VoyagesData$_Query$_voyages$_voyages$_voyage'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'DateTime', isNonNull: true),\n                  name: ClassPropertyName(name: r'dateFrom'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'DateTime'),\n                  name: ClassPropertyName(name: r'dateTo'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'voyageNumber'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(\n                      name:\n                          r'VoyagesData$_Query$_voyages$_voyages$_voyage$_arrival',\n                      isNonNull: true),\n                  name: ClassPropertyName(name: r'arrival'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(\n                      name:\n                          r'VoyagesData$_Query$_voyages$_voyages$_voyage$_departure',\n                      isNonNull: true),\n                  name: ClassPropertyName(name: r'departure'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'VoyagesData$_Query$_voyages$_voyages'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'int', isNonNull: true),\n                  name: ClassPropertyName(name: r'numberOfReports'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(\n                      name: r'VoyagesData$_Query$_voyages$_voyages$_voyage',\n                      isNonNull: true),\n                  name: ClassPropertyName(name: r'voyage'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'VoyagesData$_Query$_voyages'),\n            properties: [\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: TypeName(\n                          name: r'VoyagesData$_Query$_voyages$_voyages',\n                          isNonNull: true),\n                      isNonNull: true),\n                  name: ClassPropertyName(name: r'voyages'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'VoyagesData$_Query'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(\n                      name: r'VoyagesData$_Query$_voyages', isNonNull: true),\n                  name: ClassPropertyName(name: r'voyages'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'DstMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'name'),\n                  isResolveType: false)\n            ]),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'DepartureMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false)\n            ]),\n        ClassDefinition(\n            name: ClassName(name: r'PaginationInput'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'int', isNonNull: true),\n                  name: ClassPropertyName(name: r'limit'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'int', isNonNull: true),\n                  name: ClassPropertyName(name: r'offset'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: TypeName(name: r'PaginationInput', isNonNull: true),\n            name: QueryInputName(name: r'input'))\n      ],\n      generateHelpers: true,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\nmixin DstMixin {\n  late String id;\n  late String name;\n}\nmixin DepartureMixin {\n  late String id;\n}\n\n@JsonSerializable(explicitToJson: true)\nclass VoyagesData$Query$Voyages$Voyages$Voyage$Arrival extends JsonSerializable\n    with EquatableMixin, DstMixin {\n  VoyagesData$Query$Voyages$Voyages$Voyage$Arrival();\n\n  factory VoyagesData$Query$Voyages$Voyages$Voyage$Arrival.fromJson(\n          Map<String, dynamic> json) =>\n      _$VoyagesData$Query$Voyages$Voyages$Voyage$ArrivalFromJson(json);\n\n  @override\n  List<Object?> get props => [id, name];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$VoyagesData$Query$Voyages$Voyages$Voyage$ArrivalToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass VoyagesData$Query$Voyages$Voyages$Voyage$Departure\n    extends JsonSerializable with EquatableMixin, DepartureMixin {\n  VoyagesData$Query$Voyages$Voyages$Voyage$Departure();\n\n  factory VoyagesData$Query$Voyages$Voyages$Voyage$Departure.fromJson(\n          Map<String, dynamic> json) =>\n      _$VoyagesData$Query$Voyages$Voyages$Voyage$DepartureFromJson(json);\n\n  @override\n  List<Object?> get props => [id];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$VoyagesData$Query$Voyages$Voyages$Voyage$DepartureToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass VoyagesData$Query$Voyages$Voyages$Voyage extends JsonSerializable\n    with EquatableMixin {\n  VoyagesData$Query$Voyages$Voyages$Voyage();\n\n  factory VoyagesData$Query$Voyages$Voyages$Voyage.fromJson(\n          Map<String, dynamic> json) =>\n      _$VoyagesData$Query$Voyages$Voyages$VoyageFromJson(json);\n\n  late DateTime dateFrom;\n\n  DateTime? dateTo;\n\n  String? id;\n\n  late String voyageNumber;\n\n  late VoyagesData$Query$Voyages$Voyages$Voyage$Arrival arrival;\n\n  late VoyagesData$Query$Voyages$Voyages$Voyage$Departure departure;\n\n  @override\n  List<Object?> get props =>\n      [dateFrom, dateTo, id, voyageNumber, arrival, departure];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$VoyagesData$Query$Voyages$Voyages$VoyageToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass VoyagesData$Query$Voyages$Voyages extends JsonSerializable\n    with EquatableMixin {\n  VoyagesData$Query$Voyages$Voyages();\n\n  factory VoyagesData$Query$Voyages$Voyages.fromJson(\n          Map<String, dynamic> json) =>\n      _$VoyagesData$Query$Voyages$VoyagesFromJson(json);\n\n  late int numberOfReports;\n\n  late VoyagesData$Query$Voyages$Voyages$Voyage voyage;\n\n  @override\n  List<Object?> get props => [numberOfReports, voyage];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$VoyagesData$Query$Voyages$VoyagesToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass VoyagesData$Query$Voyages extends JsonSerializable with EquatableMixin {\n  VoyagesData$Query$Voyages();\n\n  factory VoyagesData$Query$Voyages.fromJson(Map<String, dynamic> json) =>\n      _$VoyagesData$Query$VoyagesFromJson(json);\n\n  late List<VoyagesData$Query$Voyages$Voyages> voyages;\n\n  @override\n  List<Object?> get props => [voyages];\n  @override\n  Map<String, dynamic> toJson() => _$VoyagesData$Query$VoyagesToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass VoyagesData$Query extends JsonSerializable with EquatableMixin {\n  VoyagesData$Query();\n\n  factory VoyagesData$Query.fromJson(Map<String, dynamic> json) =>\n      _$VoyagesData$QueryFromJson(json);\n\n  late VoyagesData$Query$Voyages voyages;\n\n  @override\n  List<Object?> get props => [voyages];\n  @override\n  Map<String, dynamic> toJson() => _$VoyagesData$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass PaginationInput extends JsonSerializable with EquatableMixin {\n  PaginationInput({\n    required this.limit,\n    required this.offset,\n  });\n\n  factory PaginationInput.fromJson(Map<String, dynamic> json) =>\n      _$PaginationInputFromJson(json);\n\n  late int limit;\n\n  late int offset;\n\n  @override\n  List<Object?> get props => [limit, offset];\n  @override\n  Map<String, dynamic> toJson() => _$PaginationInputToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass VoyagesDataArguments extends JsonSerializable with EquatableMixin {\n  VoyagesDataArguments({required this.input});\n\n  @override\n  factory VoyagesDataArguments.fromJson(Map<String, dynamic> json) =>\n      _$VoyagesDataArgumentsFromJson(json);\n\n  late PaginationInput input;\n\n  @override\n  List<Object?> get props => [input];\n  @override\n  Map<String, dynamic> toJson() => _$VoyagesDataArgumentsToJson(this);\n}\n\nfinal VOYAGES_DATA_QUERY_DOCUMENT_OPERATION_NAME = 'VoyagesData';\nfinal VOYAGES_DATA_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'VoyagesData'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'input')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'PaginationInput'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      )\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'voyages'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'pagination'),\n            value: VariableNode(name: NameNode(value: 'input')),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 'voyages'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FieldNode(\n                name: NameNode(value: 'numberOfReports'),\n                alias: null,\n                arguments: [],\n                directives: [],\n                selectionSet: null,\n              ),\n              FieldNode(\n                name: NameNode(value: 'voyage'),\n                alias: null,\n                arguments: [],\n                directives: [],\n                selectionSet: SelectionSetNode(selections: [\n                  FieldNode(\n                    name: NameNode(value: 'dateFrom'),\n                    alias: null,\n                    arguments: [],\n                    directives: [],\n                    selectionSet: null,\n                  ),\n                  FieldNode(\n                    name: NameNode(value: 'dateTo'),\n                    alias: null,\n                    arguments: [],\n                    directives: [],\n                    selectionSet: null,\n                  ),\n                  FieldNode(\n                    name: NameNode(value: 'id'),\n                    alias: null,\n                    arguments: [],\n                    directives: [],\n                    selectionSet: null,\n                  ),\n                  FieldNode(\n                    name: NameNode(value: 'voyageNumber'),\n                    alias: null,\n                    arguments: [],\n                    directives: [],\n                    selectionSet: null,\n                  ),\n                  FieldNode(\n                    name: NameNode(value: 'arrival'),\n                    alias: null,\n                    arguments: [],\n                    directives: [],\n                    selectionSet: SelectionSetNode(selections: [\n                      FragmentSpreadNode(\n                        name: NameNode(value: 'Dst'),\n                        directives: [],\n                      )\n                    ]),\n                  ),\n                  FieldNode(\n                    name: NameNode(value: 'departure'),\n                    alias: null,\n                    arguments: [],\n                    directives: [],\n                    selectionSet: SelectionSetNode(selections: [\n                      FragmentSpreadNode(\n                        name: NameNode(value: 'Departure'),\n                        directives: [],\n                      )\n                    ]),\n                  ),\n                ]),\n              ),\n            ]),\n          )\n        ]),\n      )\n    ]),\n  ),\n  FragmentDefinitionNode(\n    name: NameNode(value: 'Dst'),\n    typeCondition: TypeConditionNode(\n        on: NamedTypeNode(\n      name: NameNode(value: 'Destination'),\n      isNonNull: false,\n    )),\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'id'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      ),\n      FieldNode(\n        name: NameNode(value: 'name'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      ),\n    ]),\n  ),\n  FragmentDefinitionNode(\n    name: NameNode(value: 'Departure'),\n    typeCondition: TypeConditionNode(\n        on: NamedTypeNode(\n      name: NameNode(value: 'Destination'),\n      isNonNull: false,\n    )),\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'id'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: null,\n      )\n    ]),\n  ),\n]);\n\nclass VoyagesDataQuery\n    extends GraphQLQuery<VoyagesData$Query, VoyagesDataArguments> {\n  VoyagesDataQuery({required this.variables});\n\n  @override\n  final DocumentNode document = VOYAGES_DATA_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = VOYAGES_DATA_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final VoyagesDataArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  VoyagesData$Query parse(Map<String, dynamic> json) =>\n      VoyagesData$Query.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/fragments/fragments_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On fragments', () {\n    test(\n      'Fragments will have their own classes',\n      () async => testGenerator(\n        query: r'''\n          fragment myFragment on SomeObject { \n            s, i \n          }\n          \n          query some_query { \n            ...myFragment \n          }\n        ''',\n        schema: r'''\n         schema {\n            query: SomeObject\n          }\n\n          type SomeObject {\n            s: String\n            i: Int\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'SomeQuery$_SomeObject'),\n      operationName: r'some_query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_SomeObject'),\n            mixins: [FragmentName(name: r'MyFragmentMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'MyFragmentMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'int'),\n                  name: ClassPropertyName(name: r'i'),\n                  isResolveType: false)\n            ])\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\nmixin MyFragmentMixin {\n  String? s;\n  int? i;\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$SomeObject extends JsonSerializable\n    with EquatableMixin, MyFragmentMixin {\n  SomeQuery$SomeObject();\n\n  factory SomeQuery$SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$SomeObjectFromJson(json);\n\n  @override\n  List<Object?> get props => [s, i];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$SomeObjectToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/fragments/multiple_references_on_simple_naming_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\n// While we don't have canonical classes generation, we can leverage class\n// deduplication on fragments expansion and use the generated fragment mixin\n// as \"canonical data\" when the fragment is the only selection of the field.\n// Example:\n// someObject {\n//   ...myFragment\n// }\nvoid main() {\n  test(\n    'On multiple reference of same fragment on simple naming',\n    () async => testGenerator(\n      query: r'''\n          fragment myFragment on SomeObject {\n            s, i\n          }\n\n          query some_query {\n            someObject {\n              ...myFragment\n            }\n            moreData {\n              someObject {\n                ...myFragment\n              }\n            }\n          }\n        ''',\n      schema: r'''\n         schema {\n            query: QueryResponse\n          }\n\n          type QueryResponse {\n            someObject: SomeObject\n            moreData: MoreData\n          }\n\n          type MoreData {\n            someObject: SomeObject\n          }\n\n          type SomeObject {\n            s: String\n            i: Int\n          }\n        ''',\n      libraryDefinition: libraryDefinition,\n      generatedFile: generatedFile,\n      namingScheme: 'simple',\n    ),\n  );\n}\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'SomeQuery$_QueryResponse'),\n      operationName: r'some_query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'SomeObject'),\n            mixins: [FragmentName(name: r'MyFragmentMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'SomeObject'),\n            mixins: [FragmentName(name: r'MyFragmentMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'MoreData'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'SomeObject'),\n                  name: ClassPropertyName(name: r'someObject'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_QueryResponse'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'SomeObject'),\n                  name: ClassPropertyName(name: r'someObject'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'MoreData'),\n                  name: ClassPropertyName(name: r'moreData'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'MyFragmentMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'int'),\n                  name: ClassPropertyName(name: r'i'),\n                  isResolveType: false)\n            ])\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\nmixin MyFragmentMixin {\n  String? s;\n  int? i;\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeObject extends JsonSerializable with EquatableMixin, MyFragmentMixin {\n  SomeObject();\n\n  factory SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$SomeObjectFromJson(json);\n\n  @override\n  List<Object?> get props => [s, i];\n  @override\n  Map<String, dynamic> toJson() => _$SomeObjectToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass MoreData extends JsonSerializable with EquatableMixin {\n  MoreData();\n\n  factory MoreData.fromJson(Map<String, dynamic> json) =>\n      _$MoreDataFromJson(json);\n\n  SomeObject? someObject;\n\n  @override\n  List<Object?> get props => [someObject];\n  @override\n  Map<String, dynamic> toJson() => _$MoreDataToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$QueryResponse extends JsonSerializable with EquatableMixin {\n  SomeQuery$QueryResponse();\n\n  factory SomeQuery$QueryResponse.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$QueryResponseFromJson(json);\n\n  SomeObject? someObject;\n\n  MoreData? moreData;\n\n  @override\n  List<Object?> get props => [someObject, moreData];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$QueryResponseToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/interfaces/interface_fragment_glob_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('Interface with fragment globs', () {\n    test(\n      'Should handle correctly when interfaces use external fragments',\n      () async => testGenerator(\n        query: query,\n        namingScheme: 'pathedWithFields',\n        schema: graphQLSchema,\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        builderOptionsMap: {'fragments_glob': '**.frag'},\n        sourceAssetsMap: {\n          'a|fragment.frag': fragmentsString,\n        },\n      ),\n    );\n  });\n}\n\nconst fragmentsString = '''\n  fragment UserFrag on User {\n    id\n    username\n  }\n''';\n\nconst query = r'''\n  query custom($id: ID!) {\n    nodeById(id: $id) {\n      id\n      __typename,\n      ... on User {\n        ...UserFrag\n      }\n      ... on ChatMessage {\n        message\n        user {\n          ...UserFrag\n        }\n      }\n    }\n  }\n''';\n\n// https://graphql-code-generator.com/#live-demo\nfinal String graphQLSchema = r'''\n  scalar String\n  scalar ID\n  \n  schema {\n    query: Query\n  }\n  \n  type Query {\n    nodeById(id: ID!): Node\n    anoterNodeById(id: ID!): Node\n  }\n  \n  interface Node {\n    id: ID!\n  }\n  \n  type User implements Node {\n    id: ID!\n    username: String!\n  }\n  \n  type ChatMessage implements Node {\n    id: ID!\n    message: String!\n    user: User!\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Custom$_Query'),\n      operationName: r'custom',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query$_nodeById$_user'),\n            extension: ClassName(name: r'Custom$_Query$_nodeById'),\n            mixins: [FragmentName(name: r'UserFragMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name:\n                ClassName(name: r'Custom$_Query$_nodeById$_chatMessage$_user'),\n            mixins: [FragmentName(name: r'UserFragMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query$_nodeById$_chatMessage'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'message'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(\n                      name: r'Custom$_Query$_nodeById$_chatMessage$_user',\n                      isNonNull: true),\n                  name: ClassPropertyName(name: r'user'),\n                  isResolveType: false)\n            ],\n            extension: ClassName(name: r'Custom$_Query$_nodeById'),\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query$_nodeById'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'__typename'),\n                  annotations: [r'''JsonKey(name: '__typename')'''],\n                  isResolveType: true)\n            ],\n            factoryPossibilities: {\n              r'User': ClassName(name: r'Custom$_Query$_nodeById$_User'),\n              r'ChatMessage':\n                  ClassName(name: r'Custom$_Query$_nodeById$_ChatMessage')\n            },\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'Custom$_Query$_nodeById'),\n                  name: ClassPropertyName(name: r'nodeById'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'UserFragMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'username'),\n                  isResolveType: false)\n            ])\n      ],\n      inputs: [\n        QueryInput(\n            type: DartTypeName(name: r'String', isNonNull: true),\n            name: QueryInputName(name: r'id'))\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\nmixin UserFragMixin {\n  late String id;\n  late String username;\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$NodeById$User extends Custom$Query$NodeById\n    with EquatableMixin, UserFragMixin {\n  Custom$Query$NodeById$User();\n\n  factory Custom$Query$NodeById$User.fromJson(Map<String, dynamic> json) =>\n      _$Custom$Query$NodeById$UserFromJson(json);\n\n  @override\n  List<Object?> get props => [id, username];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$Query$NodeById$UserToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$NodeById$ChatMessage$User extends JsonSerializable\n    with EquatableMixin, UserFragMixin {\n  Custom$Query$NodeById$ChatMessage$User();\n\n  factory Custom$Query$NodeById$ChatMessage$User.fromJson(\n          Map<String, dynamic> json) =>\n      _$Custom$Query$NodeById$ChatMessage$UserFromJson(json);\n\n  @override\n  List<Object?> get props => [id, username];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$Custom$Query$NodeById$ChatMessage$UserToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$NodeById$ChatMessage extends Custom$Query$NodeById\n    with EquatableMixin {\n  Custom$Query$NodeById$ChatMessage();\n\n  factory Custom$Query$NodeById$ChatMessage.fromJson(\n          Map<String, dynamic> json) =>\n      _$Custom$Query$NodeById$ChatMessageFromJson(json);\n\n  late String message;\n\n  late Custom$Query$NodeById$ChatMessage$User user;\n\n  @override\n  List<Object?> get props => [message, user];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$Custom$Query$NodeById$ChatMessageToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$NodeById extends JsonSerializable with EquatableMixin {\n  Custom$Query$NodeById();\n\n  factory Custom$Query$NodeById.fromJson(Map<String, dynamic> json) {\n    switch (json['__typename'].toString()) {\n      case r'User':\n        return Custom$Query$NodeById$User.fromJson(json);\n      case r'ChatMessage':\n        return Custom$Query$NodeById$ChatMessage.fromJson(json);\n      default:\n    }\n    return _$Custom$Query$NodeByIdFromJson(json);\n  }\n\n  late String id;\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [id, $$typename];\n  @override\n  Map<String, dynamic> toJson() {\n    switch ($$typename) {\n      case r'User':\n        return (this as Custom$Query$NodeById$User).toJson();\n      case r'ChatMessage':\n        return (this as Custom$Query$NodeById$ChatMessage).toJson();\n      default:\n    }\n    return _$Custom$Query$NodeByIdToJson(this);\n  }\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query extends JsonSerializable with EquatableMixin {\n  Custom$Query();\n\n  factory Custom$Query.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryFromJson(json);\n\n  Custom$Query$NodeById? nodeById;\n\n  @override\n  List<Object?> get props => [nodeById];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/interfaces/interface_possible_types_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On types not used by interfaces', () {\n    test(\n      'Those other types are not considered nor generated',\n      () async => testGenerator(\n        query: query,\n        schema: graphQLSchema,\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nconst query = r'''\n  query custom($id: ID!) {\n    nodeById(id: $id) {\n      id\n      __typename\n      ... on User {\n        username\n      }\n      ... on ChatMessage {\n        message\n      }\n    }\n  }\n''';\n\n// https://graphql-code-generator.com/#live-demo\nconst graphQLSchema = '''\n  scalar String\n  scalar ID\n  \n  schema {\n    query: Query\n  }\n  \n  type Query {\n    nodeById(id: ID!): Node\n  }\n  \n  interface Node {\n    id: ID!\n  }\n  \n  type User implements Node {\n    id: ID!\n    username: String!\n  }\n  \n  type OtherEntity implements Node {\n    id: ID!\n    test: String!\n  }\n  \n  type ChatMessage implements Node {\n    id: ID!\n    message: String!\n    user: User!\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Custom$_Query'),\n      operationName: r'custom',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query$_Node$_User'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'username'),\n                  isResolveType: false)\n            ],\n            extension: ClassName(name: r'Custom$_Query$_Node'),\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query$_Node$_ChatMessage'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'message'),\n                  isResolveType: false)\n            ],\n            extension: ClassName(name: r'Custom$_Query$_Node'),\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query$_Node'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'__typename'),\n                  annotations: [r'''JsonKey(name: '__typename')'''],\n                  isResolveType: true)\n            ],\n            factoryPossibilities: {\n              r'User': ClassName(name: r'Custom$_Query$_Node$_User'),\n              r'ChatMessage':\n                  ClassName(name: r'Custom$_Query$_Node$_ChatMessage')\n            },\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'Custom$_Query$_Node'),\n                  name: ClassPropertyName(name: r'nodeById'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      inputs: [\n        QueryInput(\n            type: DartTypeName(name: r'String', isNonNull: true),\n            name: QueryInputName(name: r'id'))\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$Node$User extends Custom$Query$Node with EquatableMixin {\n  Custom$Query$Node$User();\n\n  factory Custom$Query$Node$User.fromJson(Map<String, dynamic> json) =>\n      _$Custom$Query$Node$UserFromJson(json);\n\n  late String username;\n\n  @override\n  List<Object?> get props => [username];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$Query$Node$UserToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$Node$ChatMessage extends Custom$Query$Node\n    with EquatableMixin {\n  Custom$Query$Node$ChatMessage();\n\n  factory Custom$Query$Node$ChatMessage.fromJson(Map<String, dynamic> json) =>\n      _$Custom$Query$Node$ChatMessageFromJson(json);\n\n  late String message;\n\n  @override\n  List<Object?> get props => [message];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$Query$Node$ChatMessageToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$Node extends JsonSerializable with EquatableMixin {\n  Custom$Query$Node();\n\n  factory Custom$Query$Node.fromJson(Map<String, dynamic> json) {\n    switch (json['__typename'].toString()) {\n      case r'User':\n        return Custom$Query$Node$User.fromJson(json);\n      case r'ChatMessage':\n        return Custom$Query$Node$ChatMessage.fromJson(json);\n      default:\n    }\n    return _$Custom$Query$NodeFromJson(json);\n  }\n\n  late String id;\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [id, $$typename];\n  @override\n  Map<String, dynamic> toJson() {\n    switch ($$typename) {\n      case r'User':\n        return (this as Custom$Query$Node$User).toJson();\n      case r'ChatMessage':\n        return (this as Custom$Query$Node$ChatMessage).toJson();\n      default:\n    }\n    return _$Custom$Query$NodeToJson(this);\n  }\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query extends JsonSerializable with EquatableMixin {\n  Custom$Query();\n\n  factory Custom$Query.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryFromJson(json);\n\n  Custom$Query$Node? nodeById;\n\n  @override\n  List<Object?> get props => [nodeById];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/interfaces/interface_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On interfaces', () {\n    test(\n      'On interfaces',\n      () async => testGenerator(\n        query: query,\n        schema: graphQLSchema,\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nconst query = r'''\n  query custom($id: ID!) {\n    nodeById(id: $id) {\n      id\n      __typename\n      ... on User {\n        ...UserFrag\n      }\n      ... on ChatMessage {\n        message\n        user {\n          ...UserFrag\n        }\n      }\n    }\n  }\n  \n  fragment UserFrag on User {\n    id\n    username\n  }\n''';\n\n// https://graphql-code-generator.com/#live-demo\nfinal String graphQLSchema = r'''\n  scalar String\n  scalar ID\n  \n  schema {\n    query: Query\n  }\n  \n  type Query {\n    nodeById(id: ID!): Node\n  }\n  \n  interface Node {\n    id: ID!\n  }\n  \n  type User implements Node {\n    id: ID!\n    username: String!\n  }\n  \n  type ChatMessage implements Node {\n    id: ID!\n    message: String!\n    user: User!\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Custom$_Query'),\n      operationName: r'custom',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query$_Node$_User'),\n            extension: ClassName(name: r'Custom$_Query$_Node'),\n            mixins: [FragmentName(name: r'UserFragMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query$_Node$_ChatMessage$_User'),\n            mixins: [FragmentName(name: r'UserFragMixin')],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query$_Node$_ChatMessage'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'message'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(\n                      name: r'Custom$_Query$_Node$_ChatMessage$_User',\n                      isNonNull: true),\n                  name: ClassPropertyName(name: r'user'),\n                  isResolveType: false)\n            ],\n            extension: ClassName(name: r'Custom$_Query$_Node'),\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query$_Node'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'__typename'),\n                  annotations: [r'''JsonKey(name: '__typename')'''],\n                  isResolveType: true)\n            ],\n            factoryPossibilities: {\n              r'User': ClassName(name: r'Custom$_Query$_Node$_User'),\n              r'ChatMessage':\n                  ClassName(name: r'Custom$_Query$_Node$_ChatMessage')\n            },\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Query'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'Custom$_Query$_Node'),\n                  name: ClassPropertyName(name: r'nodeById'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        FragmentClassDefinition(\n            name: FragmentName(name: r'UserFragMixin'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'username'),\n                  isResolveType: false)\n            ])\n      ],\n      inputs: [\n        QueryInput(\n            type: DartTypeName(name: r'String', isNonNull: true),\n            name: QueryInputName(name: r'id'))\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\nmixin UserFragMixin {\n  late String id;\n  late String username;\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$Node$User extends Custom$Query$Node\n    with EquatableMixin, UserFragMixin {\n  Custom$Query$Node$User();\n\n  factory Custom$Query$Node$User.fromJson(Map<String, dynamic> json) =>\n      _$Custom$Query$Node$UserFromJson(json);\n\n  @override\n  List<Object?> get props => [id, username];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$Query$Node$UserToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$Node$ChatMessage$User extends JsonSerializable\n    with EquatableMixin, UserFragMixin {\n  Custom$Query$Node$ChatMessage$User();\n\n  factory Custom$Query$Node$ChatMessage$User.fromJson(\n          Map<String, dynamic> json) =>\n      _$Custom$Query$Node$ChatMessage$UserFromJson(json);\n\n  @override\n  List<Object?> get props => [id, username];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$Custom$Query$Node$ChatMessage$UserToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$Node$ChatMessage extends Custom$Query$Node\n    with EquatableMixin {\n  Custom$Query$Node$ChatMessage();\n\n  factory Custom$Query$Node$ChatMessage.fromJson(Map<String, dynamic> json) =>\n      _$Custom$Query$Node$ChatMessageFromJson(json);\n\n  late String message;\n\n  late Custom$Query$Node$ChatMessage$User user;\n\n  @override\n  List<Object?> get props => [message, user];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$Query$Node$ChatMessageToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query$Node extends JsonSerializable with EquatableMixin {\n  Custom$Query$Node();\n\n  factory Custom$Query$Node.fromJson(Map<String, dynamic> json) {\n    switch (json['__typename'].toString()) {\n      case r'User':\n        return Custom$Query$Node$User.fromJson(json);\n      case r'ChatMessage':\n        return Custom$Query$Node$ChatMessage.fromJson(json);\n      default:\n    }\n    return _$Custom$Query$NodeFromJson(json);\n  }\n\n  late String id;\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [id, $$typename];\n  @override\n  Map<String, dynamic> toJson() {\n    switch ($$typename) {\n      case r'User':\n        return (this as Custom$Query$Node$User).toJson();\n      case r'ChatMessage':\n        return (this as Custom$Query$Node$ChatMessage).toJson();\n      default:\n    }\n    return _$Custom$Query$NodeToJson(this);\n  }\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Query extends JsonSerializable with EquatableMixin {\n  Custom$Query();\n\n  factory Custom$Query.fromJson(Map<String, dynamic> json) =>\n      _$Custom$QueryFromJson(json);\n\n  Custom$Query$Node? nodeById;\n\n  @override\n  List<Object?> get props => [nodeById];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$QueryToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/multiple_operations_per_file_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../helpers.dart';\n\nvoid main() {\n  group('On generation', () {\n    test(\n      'Allows multiple mutations per file',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          schema {\n            mutation: Mutation\n            query: Query\n          }\n\n          type Mutation {\n            mut(input: Input!): MutationResponse\n          }\n\n          type Query {\n            que(intsNonNullable: [Int]!, stringNullable: String): QueryResponse\n          }\n\n          type QueryResponse {\n            s: String\n            i: Int\n            list(intsNonNullable: [Int]!): [Int]!\n          }\n\n          type MutationResponse {\n            s: String\n          }\n\n          input Input {\n            s: String!\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        generateHelpers: true,\n      ),\n    );\n  });\n}\n\nconst query = r'''\nmutation MutData($input: Input!) {\n  mut(input: $input) {\n    s\n  }\n}\n\nquery QueData($intsNonNullable: [Int]!, $stringNullable: String) {\n  que(intsNonNullable: $intsNonNullable, stringNullable: $stringNullable) {\n    s\n    i\n    list(intsNonNullable: $intsNonNullable)\n  }\n}\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'MutData$_Mutation'),\n      operationName: r'MutData',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'MutData$_Mutation$_MutationResponse'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'MutData$_Mutation'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'MutData$_Mutation$_MutationResponse'),\n                  name: ClassPropertyName(name: r'mut'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Input'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: TypeName(name: r'Input', isNonNull: true),\n            name: QueryInputName(name: r'input'))\n      ],\n      generateHelpers: true,\n      suffix: r'Mutation'),\n  QueryDefinition(\n      name: QueryName(name: r'QueData$_Query'),\n      operationName: r'QueData',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'QueData$_Query$_QueryResponse'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'int'),\n                  name: ClassPropertyName(name: r'i'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: DartTypeName(name: r'int'), isNonNull: true),\n                  name: ClassPropertyName(name: r'list'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'QueData$_Query'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'QueData$_Query$_QueryResponse'),\n                  name: ClassPropertyName(name: r'que'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      inputs: [\n        QueryInput(\n            type: ListOfTypeName(\n                typeName: DartTypeName(name: r'int'), isNonNull: true),\n            name: QueryInputName(name: r'intsNonNullable')),\n        QueryInput(\n            type: DartTypeName(name: r'String'),\n            name: QueryInputName(name: r'stringNullable'))\n      ],\n      generateHelpers: true,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass MutData$Mutation$MutationResponse extends JsonSerializable\n    with EquatableMixin {\n  MutData$Mutation$MutationResponse();\n\n  factory MutData$Mutation$MutationResponse.fromJson(\n          Map<String, dynamic> json) =>\n      _$MutData$Mutation$MutationResponseFromJson(json);\n\n  String? s;\n\n  @override\n  List<Object?> get props => [s];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$MutData$Mutation$MutationResponseToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass MutData$Mutation extends JsonSerializable with EquatableMixin {\n  MutData$Mutation();\n\n  factory MutData$Mutation.fromJson(Map<String, dynamic> json) =>\n      _$MutData$MutationFromJson(json);\n\n  MutData$Mutation$MutationResponse? mut;\n\n  @override\n  List<Object?> get props => [mut];\n  @override\n  Map<String, dynamic> toJson() => _$MutData$MutationToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Input extends JsonSerializable with EquatableMixin {\n  Input({required this.s});\n\n  factory Input.fromJson(Map<String, dynamic> json) => _$InputFromJson(json);\n\n  late String s;\n\n  @override\n  List<Object?> get props => [s];\n  @override\n  Map<String, dynamic> toJson() => _$InputToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass QueData$Query$QueryResponse extends JsonSerializable with EquatableMixin {\n  QueData$Query$QueryResponse();\n\n  factory QueData$Query$QueryResponse.fromJson(Map<String, dynamic> json) =>\n      _$QueData$Query$QueryResponseFromJson(json);\n\n  String? s;\n\n  int? i;\n\n  late List<int?> list;\n\n  @override\n  List<Object?> get props => [s, i, list];\n  @override\n  Map<String, dynamic> toJson() => _$QueData$Query$QueryResponseToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass QueData$Query extends JsonSerializable with EquatableMixin {\n  QueData$Query();\n\n  factory QueData$Query.fromJson(Map<String, dynamic> json) =>\n      _$QueData$QueryFromJson(json);\n\n  QueData$Query$QueryResponse? que;\n\n  @override\n  List<Object?> get props => [que];\n  @override\n  Map<String, dynamic> toJson() => _$QueData$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass MutDataArguments extends JsonSerializable with EquatableMixin {\n  MutDataArguments({required this.input});\n\n  @override\n  factory MutDataArguments.fromJson(Map<String, dynamic> json) =>\n      _$MutDataArgumentsFromJson(json);\n\n  late Input input;\n\n  @override\n  List<Object?> get props => [input];\n  @override\n  Map<String, dynamic> toJson() => _$MutDataArgumentsToJson(this);\n}\n\nfinal MUT_DATA_MUTATION_DOCUMENT_OPERATION_NAME = 'MutData';\nfinal MUT_DATA_MUTATION_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.mutation,\n    name: NameNode(value: 'MutData'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'input')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'Input'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      )\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'mut'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'input'),\n            value: VariableNode(name: NameNode(value: 'input')),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 's'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          )\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass MutDataMutation extends GraphQLQuery<MutData$Mutation, MutDataArguments> {\n  MutDataMutation({required this.variables});\n\n  @override\n  final DocumentNode document = MUT_DATA_MUTATION_DOCUMENT;\n\n  @override\n  final String operationName = MUT_DATA_MUTATION_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final MutDataArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  MutData$Mutation parse(Map<String, dynamic> json) =>\n      MutData$Mutation.fromJson(json);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass QueDataArguments extends JsonSerializable with EquatableMixin {\n  QueDataArguments({\n    required this.intsNonNullable,\n    this.stringNullable,\n  });\n\n  @override\n  factory QueDataArguments.fromJson(Map<String, dynamic> json) =>\n      _$QueDataArgumentsFromJson(json);\n\n  late List<int?> intsNonNullable;\n\n  final String? stringNullable;\n\n  @override\n  List<Object?> get props => [intsNonNullable, stringNullable];\n  @override\n  Map<String, dynamic> toJson() => _$QueDataArgumentsToJson(this);\n}\n\nfinal QUE_DATA_QUERY_DOCUMENT_OPERATION_NAME = 'QueData';\nfinal QUE_DATA_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'QueData'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'intsNonNullable')),\n        type: ListTypeNode(\n          type: NamedTypeNode(\n            name: NameNode(value: 'Int'),\n            isNonNull: false,\n          ),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'stringNullable')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'String'),\n          isNonNull: false,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'que'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'intsNonNullable'),\n            value: VariableNode(name: NameNode(value: 'intsNonNullable')),\n          ),\n          ArgumentNode(\n            name: NameNode(value: 'stringNullable'),\n            value: VariableNode(name: NameNode(value: 'stringNullable')),\n          ),\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 's'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n          FieldNode(\n            name: NameNode(value: 'i'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n          FieldNode(\n            name: NameNode(value: 'list'),\n            alias: null,\n            arguments: [\n              ArgumentNode(\n                name: NameNode(value: 'intsNonNullable'),\n                value: VariableNode(name: NameNode(value: 'intsNonNullable')),\n              )\n            ],\n            directives: [],\n            selectionSet: null,\n          ),\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass QueDataQuery extends GraphQLQuery<QueData$Query, QueDataArguments> {\n  QueDataQuery({required this.variables});\n\n  @override\n  final DocumentNode document = QUE_DATA_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = QUE_DATA_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final QueDataArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  QueData$Query parse(Map<String, dynamic> json) =>\n      QueData$Query.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/multiple_queries_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../helpers.dart';\n\nvoid main() {\n  group('On multiple queries', () {\n    test(\n      'Header and part should only be included once',\n      () async => testGenerator(\n        query: r'query some_query { s, i }',\n        schema: r'''\n            schema {\n              query: SomeObject\n            }\n            \n            type SomeObject {\n              s: String\n              i: Int\n            }\n          ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        sourceAssetsMap: {\n          'a|queries/another_query.graphql': 'query another_query { s }',\n        },\n      ),\n    );\n  });\n}\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'SomeQuery$_SomeObject'),\n      operationName: r'some_query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_SomeObject'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'int'),\n                  name: ClassPropertyName(name: r'i'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query'),\n  QueryDefinition(\n      name: QueryName(name: r'AnotherQuery$_SomeObject'),\n      operationName: r'another_query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'AnotherQuery$_SomeObject'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$SomeObject extends JsonSerializable with EquatableMixin {\n  SomeQuery$SomeObject();\n\n  factory SomeQuery$SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$SomeObjectFromJson(json);\n\n  String? s;\n\n  int? i;\n\n  @override\n  List<Object?> get props => [s, i];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$SomeObjectToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass AnotherQuery$SomeObject extends JsonSerializable with EquatableMixin {\n  AnotherQuery$SomeObject();\n\n  factory AnotherQuery$SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$AnotherQuery$SomeObjectFromJson(json);\n\n  String? s;\n\n  @override\n  List<Object?> get props => [s];\n  @override\n  Map<String, dynamic> toJson() => _$AnotherQuery$SomeObjectToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/mutations_and_inputs/complex_input_objects_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On complex input objects', () {\n    test(\n      'On complex input objects',\n      () async => testGenerator(\n        query: r'''\n          query some_query($filter: ComplexInput!) {\n            o(filter: $filter) {\n              s\n            }\n          }''',\n        schema: r'''\n          schema {\n            query: QueryRoot\n          }\n\n          type QueryRoot {\n            o(filter: ComplexInput!): SomeObject\n          }\n\n          input ComplexInput {\n            s: String!\n            e: MyEnum\n            ls: [String]\n            i: [[Int]]\n          }\n\n          type SomeObject {\n            s: String\n          }\n\n          enum MyEnum {\n            value1\n            value2\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        generateHelpers: true,\n      ),\n    );\n  });\n}\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'SomeQuery$_QueryRoot'),\n      operationName: r'some_query',\n      classes: [\n        EnumDefinition(name: EnumName(name: r'MyEnum'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'value1')),\n          EnumValueDefinition(name: EnumValueName(name: r'value2')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_QueryRoot$_SomeObject'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_QueryRoot'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'SomeQuery$_QueryRoot$_SomeObject'),\n                  name: ClassPropertyName(name: r'o'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'ComplexInput'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'MyEnum'),\n                  name: ClassPropertyName(name: r'e'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: MyEnum.artemisUnknown)'\n                  ],\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: DartTypeName(name: r'String'),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'ls'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: ListOfTypeName(\n                          typeName: DartTypeName(name: r'int'),\n                          isNonNull: false),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'i'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: TypeName(name: r'ComplexInput', isNonNull: true),\n            name: QueryInputName(name: r'filter'))\n      ],\n      generateHelpers: true,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$QueryRoot$SomeObject extends JsonSerializable\n    with EquatableMixin {\n  SomeQuery$QueryRoot$SomeObject();\n\n  factory SomeQuery$QueryRoot$SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$QueryRoot$SomeObjectFromJson(json);\n\n  String? s;\n\n  @override\n  List<Object?> get props => [s];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$QueryRoot$SomeObjectToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$QueryRoot extends JsonSerializable with EquatableMixin {\n  SomeQuery$QueryRoot();\n\n  factory SomeQuery$QueryRoot.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$QueryRootFromJson(json);\n\n  SomeQuery$QueryRoot$SomeObject? o;\n\n  @override\n  List<Object?> get props => [o];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$QueryRootToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass ComplexInput extends JsonSerializable with EquatableMixin {\n  ComplexInput({\n    required this.s,\n    this.e,\n    this.ls,\n    this.i,\n  });\n\n  factory ComplexInput.fromJson(Map<String, dynamic> json) =>\n      _$ComplexInputFromJson(json);\n\n  late String s;\n\n  @JsonKey(unknownEnumValue: MyEnum.artemisUnknown)\n  MyEnum? e;\n\n  List<String?>? ls;\n\n  List<List<int?>?>? i;\n\n  @override\n  List<Object?> get props => [s, e, ls, i];\n  @override\n  Map<String, dynamic> toJson() => _$ComplexInputToJson(this);\n}\n\nenum MyEnum {\n  @JsonValue('value1')\n  value1,\n  @JsonValue('value2')\n  value2,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQueryArguments extends JsonSerializable with EquatableMixin {\n  SomeQueryArguments({required this.filter});\n\n  @override\n  factory SomeQueryArguments.fromJson(Map<String, dynamic> json) =>\n      _$SomeQueryArgumentsFromJson(json);\n\n  late ComplexInput filter;\n\n  @override\n  List<Object?> get props => [filter];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQueryArgumentsToJson(this);\n}\n\nfinal SOME_QUERY_QUERY_DOCUMENT_OPERATION_NAME = 'some_query';\nfinal SOME_QUERY_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'some_query'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'filter')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'ComplexInput'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      )\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'o'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'filter'),\n            value: VariableNode(name: NameNode(value: 'filter')),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 's'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          )\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass SomeQueryQuery\n    extends GraphQLQuery<SomeQuery$QueryRoot, SomeQueryArguments> {\n  SomeQueryQuery({required this.variables});\n\n  @override\n  final DocumentNode document = SOME_QUERY_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = SOME_QUERY_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final SomeQueryArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  SomeQuery$QueryRoot parse(Map<String, dynamic> json) =>\n      SomeQuery$QueryRoot.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/mutations_and_inputs/custom_scalars_on_input_objects_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On input objects', () {\n    test(\n      'Custom scalars should be coerced',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          scalar MyUuid\n\n          schema {\n            mutation: MutationRoot\n          }\n\n          type MutationRoot {\n            mut(input: Input!, previousId: MyUuid, listIds: [MyUuid]): MutationResponse\n          } \n\n          type MutationResponse {\n            s: String\n          }\n\n          input Input {\n            id: MyUuid!\n            idNullabe: MyUuid\n          }\n          ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        generateHelpers: true,\n        builderOptionsMap: {\n          'scalar_mapping': [\n            {\n              'graphql_type': 'MyUuid',\n              'custom_parser_import': 'package:example/src/custom_parser.dart',\n              'dart_type': {\n                'name': 'MyUuid',\n                'imports': ['package:uuid/uuid.dart'],\n              }\n            },\n          ],\n        },\n      ),\n    );\n  });\n}\n\nconst query = r'''\nmutation custom($input: Input!, $previousId: MyUuid, $listIds: [MyUuid]) {\n  mut(input: $input, previousId: $previousId, listIds: $listIds) {\n    s\n  }\n}\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Custom$_MutationRoot'),\n      operationName: r'custom',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_MutationRoot$_MutationResponse'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_MutationRoot'),\n            properties: [\n              ClassProperty(\n                  type:\n                      TypeName(name: r'Custom$_MutationRoot$_MutationResponse'),\n                  name: ClassPropertyName(name: r'mut'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Input'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'MyUuid', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  annotations: [\n                    r'JsonKey(fromJson: fromGraphQLMyUuidToDartMyUuid, toJson: fromDartMyUuidToGraphQLMyUuid)'\n                  ],\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'MyUuid'),\n                  name: ClassPropertyName(name: r'idNullabe'),\n                  annotations: [\n                    r'JsonKey(fromJson: fromGraphQLMyUuidNullableToDartMyUuidNullable, toJson: fromDartMyUuidNullableToGraphQLMyUuidNullable)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: TypeName(name: r'Input', isNonNull: true),\n            name: QueryInputName(name: r'input')),\n        QueryInput(\n            type: DartTypeName(name: r'MyUuid'),\n            name: QueryInputName(name: r'previousId'),\n            annotations: [\n              r'JsonKey(fromJson: fromGraphQLMyUuidNullableToDartMyUuidNullable, toJson: fromDartMyUuidNullableToGraphQLMyUuidNullable)'\n            ]),\n        QueryInput(\n            type: ListOfTypeName(\n                typeName: DartTypeName(name: r'MyUuid'), isNonNull: false),\n            name: QueryInputName(name: r'listIds'),\n            annotations: [\n              r'JsonKey(fromJson: fromGraphQLListNullableMyUuidNullableToDartListNullableMyUuidNullable, toJson: fromDartListNullableMyUuidNullableToGraphQLListNullableMyUuidNullable)'\n            ])\n      ],\n      generateHelpers: true,\n      suffix: r'Mutation')\n], customImports: [\n  r'package:uuid/uuid.dart',\n  r'package:example/src/custom_parser.dart'\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\nimport 'package:uuid/uuid.dart';\nimport 'package:example/src/custom_parser.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$MutationRoot$MutationResponse extends JsonSerializable\n    with EquatableMixin {\n  Custom$MutationRoot$MutationResponse();\n\n  factory Custom$MutationRoot$MutationResponse.fromJson(\n          Map<String, dynamic> json) =>\n      _$Custom$MutationRoot$MutationResponseFromJson(json);\n\n  String? s;\n\n  @override\n  List<Object?> get props => [s];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$Custom$MutationRoot$MutationResponseToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$MutationRoot extends JsonSerializable with EquatableMixin {\n  Custom$MutationRoot();\n\n  factory Custom$MutationRoot.fromJson(Map<String, dynamic> json) =>\n      _$Custom$MutationRootFromJson(json);\n\n  Custom$MutationRoot$MutationResponse? mut;\n\n  @override\n  List<Object?> get props => [mut];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$MutationRootToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Input extends JsonSerializable with EquatableMixin {\n  Input({\n    required this.id,\n    this.idNullabe,\n  });\n\n  factory Input.fromJson(Map<String, dynamic> json) => _$InputFromJson(json);\n\n  @JsonKey(\n      fromJson: fromGraphQLMyUuidToDartMyUuid,\n      toJson: fromDartMyUuidToGraphQLMyUuid)\n  late MyUuid id;\n\n  @JsonKey(\n      fromJson: fromGraphQLMyUuidNullableToDartMyUuidNullable,\n      toJson: fromDartMyUuidNullableToGraphQLMyUuidNullable)\n  MyUuid? idNullabe;\n\n  @override\n  List<Object?> get props => [id, idNullabe];\n  @override\n  Map<String, dynamic> toJson() => _$InputToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CustomArguments extends JsonSerializable with EquatableMixin {\n  CustomArguments({\n    required this.input,\n    this.previousId,\n    this.listIds,\n  });\n\n  @override\n  factory CustomArguments.fromJson(Map<String, dynamic> json) =>\n      _$CustomArgumentsFromJson(json);\n\n  late Input input;\n\n  @JsonKey(\n      fromJson: fromGraphQLMyUuidNullableToDartMyUuidNullable,\n      toJson: fromDartMyUuidNullableToGraphQLMyUuidNullable)\n  final MyUuid? previousId;\n\n  @JsonKey(\n      fromJson:\n          fromGraphQLListNullableMyUuidNullableToDartListNullableMyUuidNullable,\n      toJson:\n          fromDartListNullableMyUuidNullableToGraphQLListNullableMyUuidNullable)\n  final List<MyUuid?>? listIds;\n\n  @override\n  List<Object?> get props => [input, previousId, listIds];\n  @override\n  Map<String, dynamic> toJson() => _$CustomArgumentsToJson(this);\n}\n\nfinal CUSTOM_MUTATION_DOCUMENT_OPERATION_NAME = 'custom';\nfinal CUSTOM_MUTATION_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.mutation,\n    name: NameNode(value: 'custom'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'input')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'Input'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'previousId')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'MyUuid'),\n          isNonNull: false,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'listIds')),\n        type: ListTypeNode(\n          type: NamedTypeNode(\n            name: NameNode(value: 'MyUuid'),\n            isNonNull: false,\n          ),\n          isNonNull: false,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'mut'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'input'),\n            value: VariableNode(name: NameNode(value: 'input')),\n          ),\n          ArgumentNode(\n            name: NameNode(value: 'previousId'),\n            value: VariableNode(name: NameNode(value: 'previousId')),\n          ),\n          ArgumentNode(\n            name: NameNode(value: 'listIds'),\n            value: VariableNode(name: NameNode(value: 'listIds')),\n          ),\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 's'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          )\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass CustomMutation\n    extends GraphQLQuery<Custom$MutationRoot, CustomArguments> {\n  CustomMutation({required this.variables});\n\n  @override\n  final DocumentNode document = CUSTOM_MUTATION_DOCUMENT;\n\n  @override\n  final String operationName = CUSTOM_MUTATION_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final CustomArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  Custom$MutationRoot parse(Map<String, dynamic> json) =>\n      Custom$MutationRoot.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/mutations_and_inputs/filter_input_objects_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On complex input objects', () {\n    test(\n      'Unused input objects will be filtered out',\n      () async => testGenerator(\n        query: r'''\n          query some_query($input: Input!) {\n            o(input: $input) {\n              s\n            }\n          }''',\n        schema: r'''\n          schema {\n            query: QueryRoot\n          }\n\n          type QueryRoot {\n            o(input: Input!): SomeObject\n          }\n\n          input Input {\n            s: SubInput\n          }\n\n          input SubInput {\n            s: String\n          }\n\n          input UnusedInput {\n            a: String\n            u: UnusedSubInput\n          }\n\n          input UnusedSubInput {\n            a: String\n          }\n\n          type SomeObject {\n            s: String\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        generateHelpers: true,\n      ),\n    );\n  });\n}\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'SomeQuery$_QueryRoot'),\n      operationName: r'some_query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_QueryRoot$_SomeObject'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_QueryRoot'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'SomeQuery$_QueryRoot$_SomeObject'),\n                  name: ClassPropertyName(name: r'o'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Input'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'SubInput'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true),\n        ClassDefinition(\n            name: ClassName(name: r'SubInput'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: TypeName(name: r'Input', isNonNull: true),\n            name: QueryInputName(name: r'input'))\n      ],\n      generateHelpers: true,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$QueryRoot$SomeObject extends JsonSerializable\n    with EquatableMixin {\n  SomeQuery$QueryRoot$SomeObject();\n\n  factory SomeQuery$QueryRoot$SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$QueryRoot$SomeObjectFromJson(json);\n\n  String? s;\n\n  @override\n  List<Object?> get props => [s];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$QueryRoot$SomeObjectToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$QueryRoot extends JsonSerializable with EquatableMixin {\n  SomeQuery$QueryRoot();\n\n  factory SomeQuery$QueryRoot.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$QueryRootFromJson(json);\n\n  SomeQuery$QueryRoot$SomeObject? o;\n\n  @override\n  List<Object?> get props => [o];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$QueryRootToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Input extends JsonSerializable with EquatableMixin {\n  Input({this.s});\n\n  factory Input.fromJson(Map<String, dynamic> json) => _$InputFromJson(json);\n\n  SubInput? s;\n\n  @override\n  List<Object?> get props => [s];\n  @override\n  Map<String, dynamic> toJson() => _$InputToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SubInput extends JsonSerializable with EquatableMixin {\n  SubInput({this.s});\n\n  factory SubInput.fromJson(Map<String, dynamic> json) =>\n      _$SubInputFromJson(json);\n\n  String? s;\n\n  @override\n  List<Object?> get props => [s];\n  @override\n  Map<String, dynamic> toJson() => _$SubInputToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQueryArguments extends JsonSerializable with EquatableMixin {\n  SomeQueryArguments({required this.input});\n\n  @override\n  factory SomeQueryArguments.fromJson(Map<String, dynamic> json) =>\n      _$SomeQueryArgumentsFromJson(json);\n\n  late Input input;\n\n  @override\n  List<Object?> get props => [input];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQueryArgumentsToJson(this);\n}\n\nfinal SOME_QUERY_QUERY_DOCUMENT_OPERATION_NAME = 'some_query';\nfinal SOME_QUERY_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'some_query'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'input')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'Input'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      )\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'o'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'input'),\n            value: VariableNode(name: NameNode(value: 'input')),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 's'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          )\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass SomeQueryQuery\n    extends GraphQLQuery<SomeQuery$QueryRoot, SomeQueryArguments> {\n  SomeQueryQuery({required this.variables});\n\n  @override\n  final DocumentNode document = SOME_QUERY_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = SOME_QUERY_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final SomeQueryArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  SomeQuery$QueryRoot parse(Map<String, dynamic> json) =>\n      SomeQuery$QueryRoot.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/mutations_and_inputs/input_duplication_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('Input duplication', () {\n    test(\n      'The input objects should not duplicate',\n      () async => testGenerator(\n        query: query,\n        namingScheme: 'pathedWithFields',\n        schema: r'''\n          schema {\n            mutation: Mutation\n          }\n\n          type Mutation {\n            mut(input: Input!): MutationResponse\n            mutList(input: [Input!]!): MutationResponse\n          }\n\n          type MutationResponse {\n            s: String\n          }\n\n          input Input {\n            s: String!\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        sourceAssetsMap: {\n          'a|queries/another_query.graphql': anotherQuery,\n        },\n        generateHelpers: true,\n      ),\n    );\n  });\n}\n\nconst query = r'''\nmutation custom($input: Input!) {\n  mut(input: $input) {\n    s\n  }\n}\n''';\n\nconst anotherQuery = r'''\nmutation customList($input: [Input!]!) {\n  mutList(input: $input) {\n    s\n  }\n}\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Custom$_Mutation'),\n      operationName: r'custom',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Mutation$_mut'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Mutation'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'Custom$_Mutation$_mut'),\n                  name: ClassPropertyName(name: r'mut'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Input'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: TypeName(name: r'Input', isNonNull: true),\n            name: QueryInputName(name: r'input'))\n      ],\n      generateHelpers: true,\n      suffix: r'Mutation'),\n  QueryDefinition(\n      name: QueryName(name: r'CustomList$_Mutation'),\n      operationName: r'customList',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'CustomList$_Mutation$_mutList'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'CustomList$_Mutation'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'CustomList$_Mutation$_mutList'),\n                  name: ClassPropertyName(name: r'mutList'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Input'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: ListOfTypeName(\n                typeName: TypeName(name: r'Input', isNonNull: true),\n                isNonNull: true),\n            name: QueryInputName(name: r'input'))\n      ],\n      generateHelpers: true,\n      suffix: r'Mutation')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Mutation$Mut extends JsonSerializable with EquatableMixin {\n  Custom$Mutation$Mut();\n\n  factory Custom$Mutation$Mut.fromJson(Map<String, dynamic> json) =>\n      _$Custom$Mutation$MutFromJson(json);\n\n  String? s;\n\n  @override\n  List<Object?> get props => [s];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$Mutation$MutToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Mutation extends JsonSerializable with EquatableMixin {\n  Custom$Mutation();\n\n  factory Custom$Mutation.fromJson(Map<String, dynamic> json) =>\n      _$Custom$MutationFromJson(json);\n\n  Custom$Mutation$Mut? mut;\n\n  @override\n  List<Object?> get props => [mut];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$MutationToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Input extends JsonSerializable with EquatableMixin {\n  Input({required this.s});\n\n  factory Input.fromJson(Map<String, dynamic> json) => _$InputFromJson(json);\n\n  late String s;\n\n  @override\n  List<Object?> get props => [s];\n  @override\n  Map<String, dynamic> toJson() => _$InputToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CustomList$Mutation$MutList extends JsonSerializable with EquatableMixin {\n  CustomList$Mutation$MutList();\n\n  factory CustomList$Mutation$MutList.fromJson(Map<String, dynamic> json) =>\n      _$CustomList$Mutation$MutListFromJson(json);\n\n  String? s;\n\n  @override\n  List<Object?> get props => [s];\n  @override\n  Map<String, dynamic> toJson() => _$CustomList$Mutation$MutListToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CustomList$Mutation extends JsonSerializable with EquatableMixin {\n  CustomList$Mutation();\n\n  factory CustomList$Mutation.fromJson(Map<String, dynamic> json) =>\n      _$CustomList$MutationFromJson(json);\n\n  CustomList$Mutation$MutList? mutList;\n\n  @override\n  List<Object?> get props => [mutList];\n  @override\n  Map<String, dynamic> toJson() => _$CustomList$MutationToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CustomArguments extends JsonSerializable with EquatableMixin {\n  CustomArguments({required this.input});\n\n  @override\n  factory CustomArguments.fromJson(Map<String, dynamic> json) =>\n      _$CustomArgumentsFromJson(json);\n\n  late Input input;\n\n  @override\n  List<Object?> get props => [input];\n  @override\n  Map<String, dynamic> toJson() => _$CustomArgumentsToJson(this);\n}\n\nfinal CUSTOM_MUTATION_DOCUMENT_OPERATION_NAME = 'custom';\nfinal CUSTOM_MUTATION_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.mutation,\n    name: NameNode(value: 'custom'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'input')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'Input'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      )\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'mut'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'input'),\n            value: VariableNode(name: NameNode(value: 'input')),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 's'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          )\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass CustomMutation extends GraphQLQuery<Custom$Mutation, CustomArguments> {\n  CustomMutation({required this.variables});\n\n  @override\n  final DocumentNode document = CUSTOM_MUTATION_DOCUMENT;\n\n  @override\n  final String operationName = CUSTOM_MUTATION_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final CustomArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  Custom$Mutation parse(Map<String, dynamic> json) =>\n      Custom$Mutation.fromJson(json);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CustomListArguments extends JsonSerializable with EquatableMixin {\n  CustomListArguments({required this.input});\n\n  @override\n  factory CustomListArguments.fromJson(Map<String, dynamic> json) =>\n      _$CustomListArgumentsFromJson(json);\n\n  late List<Input> input;\n\n  @override\n  List<Object?> get props => [input];\n  @override\n  Map<String, dynamic> toJson() => _$CustomListArgumentsToJson(this);\n}\n\nfinal CUSTOM_LIST_MUTATION_DOCUMENT_OPERATION_NAME = 'customList';\nfinal CUSTOM_LIST_MUTATION_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.mutation,\n    name: NameNode(value: 'customList'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'input')),\n        type: ListTypeNode(\n          type: NamedTypeNode(\n            name: NameNode(value: 'Input'),\n            isNonNull: true,\n          ),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      )\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'mutList'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'input'),\n            value: VariableNode(name: NameNode(value: 'input')),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 's'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          )\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass CustomListMutation\n    extends GraphQLQuery<CustomList$Mutation, CustomListArguments> {\n  CustomListMutation({required this.variables});\n\n  @override\n  final DocumentNode document = CUSTOM_LIST_MUTATION_DOCUMENT;\n\n  @override\n  final String operationName = CUSTOM_LIST_MUTATION_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final CustomListArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  CustomList$Mutation parse(Map<String, dynamic> json) =>\n      CustomList$Mutation.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/mutations_and_inputs/mutations_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On mutations', () {\n    test(\n      'The mutation class will be suffixed as Mutation',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          schema {\n            mutation: MutationRoot\n          }\n\n          type MutationRoot {\n            mut(input: Input!): MutationResponse\n            _mut(input: _Input!): _MutationResponse\n          }\n\n          type MutationResponse {\n            s: String\n          }\n\n          type _MutationResponse {\n            _s: String\n          }\n\n          input Input {\n            s: String!\n          }\n\n          input _Input {\n            _s: String!\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        generateHelpers: true,\n        sourceAssetsMap: {\n          'a|queries/another_query.graphql': anotherQuery,\n        },\n      ),\n    );\n  });\n}\n\nconst query = r'''\nmutation custom($input: Input!) {\n  mut(input: $input) {\n    s\n  }\n}\n''';\n\nconst anotherQuery = r'''\nmutation _custom($input: _Input!) {\n  _mut(input: $input) {\n    _s\n  }\n}\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Custom$_MutationRoot'),\n      operationName: r'custom',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_MutationRoot$_MutationResponse'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_MutationRoot'),\n            properties: [\n              ClassProperty(\n                  type:\n                      TypeName(name: r'Custom$_MutationRoot$_MutationResponse'),\n                  name: ClassPropertyName(name: r'mut'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Input'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: TypeName(name: r'Input', isNonNull: true),\n            name: QueryInputName(name: r'input'))\n      ],\n      generateHelpers: true,\n      suffix: r'Mutation'),\n  QueryDefinition(\n      name: QueryName(name: r'$custom$_MutationRoot'),\n      operationName: r'_custom',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'$custom$_MutationRoot$_$MutationResponse'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'_s'),\n                  annotations: [r'''JsonKey(name: '_s')'''],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'$custom$_MutationRoot'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(\n                      name: r'$custom$_MutationRoot$_$MutationResponse'),\n                  name: ClassPropertyName(name: r'_mut'),\n                  annotations: [r'''JsonKey(name: '_mut')'''],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'_Input'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'_s'),\n                  annotations: [r'''JsonKey(name: '_s')'''],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: TypeName(name: r'_Input', isNonNull: true),\n            name: QueryInputName(name: r'input'))\n      ],\n      generateHelpers: true,\n      suffix: r'Mutation')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$MutationRoot$MutationResponse extends JsonSerializable\n    with EquatableMixin {\n  Custom$MutationRoot$MutationResponse();\n\n  factory Custom$MutationRoot$MutationResponse.fromJson(\n          Map<String, dynamic> json) =>\n      _$Custom$MutationRoot$MutationResponseFromJson(json);\n\n  String? s;\n\n  @override\n  List<Object?> get props => [s];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$Custom$MutationRoot$MutationResponseToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$MutationRoot extends JsonSerializable with EquatableMixin {\n  Custom$MutationRoot();\n\n  factory Custom$MutationRoot.fromJson(Map<String, dynamic> json) =>\n      _$Custom$MutationRootFromJson(json);\n\n  Custom$MutationRoot$MutationResponse? mut;\n\n  @override\n  List<Object?> get props => [mut];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$MutationRootToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Input extends JsonSerializable with EquatableMixin {\n  Input({required this.s});\n\n  factory Input.fromJson(Map<String, dynamic> json) => _$InputFromJson(json);\n\n  late String s;\n\n  @override\n  List<Object?> get props => [s];\n  @override\n  Map<String, dynamic> toJson() => _$InputToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass $custom$MutationRoot$$MutationResponse extends JsonSerializable\n    with EquatableMixin {\n  $custom$MutationRoot$$MutationResponse();\n\n  factory $custom$MutationRoot$$MutationResponse.fromJson(\n          Map<String, dynamic> json) =>\n      _$$custom$MutationRoot$$MutationResponseFromJson(json);\n\n  @JsonKey(name: '_s')\n  String? $s;\n\n  @override\n  List<Object?> get props => [$s];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$$custom$MutationRoot$$MutationResponseToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass $custom$MutationRoot extends JsonSerializable with EquatableMixin {\n  $custom$MutationRoot();\n\n  factory $custom$MutationRoot.fromJson(Map<String, dynamic> json) =>\n      _$$custom$MutationRootFromJson(json);\n\n  @JsonKey(name: '_mut')\n  $custom$MutationRoot$$MutationResponse? $mut;\n\n  @override\n  List<Object?> get props => [$mut];\n  @override\n  Map<String, dynamic> toJson() => _$$custom$MutationRootToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass $Input extends JsonSerializable with EquatableMixin {\n  $Input({required this.$s});\n\n  factory $Input.fromJson(Map<String, dynamic> json) => _$$InputFromJson(json);\n\n  @JsonKey(name: '_s')\n  late String $s;\n\n  @override\n  List<Object?> get props => [$s];\n  @override\n  Map<String, dynamic> toJson() => _$$InputToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CustomArguments extends JsonSerializable with EquatableMixin {\n  CustomArguments({required this.input});\n\n  @override\n  factory CustomArguments.fromJson(Map<String, dynamic> json) =>\n      _$CustomArgumentsFromJson(json);\n\n  late Input input;\n\n  @override\n  List<Object?> get props => [input];\n  @override\n  Map<String, dynamic> toJson() => _$CustomArgumentsToJson(this);\n}\n\nfinal CUSTOM_MUTATION_DOCUMENT_OPERATION_NAME = 'custom';\nfinal CUSTOM_MUTATION_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.mutation,\n    name: NameNode(value: 'custom'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'input')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'Input'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      )\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'mut'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'input'),\n            value: VariableNode(name: NameNode(value: 'input')),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 's'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          )\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass CustomMutation\n    extends GraphQLQuery<Custom$MutationRoot, CustomArguments> {\n  CustomMutation({required this.variables});\n\n  @override\n  final DocumentNode document = CUSTOM_MUTATION_DOCUMENT;\n\n  @override\n  final String operationName = CUSTOM_MUTATION_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final CustomArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  Custom$MutationRoot parse(Map<String, dynamic> json) =>\n      Custom$MutationRoot.fromJson(json);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass $customArguments extends JsonSerializable with EquatableMixin {\n  $customArguments({required this.input});\n\n  @override\n  factory $customArguments.fromJson(Map<String, dynamic> json) =>\n      _$$customArgumentsFromJson(json);\n\n  late $Input input;\n\n  @override\n  List<Object?> get props => [input];\n  @override\n  Map<String, dynamic> toJson() => _$$customArgumentsToJson(this);\n}\n\nfinal $CUSTOM_MUTATION_DOCUMENT_OPERATION_NAME = '_custom';\nfinal $CUSTOM_MUTATION_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.mutation,\n    name: NameNode(value: '_custom'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'input')),\n        type: NamedTypeNode(\n          name: NameNode(value: '_Input'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      )\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: '_mut'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'input'),\n            value: VariableNode(name: NameNode(value: 'input')),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: '_s'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          )\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass $customMutation\n    extends GraphQLQuery<$custom$MutationRoot, $customArguments> {\n  $customMutation({required this.variables});\n\n  @override\n  final DocumentNode document = $CUSTOM_MUTATION_DOCUMENT;\n\n  @override\n  final String operationName = $CUSTOM_MUTATION_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final $customArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  $custom$MutationRoot parse(Map<String, dynamic> json) =>\n      $custom$MutationRoot.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/mutations_and_inputs/non_nullable_list_inputs_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On query generation', () {\n    test(\n        'Non-nullability on inputs (considering lists)',\n        () async => testGenerator(\n            query: r'''\n        query some_query($i: Int, $inn: Int!, $li: [Int], $linn: [Int!], $lnni: [Int]!, $lnninn: [Int!]!, $matrix: [[Int]], $matrixnn: [[Int!]!]!) {\n          someQuery(i: $i, inn: $inn, li: $li, linn: $linn, lnni: $lnni, lnninn: $lnninn, matrix: $matrix, matrixnn: $matrixnn) {\n            s\n          }\n        }\n      ''',\n            schema: r'''\n        type Query {\n          someQuery(i: Int, inn: Int!, li: [Int], linn: [Int!], lnni: [Int]!, lnninn: [Int!]!, matrix: [[Int]], matrixnn: [[Int!]!]!): SomeObject\n        }\n\n        type SomeObject {\n          s: String\n        }\n      ''',\n            libraryDefinition:\n                LibraryDefinition(basename: r'query.graphql', queries: [\n              QueryDefinition(\n                  name: QueryName(name: r'SomeQuery$_Query'),\n                  operationName: r'some_query',\n                  classes: [\n                    ClassDefinition(\n                        name: ClassName(name: r'SomeQuery$_Query$_SomeObject'),\n                        properties: [\n                          ClassProperty(\n                              type: DartTypeName(name: r'String'),\n                              name: ClassPropertyName(name: r's'),\n                              isResolveType: false)\n                        ],\n                        factoryPossibilities: {},\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false),\n                    ClassDefinition(\n                        name: ClassName(name: r'SomeQuery$_Query'),\n                        properties: [\n                          ClassProperty(\n                              type: TypeName(\n                                  name: r'SomeQuery$_Query$_SomeObject'),\n                              name: ClassPropertyName(name: r'someQuery'),\n                              isResolveType: false)\n                        ],\n                        factoryPossibilities: {},\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false)\n                  ],\n                  inputs: [\n                    QueryInput(\n                        type: DartTypeName(name: r'int'),\n                        name: QueryInputName(name: r'i')),\n                    QueryInput(\n                        type: DartTypeName(name: r'int', isNonNull: true),\n                        name: QueryInputName(name: r'inn')),\n                    QueryInput(\n                        type: ListOfTypeName(\n                            typeName: DartTypeName(name: r'int'),\n                            isNonNull: false),\n                        name: QueryInputName(name: r'li')),\n                    QueryInput(\n                        type: ListOfTypeName(\n                            typeName:\n                                DartTypeName(name: r'int', isNonNull: true),\n                            isNonNull: false),\n                        name: QueryInputName(name: r'linn')),\n                    QueryInput(\n                        type: ListOfTypeName(\n                            typeName: DartTypeName(name: r'int'),\n                            isNonNull: true),\n                        name: QueryInputName(name: r'lnni')),\n                    QueryInput(\n                        type: ListOfTypeName(\n                            typeName:\n                                DartTypeName(name: r'int', isNonNull: true),\n                            isNonNull: true),\n                        name: QueryInputName(name: r'lnninn')),\n                    QueryInput(\n                        type: ListOfTypeName(\n                            typeName: ListOfTypeName(\n                                typeName: DartTypeName(name: r'int'),\n                                isNonNull: false),\n                            isNonNull: false),\n                        name: QueryInputName(name: r'matrix')),\n                    QueryInput(\n                        type: ListOfTypeName(\n                            typeName: ListOfTypeName(\n                                typeName:\n                                    DartTypeName(name: r'int', isNonNull: true),\n                                isNonNull: true),\n                            isNonNull: true),\n                        name: QueryInputName(name: r'matrixnn'))\n                  ],\n                  generateHelpers: true,\n                  suffix: r'Query')\n            ]),\n            generatedFile: r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$Query$SomeObject extends JsonSerializable with EquatableMixin {\n  SomeQuery$Query$SomeObject();\n\n  factory SomeQuery$Query$SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$Query$SomeObjectFromJson(json);\n\n  String? s;\n\n  @override\n  List<Object?> get props => [s];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$Query$SomeObjectToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$Query extends JsonSerializable with EquatableMixin {\n  SomeQuery$Query();\n\n  factory SomeQuery$Query.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$QueryFromJson(json);\n\n  SomeQuery$Query$SomeObject? someQuery;\n\n  @override\n  List<Object?> get props => [someQuery];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQueryArguments extends JsonSerializable with EquatableMixin {\n  SomeQueryArguments({\n    this.i,\n    required this.inn,\n    this.li,\n    this.linn,\n    required this.lnni,\n    required this.lnninn,\n    this.matrix,\n    required this.matrixnn,\n  });\n\n  @override\n  factory SomeQueryArguments.fromJson(Map<String, dynamic> json) =>\n      _$SomeQueryArgumentsFromJson(json);\n\n  final int? i;\n\n  late int inn;\n\n  final List<int?>? li;\n\n  final List<int>? linn;\n\n  late List<int?> lnni;\n\n  late List<int> lnninn;\n\n  final List<List<int?>?>? matrix;\n\n  late List<List<int>> matrixnn;\n\n  @override\n  List<Object?> get props => [i, inn, li, linn, lnni, lnninn, matrix, matrixnn];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQueryArgumentsToJson(this);\n}\n\nfinal SOME_QUERY_QUERY_DOCUMENT_OPERATION_NAME = 'some_query';\nfinal SOME_QUERY_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'some_query'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'i')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'Int'),\n          isNonNull: false,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'inn')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'Int'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'li')),\n        type: ListTypeNode(\n          type: NamedTypeNode(\n            name: NameNode(value: 'Int'),\n            isNonNull: false,\n          ),\n          isNonNull: false,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'linn')),\n        type: ListTypeNode(\n          type: NamedTypeNode(\n            name: NameNode(value: 'Int'),\n            isNonNull: true,\n          ),\n          isNonNull: false,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'lnni')),\n        type: ListTypeNode(\n          type: NamedTypeNode(\n            name: NameNode(value: 'Int'),\n            isNonNull: false,\n          ),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'lnninn')),\n        type: ListTypeNode(\n          type: NamedTypeNode(\n            name: NameNode(value: 'Int'),\n            isNonNull: true,\n          ),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'matrix')),\n        type: ListTypeNode(\n          type: ListTypeNode(\n            type: NamedTypeNode(\n              name: NameNode(value: 'Int'),\n              isNonNull: false,\n            ),\n            isNonNull: false,\n          ),\n          isNonNull: false,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'matrixnn')),\n        type: ListTypeNode(\n          type: ListTypeNode(\n            type: NamedTypeNode(\n              name: NameNode(value: 'Int'),\n              isNonNull: true,\n            ),\n            isNonNull: true,\n          ),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      ),\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'someQuery'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'i'),\n            value: VariableNode(name: NameNode(value: 'i')),\n          ),\n          ArgumentNode(\n            name: NameNode(value: 'inn'),\n            value: VariableNode(name: NameNode(value: 'inn')),\n          ),\n          ArgumentNode(\n            name: NameNode(value: 'li'),\n            value: VariableNode(name: NameNode(value: 'li')),\n          ),\n          ArgumentNode(\n            name: NameNode(value: 'linn'),\n            value: VariableNode(name: NameNode(value: 'linn')),\n          ),\n          ArgumentNode(\n            name: NameNode(value: 'lnni'),\n            value: VariableNode(name: NameNode(value: 'lnni')),\n          ),\n          ArgumentNode(\n            name: NameNode(value: 'lnninn'),\n            value: VariableNode(name: NameNode(value: 'lnninn')),\n          ),\n          ArgumentNode(\n            name: NameNode(value: 'matrix'),\n            value: VariableNode(name: NameNode(value: 'matrix')),\n          ),\n          ArgumentNode(\n            name: NameNode(value: 'matrixnn'),\n            value: VariableNode(name: NameNode(value: 'matrixnn')),\n          ),\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 's'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          )\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass SomeQueryQuery extends GraphQLQuery<SomeQuery$Query, SomeQueryArguments> {\n  SomeQueryQuery({required this.variables});\n\n  @override\n  final DocumentNode document = SOME_QUERY_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = SOME_QUERY_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final SomeQueryArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  SomeQuery$Query parse(Map<String, dynamic> json) =>\n      SomeQuery$Query.fromJson(json);\n}\n''',\n            generateHelpers: true));\n  });\n}\n"
  },
  {
    "path": "test/query_generator/mutations_and_inputs/recursive_input_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('Recursive input objects', () {\n    test(\n      r'''Artemis won't StackOverflow on recursive input objects''',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          type Mutation {\n            mut(input: Input!): String\n          }\n\n          input Input {\n            and: Input\n            or: Input\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nconst query = r'''\nmutation custom($input: Input!) {\n  mut(input: $input)\n}\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Custom$_Mutation'),\n      operationName: r'custom',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Custom$_Mutation'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'mut'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Input'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'Input'),\n                  name: ClassPropertyName(name: r'and'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'Input'),\n                  name: ClassPropertyName(name: r'or'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: TypeName(name: r'Input', isNonNull: true),\n            name: QueryInputName(name: r'input'))\n      ],\n      generateHelpers: false,\n      suffix: r'Mutation')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Custom$Mutation extends JsonSerializable with EquatableMixin {\n  Custom$Mutation();\n\n  factory Custom$Mutation.fromJson(Map<String, dynamic> json) =>\n      _$Custom$MutationFromJson(json);\n\n  String? mut;\n\n  @override\n  List<Object?> get props => [mut];\n  @override\n  Map<String, dynamic> toJson() => _$Custom$MutationToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Input extends JsonSerializable with EquatableMixin {\n  Input({\n    this.and,\n    this.or,\n  });\n\n  factory Input.fromJson(Map<String, dynamic> json) => _$InputFromJson(json);\n\n  Input? and;\n\n  Input? or;\n\n  @override\n  List<Object?> get props => [and, or];\n  @override\n  Map<String, dynamic> toJson() => _$InputToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/naming/casing_conversion_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On types/fields names', () {\n    test(\n      'Casing will be converted accordingly (and JsonKey names willb e populated accordingly)',\n      () async => testGenerator(\n        query: r'''\n          query some_query($filter: Input!) {\n            query(filter: $filter) {\n              camelCaseField\n              PascalCaseField\n              snake_case_field\n              SCREAMING_SNAKE_CASE_FIELD\n              e\n            }\n            \n          }''',\n        schema: r'''\n          type Query {\n            query(input: Input): SomeObject\n          }\n\n          input Input {\n            camelCaseField: camelCaseTypeInput\n            PascalCaseField: PascalCaseTypeInput\n            snake_case_field: snake_case_type_input\n            SCREAMING_SNAKE_CASE_FIELD: SCREAMING_SNAKE_CASE_TYPE_INPUT\n            e: MyEnum\n          }\n\n          type SomeObject {\n            camelCaseField: camelCaseType\n            PascalCaseField: PascalCaseType\n            snake_case_field: snake_case_type\n            SCREAMING_SNAKE_CASE_FIELD: SCREAMING_SNAKE_CASE_TYPE\n            e: MyEnum\n          }\n\n          type camelCaseType {\n            s: String\n          }\n\n          type PascalCaseType {\n            s: String\n          }\n\n          type snake_case_type {\n            s: String\n          }\n\n          type SCREAMING_SNAKE_CASE_TYPE {\n            s: String\n          }\n\n          type camelCaseTypeInput {\n            s: String\n          }\n\n          type PascalCaseTypeInput {\n            s: String\n          }\n\n          type snake_case_type_input {\n            s: String\n          }\n\n          type SCREAMING_SNAKE_CASE_TYPE_INPUT {\n            s: String\n          }\n\n          enum MyEnum {\n            camelCase\n            PascalCase\n            snake_case\n            SCREAMING_SNAKE_CASE\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        generateHelpers: true,\n        namingScheme: 'simple',\n      ),\n    );\n  });\n}\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'SomeQuery$_Query'),\n      operationName: r'some_query',\n      classes: [\n        EnumDefinition(name: EnumName(name: r'MyEnum'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'camelCase')),\n          EnumValueDefinition(name: EnumValueName(name: r'PascalCase')),\n          EnumValueDefinition(name: EnumValueName(name: r'snake_case')),\n          EnumValueDefinition(\n              name: EnumValueName(name: r'SCREAMING_SNAKE_CASE')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        ClassDefinition(\n            name: ClassName(name: r'SomeObject'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'CamelCaseType'),\n                  name: ClassPropertyName(name: r'camelCaseField'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'PascalCaseType'),\n                  name: ClassPropertyName(name: r'PascalCaseField'),\n                  annotations: [r'''JsonKey(name: 'PascalCaseField')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'SnakeCaseType'),\n                  name: ClassPropertyName(name: r'snake_case_field'),\n                  annotations: [r'''JsonKey(name: 'snake_case_field')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'ScreamingSnakeCaseType'),\n                  name: ClassPropertyName(name: r'SCREAMING_SNAKE_CASE_FIELD'),\n                  annotations: [\n                    r'''JsonKey(name: 'SCREAMING_SNAKE_CASE_FIELD')'''\n                  ],\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'MyEnum'),\n                  name: ClassPropertyName(name: r'e'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: MyEnum.artemisUnknown)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_Query'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'SomeObject'),\n                  name: ClassPropertyName(name: r'query'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'Input'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'CamelCaseTypeInput'),\n                  name: ClassPropertyName(name: r'camelCaseField'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'PascalCaseTypeInput'),\n                  name: ClassPropertyName(name: r'PascalCaseField'),\n                  annotations: [r'''JsonKey(name: 'PascalCaseField')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'SnakeCaseTypeInput'),\n                  name: ClassPropertyName(name: r'snake_case_field'),\n                  annotations: [r'''JsonKey(name: 'snake_case_field')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'ScreamingSnakeCaseTypeInput'),\n                  name: ClassPropertyName(name: r'SCREAMING_SNAKE_CASE_FIELD'),\n                  annotations: [\n                    r'''JsonKey(name: 'SCREAMING_SNAKE_CASE_FIELD')'''\n                  ],\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'MyEnum'),\n                  name: ClassPropertyName(name: r'e'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: MyEnum.artemisUnknown)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: true)\n      ],\n      inputs: [\n        QueryInput(\n            type: TypeName(name: r'Input', isNonNull: true),\n            name: QueryInputName(name: r'filter'))\n      ],\n      generateHelpers: true,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SomeObject extends JsonSerializable with EquatableMixin {\n  SomeObject();\n\n  factory SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$SomeObjectFromJson(json);\n\n  CamelCaseType? camelCaseField;\n\n  @JsonKey(name: 'PascalCaseField')\n  PascalCaseType? pascalCaseField;\n\n  @JsonKey(name: 'snake_case_field')\n  SnakeCaseType? snakeCaseField;\n\n  @JsonKey(name: 'SCREAMING_SNAKE_CASE_FIELD')\n  ScreamingSnakeCaseType? screamingSnakeCaseField;\n\n  @JsonKey(unknownEnumValue: MyEnum.artemisUnknown)\n  MyEnum? e;\n\n  @override\n  List<Object?> get props => [\n        camelCaseField,\n        pascalCaseField,\n        snakeCaseField,\n        screamingSnakeCaseField,\n        e\n      ];\n  @override\n  Map<String, dynamic> toJson() => _$SomeObjectToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$Query extends JsonSerializable with EquatableMixin {\n  SomeQuery$Query();\n\n  factory SomeQuery$Query.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$QueryFromJson(json);\n\n  SomeObject? query;\n\n  @override\n  List<Object?> get props => [query];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$QueryToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass Input extends JsonSerializable with EquatableMixin {\n  Input({\n    this.camelCaseField,\n    this.pascalCaseField,\n    this.snakeCaseField,\n    this.screamingSnakeCaseField,\n    this.e,\n  });\n\n  factory Input.fromJson(Map<String, dynamic> json) => _$InputFromJson(json);\n\n  CamelCaseTypeInput? camelCaseField;\n\n  @JsonKey(name: 'PascalCaseField')\n  PascalCaseTypeInput? pascalCaseField;\n\n  @JsonKey(name: 'snake_case_field')\n  SnakeCaseTypeInput? snakeCaseField;\n\n  @JsonKey(name: 'SCREAMING_SNAKE_CASE_FIELD')\n  ScreamingSnakeCaseTypeInput? screamingSnakeCaseField;\n\n  @JsonKey(unknownEnumValue: MyEnum.artemisUnknown)\n  MyEnum? e;\n\n  @override\n  List<Object?> get props => [\n        camelCaseField,\n        pascalCaseField,\n        snakeCaseField,\n        screamingSnakeCaseField,\n        e\n      ];\n  @override\n  Map<String, dynamic> toJson() => _$InputToJson(this);\n}\n\nenum MyEnum {\n  @JsonValue('camelCase')\n  camelCase,\n  @JsonValue('PascalCase')\n  pascalCase,\n  @JsonValue('snake_case')\n  snakeCase,\n  @JsonValue('SCREAMING_SNAKE_CASE')\n  screamingSnakeCase,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQueryArguments extends JsonSerializable with EquatableMixin {\n  SomeQueryArguments({required this.filter});\n\n  @override\n  factory SomeQueryArguments.fromJson(Map<String, dynamic> json) =>\n      _$SomeQueryArgumentsFromJson(json);\n\n  late Input filter;\n\n  @override\n  List<Object?> get props => [filter];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQueryArgumentsToJson(this);\n}\n\nfinal SOME_QUERY_QUERY_DOCUMENT_OPERATION_NAME = 'some_query';\nfinal SOME_QUERY_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'some_query'),\n    variableDefinitions: [\n      VariableDefinitionNode(\n        variable: VariableNode(name: NameNode(value: 'filter')),\n        type: NamedTypeNode(\n          name: NameNode(value: 'Input'),\n          isNonNull: true,\n        ),\n        defaultValue: DefaultValueNode(value: null),\n        directives: [],\n      )\n    ],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'query'),\n        alias: null,\n        arguments: [\n          ArgumentNode(\n            name: NameNode(value: 'filter'),\n            value: VariableNode(name: NameNode(value: 'filter')),\n          )\n        ],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 'camelCaseField'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n          FieldNode(\n            name: NameNode(value: 'PascalCaseField'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n          FieldNode(\n            name: NameNode(value: 'snake_case_field'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n          FieldNode(\n            name: NameNode(value: 'SCREAMING_SNAKE_CASE_FIELD'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n          FieldNode(\n            name: NameNode(value: 'e'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: null,\n          ),\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass SomeQueryQuery extends GraphQLQuery<SomeQuery$Query, SomeQueryArguments> {\n  SomeQueryQuery({required this.variables});\n\n  @override\n  final DocumentNode document = SOME_QUERY_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = SOME_QUERY_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  final SomeQueryArguments variables;\n\n  @override\n  List<Object?> get props => [document, operationName, variables];\n  @override\n  SomeQuery$Query parse(Map<String, dynamic> json) =>\n      SomeQuery$Query.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/naming/common.dart",
    "content": "const schema = r'''\nenum SomeEnum {\n  e1\n  e2\n}\n\ninput Input {\n  i: String\n  e: SomeEnum\n  s: SubInput\n}\n\ninput SubInput {\n  s: String\n}\n\ntype Thing {\n  id: String\n  e: SomeEnum\n  aThing: Thing\n  bThing: Thing\n  fThing: Thing\n}\n\ntype Query {\n  thing(input: Input!): Thing\n}\n''';\n\nconst query = r'''\nquery big_query($input: Input!) {\n  thing(input: $input) {\n    e\n    ... on Thing {\n      id\n    }\n    ...parts\n    aThing {\n      id\n    }\n    bThing {\n      id\n    }\n    aliasOnAThing: aThing {\n      id\n    }\n  }\n  aliasOnThing: thing(input: $input) {\n    e\n    ... on Thing {\n      id\n    }\n    ...parts\n    aThing {\n      id\n    }\n    bThing {\n      id\n    }\n    aliasOnAThing: aThing {\n      id\n    }\n  }\n}\n\nfragment parts on Thing {\n  id\n  fThing {\n    id\n  }\n  aliasOnFThing: fThing {\n    id\n  }\n}\n''';\n"
  },
  {
    "path": "test/query_generator/naming/pathed_with_fields_test.dart",
    "content": "import 'package:test/test.dart';\n\nimport '../../helpers.dart';\nimport 'common.dart';\n\nvoid main() {\n  group('On naming', () {\n    test(\n      'On pathedWithFields naming scheme',\n      () async => testNaming(\n        query: query,\n        schema: schema,\n        expectedNames: _expectedNames,\n        namingScheme: 'pathedWithFields',\n      ),\n    );\n  });\n}\n\nfinal _expectedNames = [\n  r'SomeEnum',\n  r'BigQuery$Query$Thing$AThing',\n  r'BigQuery$Query$Thing$BThing',\n  r'BigQuery$Query$Thing$AliasOnAThing',\n  r'BigQuery$Query$Thing',\n  r'BigQuery$Query$AliasOnThing$AThing',\n  r'BigQuery$Query$AliasOnThing$BThing',\n  r'BigQuery$Query$AliasOnThing$AliasOnAThing',\n  r'BigQuery$Query$AliasOnThing',\n  r'BigQuery$Query',\n  r'PartsMixin$FThing',\n  r'PartsMixin$AliasOnFThing',\n  r'PartsMixin',\n  r'Input',\n  r'SubInput'\n];\n"
  },
  {
    "path": "test/query_generator/naming/simple_naming_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('Simple naming', () {\n    test(\n      'Casing will be converted accordingly (and JsonKey names will be populated accordingly)',\n      () async => testGenerator(\n        query: r'''\n          query ClientEventsData {\n            clientEvents {\n              items {\n                type\n              }\n            }\n          }\n          \n         \n''',\n        schema: r'''\n          type ClientEvent {\n            type: Int!\n          }\n          \n          type ClientEventItem {\n            type: Int!\n          }\n          \n          type ClientEventPage {\n            items: [ClientEventItem!]!\n            totalCount: Int!\n          }\n          \n          type ClientPage {\n            totalCount: Int!\n          }\n          \n          type Query {\n            clientEvents: ClientEventPage!\n            clients: ClientPage!\n          }\n\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        generateHelpers: true,\n        namingScheme: 'simple',\n      ),\n    );\n  });\n}\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'ClientEventsData$_Query'),\n      operationName: r'ClientEventsData',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'ClientEventItem'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'int', isNonNull: true),\n                  name: ClassPropertyName(name: r'type'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'ClientEventPage'),\n            properties: [\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName:\n                          TypeName(name: r'ClientEventItem', isNonNull: true),\n                      isNonNull: true),\n                  name: ClassPropertyName(name: r'items'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'ClientEventsData$_Query'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'ClientEventPage', isNonNull: true),\n                  name: ClassPropertyName(name: r'clientEvents'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: true,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:artemis/artemis.dart';\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass ClientEventItem extends JsonSerializable with EquatableMixin {\n  ClientEventItem();\n\n  factory ClientEventItem.fromJson(Map<String, dynamic> json) =>\n      _$ClientEventItemFromJson(json);\n\n  late int type;\n\n  @override\n  List<Object?> get props => [type];\n  @override\n  Map<String, dynamic> toJson() => _$ClientEventItemToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass ClientEventPage extends JsonSerializable with EquatableMixin {\n  ClientEventPage();\n\n  factory ClientEventPage.fromJson(Map<String, dynamic> json) =>\n      _$ClientEventPageFromJson(json);\n\n  late List<ClientEventItem> items;\n\n  @override\n  List<Object?> get props => [items];\n  @override\n  Map<String, dynamic> toJson() => _$ClientEventPageToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass ClientEventsData$Query extends JsonSerializable with EquatableMixin {\n  ClientEventsData$Query();\n\n  factory ClientEventsData$Query.fromJson(Map<String, dynamic> json) =>\n      _$ClientEventsData$QueryFromJson(json);\n\n  late ClientEventPage clientEvents;\n\n  @override\n  List<Object?> get props => [clientEvents];\n  @override\n  Map<String, dynamic> toJson() => _$ClientEventsData$QueryToJson(this);\n}\n\nfinal CLIENT_EVENTS_DATA_QUERY_DOCUMENT_OPERATION_NAME = 'ClientEventsData';\nfinal CLIENT_EVENTS_DATA_QUERY_DOCUMENT = DocumentNode(definitions: [\n  OperationDefinitionNode(\n    type: OperationType.query,\n    name: NameNode(value: 'ClientEventsData'),\n    variableDefinitions: [],\n    directives: [],\n    selectionSet: SelectionSetNode(selections: [\n      FieldNode(\n        name: NameNode(value: 'clientEvents'),\n        alias: null,\n        arguments: [],\n        directives: [],\n        selectionSet: SelectionSetNode(selections: [\n          FieldNode(\n            name: NameNode(value: 'items'),\n            alias: null,\n            arguments: [],\n            directives: [],\n            selectionSet: SelectionSetNode(selections: [\n              FieldNode(\n                name: NameNode(value: 'type'),\n                alias: null,\n                arguments: [],\n                directives: [],\n                selectionSet: null,\n              )\n            ]),\n          )\n        ]),\n      )\n    ]),\n  )\n]);\n\nclass ClientEventsDataQuery\n    extends GraphQLQuery<ClientEventsData$Query, JsonSerializable> {\n  ClientEventsDataQuery();\n\n  @override\n  final DocumentNode document = CLIENT_EVENTS_DATA_QUERY_DOCUMENT;\n\n  @override\n  final String operationName = CLIENT_EVENTS_DATA_QUERY_DOCUMENT_OPERATION_NAME;\n\n  @override\n  List<Object?> get props => [document, operationName];\n  @override\n  ClientEventsData$Query parse(Map<String, dynamic> json) =>\n      ClientEventsData$Query.fromJson(json);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/nnbd_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../helpers.dart';\n\nvoid main() {\n  group('On nnbd', () {\n    test(\n      'On field selection',\n      () async => testGenerator(\n        query: 'query { nonNullAndSelected, nullableAndSelected }',\n        schema: r'''\n        type Query {\n          nonNullAndSelected: String!\n          nonNullAndNotSelected: String!\n          nullableAndSelected: String\n          nullableAndNotSelected: String\n        }\n      ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: output,\n        generateHelpers: false,\n      ),\n    );\n  });\n\n  test(\n    'On lists and nullability',\n    () async => testGenerator(\n      query: 'query { i, inn, li, linn, lnni, lnninn, matrix, matrixnn }',\n      schema: r'''\n        type Query {\n          i: Int\n          inn: Int!\n          li: [Int]\n          linn: [Int!]\n          lnni: [Int]!\n          lnninn: [Int!]!\n          matrix: [[Int]]\n          matrixnn: [[Int!]!]!\n        }\n      ''',\n      libraryDefinition: listsLibraryDefinition,\n      generatedFile: listsOutput,\n      generateHelpers: false,\n    ),\n  );\n}\n\nfinal libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Query$_Query'),\n      operationName: r'query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Query$_Query'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'nonNullAndSelected'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'nullableAndSelected'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst output = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Query$Query extends JsonSerializable with EquatableMixin {\n  Query$Query();\n\n  factory Query$Query.fromJson(Map<String, dynamic> json) =>\n      _$Query$QueryFromJson(json);\n\n  late String nonNullAndSelected;\n\n  String? nullableAndSelected;\n\n  @override\n  List<Object?> get props => [nonNullAndSelected, nullableAndSelected];\n  @override\n  Map<String, dynamic> toJson() => _$Query$QueryToJson(this);\n}\n''';\n\nfinal listsLibraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Query$_Query'),\n      operationName: r'query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Query$_Query'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'int'),\n                  name: ClassPropertyName(name: r'i'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'int', isNonNull: true),\n                  name: ClassPropertyName(name: r'inn'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: DartTypeName(name: r'int'), isNonNull: false),\n                  name: ClassPropertyName(name: r'li'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: DartTypeName(name: r'int', isNonNull: true),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'linn'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: DartTypeName(name: r'int'), isNonNull: true),\n                  name: ClassPropertyName(name: r'lnni'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: DartTypeName(name: r'int', isNonNull: true),\n                      isNonNull: true),\n                  name: ClassPropertyName(name: r'lnninn'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: ListOfTypeName(\n                          typeName: DartTypeName(name: r'int'),\n                          isNonNull: false),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'matrix'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: ListOfTypeName(\n                          typeName: DartTypeName(name: r'int', isNonNull: true),\n                          isNonNull: true),\n                      isNonNull: true),\n                  name: ClassPropertyName(name: r'matrixnn'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst listsOutput = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Query$Query extends JsonSerializable with EquatableMixin {\n  Query$Query();\n\n  factory Query$Query.fromJson(Map<String, dynamic> json) =>\n      _$Query$QueryFromJson(json);\n\n  int? i;\n\n  late int inn;\n\n  List<int?>? li;\n\n  List<int>? linn;\n\n  late List<int?> lnni;\n\n  late List<int> lnninn;\n\n  List<List<int?>?>? matrix;\n\n  late List<List<int>> matrixnn;\n\n  @override\n  List<Object?> get props => [i, inn, li, linn, lnni, lnninn, matrix, matrixnn];\n  @override\n  Map<String, dynamic> toJson() => _$Query$QueryToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/query_generator_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../helpers.dart';\n\nvoid main() {\n  group('On query generation', () {\n    test(\n        'A simple query yields simple classes',\n        () async => testGenerator(\n            query: 'query some_query { s, i }',\n            schema: r'''\n        schema {\n          query: SomeObject\n        }\n  \n        type SomeObject {\n          s: String\n          i: Int\n        }\n      ''',\n            libraryDefinition:\n                LibraryDefinition(basename: r'query.graphql', queries: [\n              QueryDefinition(\n                  name: QueryName(name: r'SomeQuery$_SomeObject'),\n                  operationName: r'some_query',\n                  classes: [\n                    ClassDefinition(\n                        name: ClassName(name: r'SomeQuery$_SomeObject'),\n                        properties: [\n                          ClassProperty(\n                              type: DartTypeName(name: r'String'),\n                              name: ClassPropertyName(name: r's'),\n                              isResolveType: false),\n                          ClassProperty(\n                              type: DartTypeName(name: r'int'),\n                              name: ClassPropertyName(name: r'i'),\n                              isResolveType: false)\n                        ],\n                        factoryPossibilities: {},\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false)\n                  ],\n                  generateHelpers: false,\n                  suffix: r'Query')\n            ]),\n            generatedFile: r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$SomeObject extends JsonSerializable with EquatableMixin {\n  SomeQuery$SomeObject();\n\n  factory SomeQuery$SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$SomeObjectFromJson(json);\n\n  String? s;\n\n  int? i;\n\n  @override\n  List<Object?> get props => [s, i];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$SomeObjectToJson(this);\n}\n''',\n            generateHelpers: false));\n\n    test(\n        'The selection from query can nest',\n        () async => testGenerator(\n            query: r'''\n            query some_query {\n          s\n          o {\n            st\n            ob {\n              str\n            }\n          }\n        }\n            ''',\n            schema: r'''\n            schema {\n              query: Result\n            }\n\n            type Result {\n              s: String\n              o: SomeObject\n            }\n\n            type SomeObject {\n              st: String\n              ob: [AnotherObject]\n            }\n\n            type AnotherObject {\n              str: String\n            }\n      ''',\n            libraryDefinition:\n                LibraryDefinition(basename: r'query.graphql', queries: [\n              QueryDefinition(\n                  name: QueryName(name: r'SomeQuery$_Result'),\n                  operationName: r'some_query',\n                  classes: [\n                    ClassDefinition(\n                        name: ClassName(\n                            name:\n                                r'SomeQuery$_Result$_SomeObject$_AnotherObject'),\n                        properties: [\n                          ClassProperty(\n                              type: DartTypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'str'),\n                              isResolveType: false)\n                        ],\n                        factoryPossibilities: {},\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false),\n                    ClassDefinition(\n                        name: ClassName(name: r'SomeQuery$_Result$_SomeObject'),\n                        properties: [\n                          ClassProperty(\n                              type: DartTypeName(name: r'String'),\n                              name: ClassPropertyName(name: r'st'),\n                              isResolveType: false),\n                          ClassProperty(\n                              type: ListOfTypeName(\n                                  typeName: TypeName(\n                                      name:\n                                          r'SomeQuery$_Result$_SomeObject$_AnotherObject'),\n                                  isNonNull: false),\n                              name: ClassPropertyName(name: r'ob'),\n                              isResolveType: false)\n                        ],\n                        factoryPossibilities: {},\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false),\n                    ClassDefinition(\n                        name: ClassName(name: r'SomeQuery$_Result'),\n                        properties: [\n                          ClassProperty(\n                              type: DartTypeName(name: r'String'),\n                              name: ClassPropertyName(name: r's'),\n                              isResolveType: false),\n                          ClassProperty(\n                              type: TypeName(\n                                  name: r'SomeQuery$_Result$_SomeObject'),\n                              name: ClassPropertyName(name: r'o'),\n                              isResolveType: false)\n                        ],\n                        factoryPossibilities: {},\n                        typeNameField: ClassPropertyName(name: r'__typename'),\n                        isInput: false)\n                  ],\n                  generateHelpers: false,\n                  suffix: r'Query')\n            ]),\n            generatedFile: r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$Result$SomeObject$AnotherObject extends JsonSerializable\n    with EquatableMixin {\n  SomeQuery$Result$SomeObject$AnotherObject();\n\n  factory SomeQuery$Result$SomeObject$AnotherObject.fromJson(\n          Map<String, dynamic> json) =>\n      _$SomeQuery$Result$SomeObject$AnotherObjectFromJson(json);\n\n  String? str;\n\n  @override\n  List<Object?> get props => [str];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$SomeQuery$Result$SomeObject$AnotherObjectToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$Result$SomeObject extends JsonSerializable with EquatableMixin {\n  SomeQuery$Result$SomeObject();\n\n  factory SomeQuery$Result$SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$Result$SomeObjectFromJson(json);\n\n  String? st;\n\n  List<SomeQuery$Result$SomeObject$AnotherObject?>? ob;\n\n  @override\n  List<Object?> get props => [st, ob];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$Result$SomeObjectToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$Result extends JsonSerializable with EquatableMixin {\n  SomeQuery$Result();\n\n  factory SomeQuery$Result.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$ResultFromJson(json);\n\n  String? s;\n\n  SomeQuery$Result$SomeObject? o;\n\n  @override\n  List<Object?> get props => [s, o];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$ResultToJson(this);\n}\n''',\n            generateHelpers: false));\n  });\n}\n"
  },
  {
    "path": "test/query_generator/scalars/custom_scalars_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On scalars', () {\n    group('On custom scalars', () {\n      test(\n        'If they can be converted to a simple dart class',\n        () async => testGenerator(\n          query: 'query query { a, b }',\n          schema: r'''\n            scalar MyUuid\n            scalar Json\n            \n            schema {\n              query: SomeObject\n            }\n            \n            type SomeObject {\n              a: MyUuid\n              b: Json\n            }\n          ''',\n          libraryDefinition: libraryDefinition,\n          generatedFile: generatedFile,\n          builderOptionsMap: {\n            'scalar_mapping': [\n              {\n                'graphql_type': 'MyUuid',\n                'dart_type': 'String',\n              },\n              {\n                'graphql_type': 'Json',\n                'dart_type': 'Map<String, dynamic>',\n              },\n            ],\n          },\n        ),\n      );\n    });\n\n    test(\n      'When they need custom parser functions',\n      () async => testGenerator(\n        query: 'query query { a }',\n        schema: r'''\n          scalar MyUuid\n\n          schema {\n            query: SomeObject\n          }\n\n          type SomeObject {\n            a: MyUuid\n          }\n        ''',\n        libraryDefinition: libraryDefinitionWithCustomParserFns,\n        generatedFile: generatedFileWithCustomParserFns,\n        builderOptionsMap: {\n          'scalar_mapping': [\n            {\n              'graphql_type': 'MyUuid',\n              'custom_parser_import': 'package:example/src/custom_parser.dart',\n              'dart_type': 'MyDartUuid',\n            },\n          ],\n        },\n      ),\n    );\n\n    test(\n      'When they need custom imports',\n      () async => testGenerator(\n        query: 'query query { a, b, c, d, e, f }',\n        schema: r'''\n          scalar MyUuid\n\n          schema {\n            query: SomeObject\n          }\n\n          type SomeObject {\n            a: MyUuid\n            b: MyUuid!\n            c: [MyUuid!]!\n            d: [MyUuid]\n            e: [MyUuid]!\n            f: [MyUuid!]\n          }\n        ''',\n        libraryDefinition: libraryDefinitionWithCustomImports,\n        generatedFile: generatedFileWithCustomImports,\n        builderOptionsMap: {\n          'scalar_mapping': [\n            {\n              'graphql_type': 'MyUuid',\n              'custom_parser_import': 'package:example/src/custom_parser.dart',\n              'dart_type': {\n                'name': 'MyUuid',\n                'imports': ['package:uuid/uuid.dart'],\n              }\n            },\n          ],\n        },\n      ),\n    );\n  });\n}\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Query$_SomeObject'),\n      operationName: r'query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Query$_SomeObject'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'a'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'Map<String, dynamic>'),\n                  name: ClassPropertyName(name: r'b'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nfinal LibraryDefinition libraryDefinitionWithCustomParserFns =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Query$_SomeObject'),\n      operationName: r'query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Query$_SomeObject'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'MyDartUuid'),\n                  name: ClassPropertyName(name: r'a'),\n                  annotations: [\n                    r'JsonKey(fromJson: fromGraphQLMyUuidNullableToDartMyDartUuidNullable, toJson: fromDartMyDartUuidNullableToGraphQLMyUuidNullable)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n], customImports: [\n  r'package:example/src/custom_parser.dart'\n]);\n\nfinal LibraryDefinition libraryDefinitionWithCustomImports =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Query$_SomeObject'),\n      operationName: r'query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Query$_SomeObject'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'MyUuid'),\n                  name: ClassPropertyName(name: r'a'),\n                  annotations: [\n                    r'JsonKey(fromJson: fromGraphQLMyUuidNullableToDartMyUuidNullable, toJson: fromDartMyUuidNullableToGraphQLMyUuidNullable)'\n                  ],\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'MyUuid', isNonNull: true),\n                  name: ClassPropertyName(name: r'b'),\n                  annotations: [\n                    r'JsonKey(fromJson: fromGraphQLMyUuidToDartMyUuid, toJson: fromDartMyUuidToGraphQLMyUuid)'\n                  ],\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: DartTypeName(name: r'MyUuid', isNonNull: true),\n                      isNonNull: true),\n                  name: ClassPropertyName(name: r'c'),\n                  annotations: [\n                    r'JsonKey(fromJson: fromGraphQLListMyUuidToDartListMyUuid, toJson: fromDartListMyUuidToGraphQLListMyUuid)'\n                  ],\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: DartTypeName(name: r'MyUuid'),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'd'),\n                  annotations: [\n                    r'JsonKey(fromJson: fromGraphQLListNullableMyUuidNullableToDartListNullableMyUuidNullable, toJson: fromDartListNullableMyUuidNullableToGraphQLListNullableMyUuidNullable)'\n                  ],\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: DartTypeName(name: r'MyUuid'), isNonNull: true),\n                  name: ClassPropertyName(name: r'e'),\n                  annotations: [\n                    r'JsonKey(fromJson: fromGraphQLListMyUuidNullableToDartListMyUuidNullable, toJson: fromDartListMyUuidNullableToGraphQLListMyUuidNullable)'\n                  ],\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: DartTypeName(name: r'MyUuid', isNonNull: true),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'f'),\n                  annotations: [\n                    r'JsonKey(fromJson: fromGraphQLListNullableMyUuidToDartListNullableMyUuid, toJson: fromDartListNullableMyUuidToGraphQLListNullableMyUuid)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n], customImports: [\n  r'package:uuid/uuid.dart',\n  r'package:example/src/custom_parser.dart'\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Query$SomeObject extends JsonSerializable with EquatableMixin {\n  Query$SomeObject();\n\n  factory Query$SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$Query$SomeObjectFromJson(json);\n\n  String? a;\n\n  Map<String, dynamic>? b;\n\n  @override\n  List<Object?> get props => [a, b];\n  @override\n  Map<String, dynamic> toJson() => _$Query$SomeObjectToJson(this);\n}\n''';\n\nconst generatedFileWithCustomParserFns =\n    r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\nimport 'package:example/src/custom_parser.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Query$SomeObject extends JsonSerializable with EquatableMixin {\n  Query$SomeObject();\n\n  factory Query$SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$Query$SomeObjectFromJson(json);\n\n  @JsonKey(\n      fromJson: fromGraphQLMyUuidNullableToDartMyDartUuidNullable,\n      toJson: fromDartMyDartUuidNullableToGraphQLMyUuidNullable)\n  MyDartUuid? a;\n\n  @override\n  List<Object?> get props => [a];\n  @override\n  Map<String, dynamic> toJson() => _$Query$SomeObjectToJson(this);\n}\n''';\n\nconst generatedFileWithCustomImports =\n    r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\nimport 'package:uuid/uuid.dart';\nimport 'package:example/src/custom_parser.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Query$SomeObject extends JsonSerializable with EquatableMixin {\n  Query$SomeObject();\n\n  factory Query$SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$Query$SomeObjectFromJson(json);\n\n  @JsonKey(\n      fromJson: fromGraphQLMyUuidNullableToDartMyUuidNullable,\n      toJson: fromDartMyUuidNullableToGraphQLMyUuidNullable)\n  MyUuid? a;\n\n  @JsonKey(\n      fromJson: fromGraphQLMyUuidToDartMyUuid,\n      toJson: fromDartMyUuidToGraphQLMyUuid)\n  late MyUuid b;\n\n  @JsonKey(\n      fromJson: fromGraphQLListMyUuidToDartListMyUuid,\n      toJson: fromDartListMyUuidToGraphQLListMyUuid)\n  late List<MyUuid> c;\n\n  @JsonKey(\n      fromJson:\n          fromGraphQLListNullableMyUuidNullableToDartListNullableMyUuidNullable,\n      toJson:\n          fromDartListNullableMyUuidNullableToGraphQLListNullableMyUuidNullable)\n  List<MyUuid?>? d;\n\n  @JsonKey(\n      fromJson: fromGraphQLListMyUuidNullableToDartListMyUuidNullable,\n      toJson: fromDartListMyUuidNullableToGraphQLListMyUuidNullable)\n  late List<MyUuid?> e;\n\n  @JsonKey(\n      fromJson: fromGraphQLListNullableMyUuidToDartListNullableMyUuid,\n      toJson: fromDartListNullableMyUuidToGraphQLListNullableMyUuid)\n  List<MyUuid>? f;\n\n  @override\n  List<Object?> get props => [a, b, c, d, e, f];\n  @override\n  Map<String, dynamic> toJson() => _$Query$SomeObjectToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/scalars/scalars_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On scalars', () {\n    group('All default GraphQL scalars are parsed correctly', () {\n      test(\n        'If they are defined on schema',\n        () async => testGenerator(\n          schema: r'''\n            scalar Int\n            scalar Float\n            scalar String\n            scalar Boolean\n            scalar ID\n            \n            schema {\n              query: SomeObject\n            }\n            \n            type SomeObject {\n              i: Int\n              f: Float\n              s: String\n              b: Boolean\n              id: ID\n            }\n          ''',\n          query: 'query some_query { i, f, s, b, id }',\n          libraryDefinition: libraryDefinition,\n          generatedFile: generatedFile,\n        ),\n      );\n\n      test(\n        'All default GraphQL scalars are parsed correctly even if they are NOT explicitly defined on schema',\n        () async => testGenerator(\n          schema: r'''\n            schema {\n              query: SomeObject\n            }\n            \n            type SomeObject {\n              i: Int\n              f: Float\n              s: String\n              b: Boolean\n              id: ID\n            }\n          ''',\n          query: query,\n          libraryDefinition: libraryDefinition,\n          generatedFile: generatedFile,\n        ),\n      );\n    });\n  });\n}\n\nfinal String query = 'query some_query { i, f, s, b, id }';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'SomeQuery$_SomeObject'),\n      operationName: r'some_query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_SomeObject'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'int'),\n                  name: ClassPropertyName(name: r'i'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'double'),\n                  name: ClassPropertyName(name: r'f'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r's'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'bool'),\n                  name: ClassPropertyName(name: r'b'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$SomeObject extends JsonSerializable with EquatableMixin {\n  SomeQuery$SomeObject();\n\n  factory SomeQuery$SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$SomeObjectFromJson(json);\n\n  int? i;\n\n  double? f;\n\n  String? s;\n\n  bool? b;\n\n  String? id;\n\n  @override\n  List<Object?> get props => [i, f, s, b, id];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$SomeObjectToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/scalars/unused_custom_scalars_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  group('On unused custom scalars', () {\n    test(\n      'They will not throw if not configured and unused',\n      () async => testGenerator(\n        query: 'query query { a }',\n        schema: r'''\n            scalar MyUuid\n            scalar OtherScalar\n            \n            schema {\n              query: SomeObject\n            }\n            \n            type SomeObject {\n              a: MyUuid\n              b: OtherScalar\n            }\n          ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n        builderOptionsMap: {\n          'scalar_mapping': [\n            {\n              'graphql_type': 'MyUuid',\n              'dart_type': 'String',\n            },\n          ],\n        },\n      ),\n    );\n  });\n}\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'Query$_SomeObject'),\n      operationName: r'query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'Query$_SomeObject'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'a'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass Query$SomeObject extends JsonSerializable with EquatableMixin {\n  Query$SomeObject();\n\n  factory Query$SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$Query$SomeObjectFromJson(json);\n\n  String? a;\n\n  @override\n  List<Object?> get props => [a];\n  @override\n  Map<String, dynamic> toJson() => _$Query$SomeObjectToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/subscription_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:artemis/generator/data/enum_value_definition.dart';\nimport 'package:test/test.dart';\n\nimport '../helpers.dart';\n\nvoid main() {\n  group('On subscription', () {\n    test(\n      'Should process subscription',\n      () async => testGenerator(\n        query: query,\n        schema: r'''\n          schema {\n            query: Query\n            subscription: Subscription\n          }\n          \n          type Call {\n            callID: CallID!\n            localAddress: String!\n            remoteAddress: String!\n            callState: CallState!\n          }\n          \n          enum CallState {\n            Offered\n            Ringing\n            Connecting\n            Connected\n            Initiated\n            Ringback\n            Disconnected\n          }\n          \n          type User {\n            firstName: String!\n            lastName: String!\n            middleName: String\n            userType: UserType!\n          }\n          \n          type CallID {\n            id: Int!\n          }\n          \n          enum UserType {\n            UserManager\n            UserTechLead\n            UserDev\n            UserQA\n          }\n          \n          type Query {\n            user(userID: String!, midName: String): User!\n            allCalls: [Call!]!\n          }\n          \n          type Subscription {\n            newUser: User!\n          }\n        ''',\n        libraryDefinition: libraryDefinition,\n        generatedFile: generatedFile,\n      ),\n    );\n  });\n}\n\nconst query = r'''\n  subscription NewUserSub {\n    newUser {\n      firstName\n      lastName\n      userType\n    }\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'NewUserSub$_Subscription'),\n      operationName: r'NewUserSub',\n      classes: [\n        EnumDefinition(name: EnumName(name: r'UserType'), values: [\n          EnumValueDefinition(name: EnumValueName(name: r'UserManager')),\n          EnumValueDefinition(name: EnumValueName(name: r'UserTechLead')),\n          EnumValueDefinition(name: EnumValueName(name: r'UserDev')),\n          EnumValueDefinition(name: EnumValueName(name: r'UserQA')),\n          EnumValueDefinition(name: EnumValueName(name: r'ARTEMIS_UNKNOWN'))\n        ]),\n        ClassDefinition(\n            name: ClassName(name: r'NewUserSub$_Subscription$_User'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'firstName'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'lastName'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'UserType', isNonNull: true),\n                  name: ClassPropertyName(name: r'userType'),\n                  annotations: [\n                    r'JsonKey(unknownEnumValue: UserType.artemisUnknown)'\n                  ],\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'NewUserSub$_Subscription'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(\n                      name: r'NewUserSub$_Subscription$_User', isNonNull: true),\n                  name: ClassPropertyName(name: r'newUser'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Subscription')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass NewUserSub$Subscription$User extends JsonSerializable\n    with EquatableMixin {\n  NewUserSub$Subscription$User();\n\n  factory NewUserSub$Subscription$User.fromJson(Map<String, dynamic> json) =>\n      _$NewUserSub$Subscription$UserFromJson(json);\n\n  late String firstName;\n\n  late String lastName;\n\n  @JsonKey(unknownEnumValue: UserType.artemisUnknown)\n  late UserType userType;\n\n  @override\n  List<Object?> get props => [firstName, lastName, userType];\n  @override\n  Map<String, dynamic> toJson() => _$NewUserSub$Subscription$UserToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass NewUserSub$Subscription extends JsonSerializable with EquatableMixin {\n  NewUserSub$Subscription();\n\n  factory NewUserSub$Subscription.fromJson(Map<String, dynamic> json) =>\n      _$NewUserSub$SubscriptionFromJson(json);\n\n  late NewUserSub$Subscription$User newUser;\n\n  @override\n  List<Object?> get props => [newUser];\n  @override\n  Map<String, dynamic> toJson() => _$NewUserSub$SubscriptionToJson(this);\n}\n\nenum UserType {\n  @JsonValue('UserManager')\n  userManager,\n  @JsonValue('UserTechLead')\n  userTechLead,\n  @JsonValue('UserDev')\n  userDev,\n  @JsonValue('UserQA')\n  userQA,\n  @JsonValue('ARTEMIS_UNKNOWN')\n  artemisUnknown,\n}\n''';\n"
  },
  {
    "path": "test/query_generator/union/union_types_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  test(\n    'On union types',\n    () async => testGenerator(\n      query: query,\n      schema: graphQLSchema,\n      libraryDefinition: libraryDefinition,\n      generatedFile: generatedFile,\n    ),\n  );\n}\n\nfinal String query = r'''\n  query some_query { \n    o { \n      __typename, \n      ... on TypeA { \n        a\n        _\n        _a\n        _a_a\n        _a_a_\n        _new\n        __typename,\n      }, \n      ... on TypeB { \n        b\n        _\n        _b\n        _b_b\n        _b_b_\n        new\n        IN\n        __typename,\n      } \n    } \n  }\n''';\n\nfinal String graphQLSchema = '''\n  schema {\n    query: SomeObject\n  }\n\n  type SomeObject {\n    o: SomeUnion\n  }\n  \n  union SomeUnion = TypeA | TypeB\n  \n  type TypeA {\n    a: Int\n    _: String\n    _a: String\n    _a_a: String\n    _a_a_: String\n    _new: String    \n  }\n  \n  type TypeB {\n    b: Int\n    _: String\n    _b: String\n    _b_b: String\n    _b_b_: String\n    new: String\n    IN: String\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'SomeQuery$_SomeObject'),\n      operationName: r'some_query',\n      classes: [\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_SomeObject$_SomeUnion$_TypeA'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'int'),\n                  name: ClassPropertyName(name: r'a'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'_'),\n                  annotations: [r'''JsonKey(name: '_')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'_a'),\n                  annotations: [r'''JsonKey(name: '_a')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'_a_a'),\n                  annotations: [r'''JsonKey(name: '_a_a')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'_a_a_'),\n                  annotations: [r'''JsonKey(name: '_a_a_')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'_new'),\n                  annotations: [r'''JsonKey(name: '_new')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'__typename'),\n                  annotations: [r'''JsonKey(name: '__typename')'''],\n                  isResolveType: true)\n            ],\n            extension: ClassName(name: r'SomeQuery$_SomeObject$_SomeUnion'),\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_SomeObject$_SomeUnion$_TypeB'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'int'),\n                  name: ClassPropertyName(name: r'b'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'_'),\n                  annotations: [r'''JsonKey(name: '_')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'_b'),\n                  annotations: [r'''JsonKey(name: '_b')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'_b_b'),\n                  annotations: [r'''JsonKey(name: '_b_b')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'_b_b_'),\n                  annotations: [r'''JsonKey(name: '_b_b_')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'new'),\n                  annotations: [r'''JsonKey(name: 'new')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'IN'),\n                  annotations: [r'''JsonKey(name: 'IN')'''],\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'__typename'),\n                  annotations: [r'''JsonKey(name: '__typename')'''],\n                  isResolveType: true)\n            ],\n            extension: ClassName(name: r'SomeQuery$_SomeObject$_SomeUnion'),\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_SomeObject$_SomeUnion'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'__typename'),\n                  annotations: [r'''JsonKey(name: '__typename')'''],\n                  isResolveType: true)\n            ],\n            factoryPossibilities: {\n              r'TypeA':\n                  ClassName(name: r'SomeQuery$_SomeObject$_SomeUnion$_TypeA'),\n              r'TypeB':\n                  ClassName(name: r'SomeQuery$_SomeObject$_SomeUnion$_TypeB')\n            },\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'SomeQuery$_SomeObject'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'SomeQuery$_SomeObject$_SomeUnion'),\n                  name: ClassPropertyName(name: r'o'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$SomeObject$SomeUnion$TypeA\n    extends SomeQuery$SomeObject$SomeUnion with EquatableMixin {\n  SomeQuery$SomeObject$SomeUnion$TypeA();\n\n  factory SomeQuery$SomeObject$SomeUnion$TypeA.fromJson(\n          Map<String, dynamic> json) =>\n      _$SomeQuery$SomeObject$SomeUnion$TypeAFromJson(json);\n\n  int? a;\n\n  @JsonKey(name: '_')\n  String? $;\n\n  @JsonKey(name: '_a')\n  String? $a;\n\n  @JsonKey(name: '_a_a')\n  String? $aA;\n\n  @JsonKey(name: '_a_a_')\n  String? $aA_;\n\n  @JsonKey(name: '_new')\n  String? $new;\n\n  @JsonKey(name: '__typename')\n  @override\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [a, $, $a, $aA, $aA_, $new, $$typename];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$SomeQuery$SomeObject$SomeUnion$TypeAToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$SomeObject$SomeUnion$TypeB\n    extends SomeQuery$SomeObject$SomeUnion with EquatableMixin {\n  SomeQuery$SomeObject$SomeUnion$TypeB();\n\n  factory SomeQuery$SomeObject$SomeUnion$TypeB.fromJson(\n          Map<String, dynamic> json) =>\n      _$SomeQuery$SomeObject$SomeUnion$TypeBFromJson(json);\n\n  int? b;\n\n  @JsonKey(name: '_')\n  String? $;\n\n  @JsonKey(name: '_b')\n  String? $b;\n\n  @JsonKey(name: '_b_b')\n  String? $bB;\n\n  @JsonKey(name: '_b_b_')\n  String? $bB_;\n\n  @JsonKey(name: 'new')\n  String? kw$new;\n\n  @JsonKey(name: 'IN')\n  String? kw$IN;\n\n  @JsonKey(name: '__typename')\n  @override\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [b, $, $b, $bB, $bB_, kw$new, kw$IN, $$typename];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$SomeQuery$SomeObject$SomeUnion$TypeBToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$SomeObject$SomeUnion extends JsonSerializable\n    with EquatableMixin {\n  SomeQuery$SomeObject$SomeUnion();\n\n  factory SomeQuery$SomeObject$SomeUnion.fromJson(Map<String, dynamic> json) {\n    switch (json['__typename'].toString()) {\n      case r'TypeA':\n        return SomeQuery$SomeObject$SomeUnion$TypeA.fromJson(json);\n      case r'TypeB':\n        return SomeQuery$SomeObject$SomeUnion$TypeB.fromJson(json);\n      default:\n    }\n    return _$SomeQuery$SomeObject$SomeUnionFromJson(json);\n  }\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [$$typename];\n  @override\n  Map<String, dynamic> toJson() {\n    switch ($$typename) {\n      case r'TypeA':\n        return (this as SomeQuery$SomeObject$SomeUnion$TypeA).toJson();\n      case r'TypeB':\n        return (this as SomeQuery$SomeObject$SomeUnion$TypeB).toJson();\n      default:\n    }\n    return _$SomeQuery$SomeObject$SomeUnionToJson(this);\n  }\n}\n\n@JsonSerializable(explicitToJson: true)\nclass SomeQuery$SomeObject extends JsonSerializable with EquatableMixin {\n  SomeQuery$SomeObject();\n\n  factory SomeQuery$SomeObject.fromJson(Map<String, dynamic> json) =>\n      _$SomeQuery$SomeObjectFromJson(json);\n\n  SomeQuery$SomeObject$SomeUnion? o;\n\n  @override\n  List<Object?> get props => [o];\n  @override\n  Map<String, dynamic> toJson() => _$SomeQuery$SomeObjectToJson(this);\n}\n''';\n"
  },
  {
    "path": "test/query_generator/union/union_with_nested_types_test.dart",
    "content": "import 'package:artemis/generator/data/data.dart';\nimport 'package:test/test.dart';\n\nimport '../../helpers.dart';\n\nvoid main() {\n  test(\n    'On union with nested types',\n    () async => testGenerator(\n      query: query,\n      schema: graphQLSchema,\n      libraryDefinition: libraryDefinition,\n      generatedFile: generatedFile,\n    ),\n  );\n}\n\nfinal String query = r'''\n  query checkoutById($checkoutId: ID!) {\n    node(id: $checkoutId) {\n        __typename\n        ...on Checkout {\n            id\n            lineItems {\n                id\n                edges {\n                    edges {\n                        id\n                    }\n                }\n            }\n        }\n    }\n}\n''';\n\nfinal String graphQLSchema = '''\n  schema {\n    query: QueryRoot\n  }\n  \n  interface Node {\n      id: ID!\n  }\n  \n  type Checkout implements Node {\n      id: ID!\n      lineItems: CheckoutLineItemConnection!\n  }\n  \n  type CheckoutLineItem implements Node {\n      id: ID!\n  }\n  \n  type CheckoutLineItemConnection {\n      id: ID!\n      edges: [CheckoutLineItemEdge!]!\n  }\n  \n  type CheckoutLineItemEdge {\n      id: ID!\n      edges: [ImageConnection]\n      node: CheckoutLineItem!\n  }\n  \n  type Image {\n      id: ID\n  }\n  \n  type ImageConnection {\n      id: ID\n      edges: [ImageEdge!]!\n  }\n  \n  type ImageEdge {\n      id: ID!\n      node: Image!\n  }\n  \n  type QueryRoot {\n      node(\n          id: ID!\n      ): Node\n  }\n''';\n\nfinal LibraryDefinition libraryDefinition =\n    LibraryDefinition(basename: r'query.graphql', queries: [\n  QueryDefinition(\n      name: QueryName(name: r'CheckoutById$_QueryRoot'),\n      operationName: r'checkoutById',\n      classes: [\n        ClassDefinition(\n            name: ClassName(\n                name:\n                    r'CheckoutById$_QueryRoot$_Node$_Checkout$_CheckoutLineItemConnection$_CheckoutLineItemEdge$_ImageConnection'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(\n                name:\n                    r'CheckoutById$_QueryRoot$_Node$_Checkout$_CheckoutLineItemConnection$_CheckoutLineItemEdge'),\n            properties: [\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: TypeName(\n                          name:\n                              r'CheckoutById$_QueryRoot$_Node$_Checkout$_CheckoutLineItemConnection$_CheckoutLineItemEdge$_ImageConnection'),\n                      isNonNull: false),\n                  name: ClassPropertyName(name: r'edges'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(\n                name:\n                    r'CheckoutById$_QueryRoot$_Node$_Checkout$_CheckoutLineItemConnection'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: ListOfTypeName(\n                      typeName: TypeName(\n                          name:\n                              r'CheckoutById$_QueryRoot$_Node$_Checkout$_CheckoutLineItemConnection$_CheckoutLineItemEdge',\n                          isNonNull: true),\n                      isNonNull: true),\n                  name: ClassPropertyName(name: r'edges'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'CheckoutById$_QueryRoot$_Node$_Checkout'),\n            properties: [\n              ClassProperty(\n                  type: DartTypeName(name: r'String', isNonNull: true),\n                  name: ClassPropertyName(name: r'id'),\n                  isResolveType: false),\n              ClassProperty(\n                  type: TypeName(\n                      name:\n                          r'CheckoutById$_QueryRoot$_Node$_Checkout$_CheckoutLineItemConnection',\n                      isNonNull: true),\n                  name: ClassPropertyName(name: r'lineItems'),\n                  isResolveType: false)\n            ],\n            extension: ClassName(name: r'CheckoutById$_QueryRoot$_Node'),\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'CheckoutById$_QueryRoot$_Node'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'String'),\n                  name: ClassPropertyName(name: r'__typename'),\n                  annotations: [r'''JsonKey(name: '__typename')'''],\n                  isResolveType: true)\n            ],\n            factoryPossibilities: {\n              r'Checkout':\n                  ClassName(name: r'CheckoutById$_QueryRoot$_Node$_Checkout')\n            },\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false),\n        ClassDefinition(\n            name: ClassName(name: r'CheckoutById$_QueryRoot'),\n            properties: [\n              ClassProperty(\n                  type: TypeName(name: r'CheckoutById$_QueryRoot$_Node'),\n                  name: ClassPropertyName(name: r'node'),\n                  isResolveType: false)\n            ],\n            factoryPossibilities: {},\n            typeNameField: ClassPropertyName(name: r'__typename'),\n            isInput: false)\n      ],\n      inputs: [\n        QueryInput(\n            type: DartTypeName(name: r'String', isNonNull: true),\n            name: QueryInputName(name: r'checkoutId'))\n      ],\n      generateHelpers: false,\n      suffix: r'Query')\n]);\n\nconst generatedFile = r'''// GENERATED CODE - DO NOT MODIFY BY HAND\n\nimport 'package:json_annotation/json_annotation.dart';\nimport 'package:equatable/equatable.dart';\nimport 'package:gql/ast.dart';\npart 'query.graphql.g.dart';\n\n@JsonSerializable(explicitToJson: true)\nclass CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection$CheckoutLineItemEdge$ImageConnection\n    extends JsonSerializable with EquatableMixin {\n  CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection$CheckoutLineItemEdge$ImageConnection();\n\n  factory CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection$CheckoutLineItemEdge$ImageConnection.fromJson(\n          Map<String, dynamic> json) =>\n      _$CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection$CheckoutLineItemEdge$ImageConnectionFromJson(\n          json);\n\n  String? id;\n\n  @override\n  List<Object?> get props => [id];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection$CheckoutLineItemEdge$ImageConnectionToJson(\n          this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection$CheckoutLineItemEdge\n    extends JsonSerializable with EquatableMixin {\n  CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection$CheckoutLineItemEdge();\n\n  factory CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection$CheckoutLineItemEdge.fromJson(\n          Map<String, dynamic> json) =>\n      _$CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection$CheckoutLineItemEdgeFromJson(\n          json);\n\n  List<CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection$CheckoutLineItemEdge$ImageConnection?>?\n      edges;\n\n  @override\n  List<Object?> get props => [edges];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection$CheckoutLineItemEdgeToJson(\n          this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection\n    extends JsonSerializable with EquatableMixin {\n  CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection();\n\n  factory CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection.fromJson(\n          Map<String, dynamic> json) =>\n      _$CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnectionFromJson(\n          json);\n\n  late String id;\n\n  late List<\n          CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection$CheckoutLineItemEdge>\n      edges;\n\n  @override\n  List<Object?> get props => [id, edges];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnectionToJson(\n          this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CheckoutById$QueryRoot$Node$Checkout extends CheckoutById$QueryRoot$Node\n    with EquatableMixin {\n  CheckoutById$QueryRoot$Node$Checkout();\n\n  factory CheckoutById$QueryRoot$Node$Checkout.fromJson(\n          Map<String, dynamic> json) =>\n      _$CheckoutById$QueryRoot$Node$CheckoutFromJson(json);\n\n  late String id;\n\n  late CheckoutById$QueryRoot$Node$Checkout$CheckoutLineItemConnection\n      lineItems;\n\n  @override\n  List<Object?> get props => [id, lineItems];\n  @override\n  Map<String, dynamic> toJson() =>\n      _$CheckoutById$QueryRoot$Node$CheckoutToJson(this);\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CheckoutById$QueryRoot$Node extends JsonSerializable with EquatableMixin {\n  CheckoutById$QueryRoot$Node();\n\n  factory CheckoutById$QueryRoot$Node.fromJson(Map<String, dynamic> json) {\n    switch (json['__typename'].toString()) {\n      case r'Checkout':\n        return CheckoutById$QueryRoot$Node$Checkout.fromJson(json);\n      default:\n    }\n    return _$CheckoutById$QueryRoot$NodeFromJson(json);\n  }\n\n  @JsonKey(name: '__typename')\n  String? $$typename;\n\n  @override\n  List<Object?> get props => [$$typename];\n  @override\n  Map<String, dynamic> toJson() {\n    switch ($$typename) {\n      case r'Checkout':\n        return (this as CheckoutById$QueryRoot$Node$Checkout).toJson();\n      default:\n    }\n    return _$CheckoutById$QueryRoot$NodeToJson(this);\n  }\n}\n\n@JsonSerializable(explicitToJson: true)\nclass CheckoutById$QueryRoot extends JsonSerializable with EquatableMixin {\n  CheckoutById$QueryRoot();\n\n  factory CheckoutById$QueryRoot.fromJson(Map<String, dynamic> json) =>\n      _$CheckoutById$QueryRootFromJson(json);\n\n  CheckoutById$QueryRoot$Node? node;\n\n  @override\n  List<Object?> get props => [node];\n  @override\n  Map<String, dynamic> toJson() => _$CheckoutById$QueryRootToJson(this);\n}\n''';\n"
  },
  {
    "path": "tool/fetch_schema.dart",
    "content": "import 'dart:async';\nimport 'dart:io';\n\nimport 'package:args/args.dart';\nimport 'package:http/http.dart' as http;\n\nconst String introspectionQuery = '''\n  query IntrospectionQuery {\n    __schema {\n      queryType { name }\n      mutationType { name }\n      subscriptionType { name }\n      types {\n        ...FullType\n      }\n      directives {\n        name\n        description\n        locations\n        args {\n          ...InputValue\n        }\n      }\n    }\n  }\n\n  fragment FullType on __Type {\n    kind\n    name\n    description\n    fields(includeDeprecated: true) {\n      name\n      description\n      args {\n        ...InputValue\n      }\n      type {\n        ...TypeRef\n      }\n      isDeprecated\n      deprecationReason\n    }\n    inputFields {\n      ...InputValue\n    }\n    interfaces {\n      ...TypeRef\n    }\n    enumValues(includeDeprecated: true) {\n      name\n      description\n      isDeprecated\n      deprecationReason\n    }\n    possibleTypes {\n      ...TypeRef\n    }\n  }\n\n  fragment InputValue on __InputValue {\n    name\n    description\n    type { ...TypeRef }\n    defaultValue\n  }\n\n  fragment TypeRef on __Type {\n    kind\n    name\n    ofType {\n      kind\n      name\n      ofType {\n        kind\n        name\n        ofType {\n          kind\n          name\n          ofType {\n            kind\n            name\n            ofType {\n              kind\n              name\n              ofType {\n                kind\n                name\n                ofType {\n                  kind\n                  name\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n''';\n\nFuture<String> fetchGraphQLSchemaStringFromURL(String graphqlEndpoint,\n    {http.Client? client}) async {\n  final httpClient = client ?? http.Client();\n\n  final response = await httpClient.post(Uri.parse(graphqlEndpoint), body: {\n    'operationName': 'IntrospectionQuery',\n    'query': introspectionQuery,\n  });\n\n  return response.body;\n}\n\nvoid main(List<String> args) async {\n  final parser = ArgParser()\n    ..addFlag('help', abbr: 'h', help: 'Show this help', negatable: false)\n    ..addOption('endpoint',\n        abbr: 'e', help: 'Endpoint to hit to get the schema')\n    ..addOption('output', abbr: 'o', help: 'File to output the schema to');\n  final results = parser.parse(args);\n\n  if (results['help'] as bool || args.isEmpty) {\n    return print(parser.usage);\n  }\n\n  File(\n    results['output'] as String,\n  ).writeAsStringSync(\n    await fetchGraphQLSchemaStringFromURL(\n      results['endpoint'] as String,\n    ),\n    flush: true,\n  );\n}\n"
  }
]