PackageTrack

npm · #4105 most downloaded on npm

@graphql-codegen/cli

7.3.1dotansimha/graphql-code-generator

Release timeline

6088 releases since 2019
20192026

Releases

  1. 3.2.2-alpha-20230303164721-1b08466b33 Mar 2023pre-release

    Nothing published for this version

  2. 3.2.2-alpha-20230302095526-48dfe8bf92 Mar 2023pre-release

    Nothing published for this version

  3. 3.2.2-alpha-20230302095206-b34166c232 Mar 2023pre-release

    Nothing published for this version

  4. 3.2.2-alpha-20230301201322-189cfbbc91 Mar 2023pre-release

    Nothing published for this version

  5. 3.2.123 Feb 2023
    Release notes

    Patch Changes

    Open source →
  6. 3.2.1-rc-20230223184053-4b6c8be9823 Feb 2023pre-release

    Nothing published for this version

  7. 3.2.1-alpha-20230223184340-e6597d8c223 Feb 2023pre-release

    Nothing published for this version

  8. 3.2.1-alpha-20230223182325-66a48bd8023 Feb 2023pre-release

    Nothing published for this version

  9. 3.2.1-alpha-20230223182235-254177bec23 Feb 2023pre-release

    Nothing published for this version

  10. 3.2.022 Feb 2023
    Release notes

    Minor Changes

    Patch Changes

    • Updated dependencies [d84afec09]
    • Updated dependencies [a4fe5006b]
    • Updated dependencies [8e44df58b]
    Open source →
    Additional notes

    Minor Changes

    Patch Changes

    Open source →
  11. 3.2.0-rc-20230222191727-b4401255e22 Feb 2023pre-release

    Nothing published for this version

  12. 3.2.0-rc-20230222190603-0415bf05422 Feb 2023pre-release

    Nothing published for this version

  13. 3.2.0-rc-20230222164134-fa02bc5b022 Feb 2023pre-release

    Nothing published for this version

  14. 3.2.0-rc-20230222163541-45544cfb422 Feb 2023pre-release

    Nothing published for this version

  15. 3.2.0-rc-20230222132446-a40e8a90022 Feb 2023pre-release

    Nothing published for this version

  16. 3.2.0-rc-20230222111517-88ae37b4d22 Feb 2023pre-release

    Nothing published for this version

  17. 3.2.0-rc-20230222095659-01ed8825e22 Feb 2023pre-release

    Nothing published for this version

  18. 3.2.0-rc-20230222055720-ed059ca1b22 Feb 2023pre-release

    Nothing published for this version

  19. 3.2.0-rc-20230222013738-1c33ece4122 Feb 2023pre-release

    Nothing published for this version

  20. 3.2.0-rc-20230221183156-76778acef21 Feb 2023pre-release

    Nothing published for this version

  21. 3.2.0-alpha-20230222130841-3580ec38822 Feb 2023pre-release

    Nothing published for this version

  22. 3.2.0-alpha-20230222100002-af3de50ea22 Feb 2023pre-release

    Nothing published for this version

  23. 3.2.0-alpha-20230222090704-08d7764a222 Feb 2023pre-release

    Nothing published for this version

  24. 3.2.0-alpha-20230222014932-bada4465022 Feb 2023pre-release

    Nothing published for this version

  25. 3.1.1-alpha-20230217094942-ea4838cdc17 Feb 2023pre-release

    Nothing published for this version

  26. 3.1.1-alpha-20230217094649-681f221a917 Feb 2023pre-release

    Nothing published for this version

  27. 3.1.1-alpha-20230217092448-8af0f220517 Feb 2023pre-release

    Nothing published for this version

  28. 3.1.021 Feb 2023
    Release notes

    Minor Changes

    • #8893 a118c307a Thanks @n1ru4l! - It is no longer mandatory to declare an empty plugins array when using a preset

    • #8723 a3309e63e Thanks @kazekyo! - Introduce a new feature called DocumentTransform.

      DocumentTransform is a functionality that allows you to modify documents before they are processed by plugins. You can use functions passed to the documentTransforms option to make changes to GraphQL documents.

      To use this feature, you can write documentTransforms as follows:

      import type { CodegenConfig } from '@graphql-codegen/cli'
      
      const config: CodegenConfig = {
        schema: 'https://localhost:4000/graphql',
        documents: ['src/**/*.tsx'],
        generates: {
          './src/gql/': {
            preset: 'client',
            documentTransforms: [
              {
                transform: ({ documents }) => {
                  // Make some changes to the documents
                  return documents
                }
              }
            ]
          }
        }
      }
      export default config
      

      For instance, to remove a @localOnlyDirective directive from documents, you can write the following code:

      import type { CodegenConfig } from '@graphql-codegen/cli'
      import { visit } from 'graphql'
      
      const config: CodegenConfig = {
        schema: 'https://localhost:4000/graphql',
        documents: ['src/**/*.tsx'],
        generates: {
          './src/gql/': {
            preset: 'client',
            documentTransforms: [
              {
                transform: ({ documents }) => {
                  return documents.map(documentFile => {
                    documentFile.document = visit(documentFile.document, {
                      Directive: {
                        leave(node) {
                          if (node.name.value === 'localOnlyDirective') return null
                        }
                      }
                    })
                    return documentFile
                  })
                }
              }
            ]
          }
        }
      }
      export default config
      

      DocumentTransform can also be specified by file name. You can create a custom file for a specific transformation and pass it to documentTransforms.

      Let's create the document transform as a file:

      module.exports = {
        transform: ({ documents }) => {
          // Make some changes to the documents
          return documents
        }
      }
      

      Then, you can specify the file name as follows:

      import type { CodegenConfig } from '@graphql-codegen/cli'
      
      const config: CodegenConfig = {
        schema: 'https://localhost:4000/graphql',
        documents: ['src/**/*.tsx'],
        generates: {
          './src/gql/': {
            preset: 'client',
            documentTransforms: ['./my-document-transform.js']
          }
        }
      }
      export default config
      

    Patch Changes

    Open source →
  29. 3.1.0-alpha-20230221165357-bfc52c52421 Feb 2023pre-release

    Nothing published for this version

  30. 3.1.0-alpha-20230221114242-f86f936ba21 Feb 2023pre-release

    Nothing published for this version

  31. 3.1.0-alpha-20230221113721-f86f936ba21 Feb 2023pre-release

    Nothing published for this version

  32. 3.1.0-alpha-20230221061459-72945a96221 Feb 2023pre-release

    Nothing published for this version

  33. 3.1.0-alpha-20230221061345-f4f03996621 Feb 2023pre-release

    Nothing published for this version

  34. 3.1.0-alpha-20230220220309-b5de7da6620 Feb 2023pre-release

    Nothing published for this version

  35. 3.1.0-alpha-20230220220141-e01f01d5120 Feb 2023pre-release

    Nothing published for this version

  36. 3.1.0-alpha-20230220215608-bfc52c52420 Feb 2023pre-release

    Nothing published for this version

  37. 3.1.0-alpha-20230220215039-18c86888920 Feb 2023pre-release

    Nothing published for this version

  38. 3.1.0-alpha-20230220203337-a78ca995720 Feb 2023pre-release

    Nothing published for this version

  39. 3.1.0-alpha-20230220195739-6ddf2146320 Feb 2023pre-release

    Nothing published for this version

  40. 3.1.0-alpha-20230220195502-f7639fa7d20 Feb 2023pre-release

    Nothing published for this version

  41. 3.1.0-alpha-20230220195408-c4c8dc71920 Feb 2023pre-release

    Nothing published for this version

  42. 3.1.0-alpha-20230220195308-cf862dc6f20 Feb 2023pre-release

    Nothing published for this version

  43. 3.1.0-alpha-20230220195231-c0353598720 Feb 2023pre-release

    Nothing published for this version

  44. 3.1.0-alpha-20230220141201-44d4498f920 Feb 2023pre-release

    Nothing published for this version

  45. 3.1.0-alpha-20230220141150-d2acdf19420 Feb 2023pre-release

    Nothing published for this version

  46. 3.1.0-alpha-20230220141118-87ded92be20 Feb 2023pre-release

    Nothing published for this version

  47. 3.1.0-alpha-20230220140839-1946419b720 Feb 2023pre-release

    Nothing published for this version

  48. 3.1.0-alpha-20230220124256-b16895d1820 Feb 2023pre-release

    Nothing published for this version

  49. 3.1.0-alpha-20230220124108-dbd546e1e20 Feb 2023pre-release

    Nothing published for this version

  50. 3.1.0-alpha-20230220124003-e8337e29120 Feb 2023pre-release

    Nothing published for this version

  51. 3.1.0-alpha-20230220095758-a9212661720 Feb 2023pre-release

    Nothing published for this version

  52. 3.1.0-alpha-20230220095740-3f3007a2320 Feb 2023pre-release

    Nothing published for this version

  53. 3.1.0-alpha-20230220003012-c1f5e991420 Feb 2023pre-release

    Nothing published for this version

  54. 3.1.0-alpha-20230220002914-3addc34d620 Feb 2023pre-release

    Nothing published for this version

  55. 3.1.0-alpha-20230220002407-eff4e077520 Feb 2023pre-release

    Nothing published for this version

  56. 3.1.0-alpha-20230219101228-e69f2219319 Feb 2023pre-release

    Nothing published for this version

  57. 3.1.0-alpha-20230219101053-5810e94a319 Feb 2023pre-release

    Nothing published for this version

  58. 3.1.0-alpha-20230218173514-243806a7b18 Feb 2023pre-release

    Nothing published for this version

  59. 3.1.0-alpha-20230217214826-53c26884f17 Feb 2023pre-release

    Nothing published for this version

  60. 3.1.0-alpha-20230217161829-8a122700b17 Feb 2023pre-release

    Nothing published for this version