On this page

@graphql-codegen/graphql-modules-preset

Changelog for @graphql-codegen/graphql-modules-preset: every release with its changes and the pull requests behind them.

6.1.3

Patch Changes

  • #10985 d8aa07f Thanks @eddeee888! - Build with strict: true, which changes these emitted type declarations:

    • @graphql-codegen/cli: mkdirp returns Promise<string | undefined>, and the require (-r) CLI option’s default is typed never[] instead of any[].
    • @graphql-codegen/visitor-plugin-common: BaseResolversVisitor and BaseTypesVisitor SchemaDefinition()/SchemaExtension() return null instead of any.
    • @graphql-codegen/visitor-plugin-common: BaseSelectionSetProcessor.typeCache is keyed by Location | undefined.
    • @graphql-codegen/visitor-plugin-common: SelectionSetToObject.buildSelectionSet returns typeInfo as { name: string; type: string } | null.
    • @graphql-codegen/visitor-plugin-common: getPossibleTypes accepts null as the type, which graphql 15’s schema.getType() can return.
    • @graphql-codegen/visitor-plugin-common: removeDescription returns nodes with description: undefined instead of any.
    • @graphql-codegen/typescript: TsIntrospectionVisitor’s constructor takes pluginConfig as TypeScriptPluginConfig | undefined, DirectiveDefinition() returns null and ObjectTypeDefinition() returns string | null.
    • @graphql-codegen/client-preset: the babel preset accepts options as ClientBabelPresetOptions | null | undefined.
    • @graphql-codegen/testing: mockGraphQLServer returns nock.Scope | null.
    • @graphql-codegen/graphql-modules-preset: a schema without extensions (graphql 15) throws the “requires to use GraphQL SDL” error instead of a TypeError.

    Generated output is unchanged.

  • Updated dependencies [d8aa07f, 5078faf]:

    • @graphql-codegen/visitor-plugin-common@7.2.10

6.1.2

Patch Changes

  • #11043 31761f9 Thanks @eddeee888! - dependencies updates:

  • #11043 31761f9 Thanks @eddeee888! - Update @graphql-tools/utils to v12, and other @graphql-tools/* dependencies and graphql-config to releases that use it, to pick up the fix for GHSA-7mx3-vvmw-hjmv (prototype pollution in mergeDeep, @graphql-tools/utils <= 12.0.0).

    @graphql-codegen/cli now unwraps the AggregateError that newer @graphql-tools/load versions throw, so schema and document syntax errors still print the native GraphQLError with its file location.

  • Updated dependencies [31761f9, 31761f9, 31761f9, 463e6ef]:

    • @graphql-codegen/plugin-helpers@7.4.2
    • @graphql-codegen/visitor-plugin-common@7.2.9

6.1.1

Patch Changes

  • #10993 be69e9d Thanks @eddeee888! - Skip sources without a location when grouping sources by module, instead of throwing from path.normalize, and skip sources without a document AST when building each module’s document. Generated output from the CLI is unchanged.

  • Updated dependencies [e5361bc, 1d1153b, be69e9d]:

    • @graphql-codegen/visitor-plugin-common@7.2.6
    • @graphql-codegen/plugin-helpers@7.4.0

6.1.0

Minor Changes

Patch Changes

  • Updated dependencies [959915f, 959915f]:
    • @graphql-codegen/plugin-helpers@7.1.0
    • @graphql-codegen/visitor-plugin-common@7.2.0

6.0.1

Patch Changes

6.0.0

Major Changes

  • #10496 afaace6 Thanks @eddeee888! - BREAKING CHANGE: Update deps to latest, some only support ESM

    Node 20 support is dropped in this release. Node 22 comes with require() support for ESM, which means it’s easier to integrate ES modules into applications. Therefore, it is safe to start using ESM-only packages.

    If you are a user, please upgrade to Node 22. If you are a lib maintainer and see ESM vs CJS issues when running Jest tests, try using Vitest.

  • #10496 afaace6 Thanks @eddeee888! - BREAKING CHANGE: Drop Node 20 support

Patch Changes

5.1.5

Patch Changes

5.1.4

Patch Changes

5.1.3

Patch Changes

  • Updated dependencies [6038634]:
    • @graphql-codegen/visitor-plugin-common@6.2.3

5.1.2

Patch Changes

  • Updated dependencies [f588d91]:
    • @graphql-codegen/visitor-plugin-common@6.2.2

5.1.1

Patch Changes

  • Updated dependencies [b995ed1]:
    • @graphql-codegen/visitor-plugin-common@6.2.1

5.1.0

Minor Changes

Patch Changes

  • Updated dependencies [f821e8a, 9e70bcb]:
    • @graphql-codegen/visitor-plugin-common@6.2.0
    • @graphql-codegen/plugin-helpers@6.1.0

5.0.5

Patch Changes

  • Updated dependencies [51a1a72]:
    • @graphql-codegen/visitor-plugin-common@6.1.2

5.0.4

Patch Changes

  • Updated dependencies [6715330]:
    • @graphql-codegen/visitor-plugin-common@6.1.1

5.0.3

Patch Changes

  • Updated dependencies [8258f1f]:
    • @graphql-codegen/visitor-plugin-common@6.1.0

5.0.2

Patch Changes

  • Updated dependencies [accdab6]:
    • @graphql-codegen/visitor-plugin-common@6.0.1

5.0.1

Patch Changes

  • #10447 5dad86e Thanks @eddeee888! - Fix __isTypeOf wrongly picked on objects that are not implementing types or union members

5.0.0

Major Changes

Patch Changes

4.0.17

Patch Changes

4.0.16

Patch Changes

  • Updated dependencies [f6909d1]:
    • @graphql-codegen/visitor-plugin-common@5.8.0

4.0.15

Patch Changes

  • Updated dependencies [d8566c0]:
    • @graphql-codegen/visitor-plugin-common@5.7.1

4.0.14

Patch Changes

  • Updated dependencies [6d7c1d7]:
    • @graphql-codegen/visitor-plugin-common@5.7.0

4.0.13

Patch Changes

  • Updated dependencies [60dd72f]:
    • @graphql-codegen/visitor-plugin-common@5.6.1

4.0.12

Patch Changes

  • Updated dependencies [1617e3c, fa64fbf]:
    • @graphql-codegen/visitor-plugin-common@5.6.0

4.0.11

Patch Changes

  • Updated dependencies [55a1e9e, a235051]:
    • @graphql-codegen/visitor-plugin-common@5.5.0
    • @graphql-codegen/plugin-helpers@5.1.0

4.0.10

Patch Changes

  • Updated dependencies [3f4f546]:
    • @graphql-codegen/visitor-plugin-common@5.4.0

4.0.9

Patch Changes

  • Updated dependencies [79fee3c]:
    • @graphql-codegen/visitor-plugin-common@5.3.1

4.0.8

Patch Changes

  • Updated dependencies [808ada5, 14ce39e]:
    • @graphql-codegen/visitor-plugin-common@5.3.0

4.0.7

Patch Changes

  • Updated dependencies [dfc5310, 156cc2b, dfc5310, b49457b]:
    • @graphql-codegen/plugin-helpers@5.0.4
    • @graphql-codegen/visitor-plugin-common@5.2.0

4.0.6

Patch Changes

  • Updated dependencies [920b443, ed9c205]:
    • @graphql-codegen/visitor-plugin-common@5.1.0

4.0.5

Patch Changes

  • Updated dependencies [53f270a]:
    • @graphql-codegen/visitor-plugin-common@5.0.0

4.0.4

Patch Changes

  • #9813 4e69568 Thanks @saihaj! - bumping for a release

  • Updated dependencies [4e69568]:

    • @graphql-codegen/visitor-plugin-common@4.1.2
    • @graphql-codegen/plugin-helpers@5.0.3

4.0.3

Patch Changes

  • Updated dependencies [7718a8113]:
    • @graphql-codegen/visitor-plugin-common@4.1.1

4.0.2

Patch Changes

4.0.1

Patch Changes

  • Updated dependencies [2276708d0]:
    • @graphql-codegen/visitor-plugin-common@4.0.1

4.0.0

Major Changes

  • bb66c2a31 Thanks @n1ru4l! - Require Node.js >= 16. Drop support for Node.js 14

Patch Changes

3.1.3

Patch Changes

  • Updated dependencies [386cf9044, 402cb8ac0]:
    • @graphql-codegen/visitor-plugin-common@3.1.1

3.1.2

Patch Changes

3.1.1

Patch Changes

3.1.0

Minor Changes

  • #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

3.0.0

Major Changes

Patch Changes

2.5.12

Patch Changes

  • Updated dependencies [a98198524]:
    • @graphql-codegen/visitor-plugin-common@2.13.8

2.5.11

Patch Changes

  • Updated dependencies [eb454d06c]:
    • @graphql-codegen/visitor-plugin-common@2.13.7

2.5.10

Patch Changes

2.5.9

Patch Changes

  • 46f75304a Thanks @saihaj! - fix the version of @graphql-codegen/plugin-helpers@3.1.1

  • Updated dependencies [307a5d350, 46f75304a]:

    • @graphql-codegen/plugin-helpers@3.1.1
    • @graphql-codegen/visitor-plugin-common@2.13.5

2.5.8

Patch Changes

2.5.7

Patch Changes

  • Updated dependencies [62f655452]:
    • @graphql-codegen/visitor-plugin-common@2.13.3

2.5.6

Patch Changes

  • Updated dependencies [ef4c2c9c2]:
    • @graphql-codegen/visitor-plugin-common@2.13.2

2.5.5

Patch Changes

  • Updated dependencies [63dc8f205]:
    • @graphql-codegen/visitor-plugin-common@2.13.1
    • @graphql-codegen/plugin-helpers@2.7.2

2.5.4

Patch Changes

  • Updated dependencies [a46b8d99c]:
    • @graphql-codegen/visitor-plugin-common@2.13.0

2.5.3

Patch Changes

2.5.2

Patch Changes

  • Updated dependencies [1bd7f771c]:
    • @graphql-codegen/visitor-plugin-common@2.12.2

2.5.1

Patch Changes

  • #8189 b408f8238 Thanks @n1ru4l! - Fix CommonJS TypeScript resolution with moduleResolution node16 or nodenext

  • Updated dependencies [b408f8238, 47d0a57e2]:

    • @graphql-codegen/visitor-plugin-common@2.12.1
    • @graphql-codegen/plugin-helpers@2.6.2

2.5.0

Minor Changes

2.4.2

Patch Changes

  • Updated dependencies [2cbcbb371]
    • @graphql-codegen/visitor-plugin-common@2.12.0
    • @graphql-codegen/plugin-helpers@2.6.0

2.4.1

Patch Changes

  • 525ad580b: Revert breaking change for Next.js applications that are incapable of resolving an import with a .js extension.
  • Updated dependencies [525ad580b]
    • @graphql-codegen/visitor-plugin-common@2.11.1

2.4.0

Minor Changes

Patch Changes

  • Updated dependencies [68bb30e19]
  • Updated dependencies [d84afec09]
  • Updated dependencies [a4fe5006b]
  • Updated dependencies [8e44df58b]
    • @graphql-codegen/visitor-plugin-common@2.11.0
    • @graphql-codegen/plugin-helpers@2.5.0

2.3.14

Patch Changes

  • Updated dependencies [aa1e6eafd]
  • Updated dependencies [a42fcbfe4]
  • Updated dependencies [8b10f22be]
    • @graphql-codegen/visitor-plugin-common@2.10.0

2.3.13

Patch Changes

  • Updated dependencies [d16bebacb]
    • @graphql-codegen/visitor-plugin-common@2.9.1

2.3.12

Patch Changes

  • Updated dependencies [c3d7b7226]
    • @graphql-codegen/visitor-plugin-common@2.9.0

2.3.11

Patch Changes

  • Updated dependencies [f1fb77bd4]
    • @graphql-codegen/visitor-plugin-common@2.8.0

2.3.10

Patch Changes

  • Updated dependencies [9a5f31cb6]
    • @graphql-codegen/visitor-plugin-common@2.7.6

2.3.9

Patch Changes

  • Updated dependencies [2966686e9]
    • @graphql-codegen/visitor-plugin-common@2.7.5

2.3.8

Patch Changes

  • Updated dependencies [337fd4f77]
    • @graphql-codegen/visitor-plugin-common@2.7.4

2.3.7

Patch Changes

  • Updated dependencies [54718c039]
    • @graphql-codegen/visitor-plugin-common@2.7.3

2.3.6

Patch Changes

  • Updated dependencies [11d05e361]
    • @graphql-codegen/visitor-plugin-common@2.7.2

2.3.5

Patch Changes

  • Updated dependencies [fd55e2039]
    • @graphql-codegen/visitor-plugin-common@2.7.1

2.3.4

Patch Changes

  • Updated dependencies [1479233df]
    • @graphql-codegen/visitor-plugin-common@2.7.0

2.3.3

Patch Changes

  • Updated dependencies [c8ef37ae0]
  • Updated dependencies [754a33715]
  • Updated dependencies [bef4376d5]
  • Updated dependencies [be7cb3a82]
    • @graphql-codegen/visitor-plugin-common@2.6.0
    • @graphql-codegen/plugin-helpers@2.4.0

2.3.2

Patch Changes

  • 6002feb3d: Fix exports in package.json files for react-native projects
  • Updated dependencies [6002feb3d]
    • @graphql-codegen/visitor-plugin-common@2.5.2
    • @graphql-codegen/plugin-helpers@2.3.2

2.3.1

Patch Changes

  • Updated dependencies [a9f1f1594]
  • Updated dependencies [9ea6621ec]
    • @graphql-codegen/visitor-plugin-common@2.5.1

2.3.0

Minor Changes

  • 97ddb487a: feat: GraphQL v16 compatibility

Patch Changes

  • Updated dependencies [97ddb487a]
    • @graphql-codegen/visitor-plugin-common@2.5.0
    • @graphql-codegen/plugin-helpers@2.3.0

2.2.0

Minor Changes

  • efae660d1: Added an option to allow to skip generating code related to graphql-modules library

2.1.6

Patch Changes

  • Updated dependencies [ad02cb9b8]
    • @graphql-codegen/visitor-plugin-common@2.4.0

2.1.5

Patch Changes

  • Updated dependencies [b9e85adae]
  • Updated dependencies [7c60e5acc]
  • Updated dependencies [3c2c847be]
    • @graphql-codegen/visitor-plugin-common@2.3.0
    • @graphql-codegen/plugin-helpers@2.2.0

2.1.4

Patch Changes

  • Updated dependencies [0b090e31a]
    • @graphql-codegen/visitor-plugin-common@2.2.1

2.1.3

Patch Changes

  • Updated dependencies [d6c2d4c09]
  • Updated dependencies [feeae1c66]
  • Updated dependencies [5086791ac]
    • @graphql-codegen/visitor-plugin-common@2.2.0

2.1.2

Patch Changes

  • f32521da3: Duplication of TS interfaces when GraphQL type definition and type extension are in the same module
  • Updated dependencies [6470e6cc9]
  • Updated dependencies [263570e50]
  • Updated dependencies [35199dedf]
    • @graphql-codegen/visitor-plugin-common@2.1.2
    • @graphql-codegen/plugin-helpers@2.1.1

2.1.1

Patch Changes

  • Updated dependencies [aabeff181]
    • @graphql-codegen/visitor-plugin-common@2.1.1

2.1.0

Minor Changes

  • 440172cfe: support ESM

Patch Changes

  • Updated dependencies [290170262]
  • Updated dependencies [24185985a]
  • Updated dependencies [39773f59b]
  • Updated dependencies [440172cfe]
    • @graphql-codegen/visitor-plugin-common@2.1.0
    • @graphql-codegen/plugin-helpers@2.1.0

2.0.1

Patch Changes

  • edd029e87: fix(graphql-modules-preset): do not parse SDL and use extendedSources that have parsed document already

2.0.0

Major Changes

  • b0cb13df4: Update to latest graphql-tools and graphql-config version.

    ‼️ ‼️ ‼️ Please note ‼️ ‼️ ‼️:

    This is a breaking change since Node 10 is no longer supported in graphql-tools, and also no longer supported for Codegen packages.

Patch Changes

  • Updated dependencies [d80efdec4]
  • Updated dependencies [d80efdec4]
  • Updated dependencies [b0cb13df4]
    • @graphql-codegen/visitor-plugin-common@2.0.0
    • @graphql-codegen/plugin-helpers@2.0.0

1.2.10

Patch Changes

  • Updated dependencies [df19a4ed]
  • Updated dependencies [470336a1]
  • Updated dependencies [9005cc17]
    • @graphql-codegen/visitor-plugin-common@1.22.0
    • @graphql-codegen/plugin-helpers@1.18.8

1.2.9

Patch Changes

  • Updated dependencies [6762aff5]
    • @graphql-codegen/visitor-plugin-common@1.21.3

1.2.8

Patch Changes

  • Updated dependencies [6aaecf1c]
    • @graphql-codegen/visitor-plugin-common@1.21.2

1.2.7

Patch Changes

  • Updated dependencies [cf1e5abc]
    • @graphql-codegen/visitor-plugin-common@1.21.1

1.2.6

Patch Changes

  • Updated dependencies [dfd25caf]
  • Updated dependencies [8da7dff6]
    • @graphql-codegen/visitor-plugin-common@1.21.0
    • @graphql-codegen/plugin-helpers@1.18.7

1.2.5

Patch Changes

  • d9212aa0: fix(visitor-plugin-common): guard for a runtime type error
  • Updated dependencies [d9212aa0]
  • Updated dependencies [f0b5ea53]
  • Updated dependencies [097bea2f]
    • @graphql-codegen/visitor-plugin-common@1.20.0
    • @graphql-codegen/plugin-helpers@1.18.5

1.2.4

Patch Changes

  • 23862e7e: fix(naming-convention): revert and pin change-case-all dependency for workaround #3256
  • Updated dependencies [23862e7e]
    • @graphql-codegen/visitor-plugin-common@1.19.1
    • @graphql-codegen/plugin-helpers@1.18.4

1.2.3

Patch Changes

  • 7615c6cd: Revery enum-resolvers since it’s causing issues

1.2.2

Patch Changes

  • f7a94f9d: Include enum resolvers
  • 3cba8833: Fixed issue with preset breaking when pattern doesn’t match
  • 29b75b1e: enhance(namingConvention): use change-case-all instead of individual packages for naming convention
  • Updated dependencies [e947f8e3]
  • Updated dependencies [29b75b1e]
  • Updated dependencies [d4942d04]
  • Updated dependencies [1f6f3db6]
  • Updated dependencies [29b75b1e]
    • @graphql-codegen/visitor-plugin-common@1.19.0
    • @graphql-codegen/plugin-helpers@1.18.3

1.2.1

Patch Changes

  • c7cb4195: fix(graphql-modules-preset): apply naming convention to scalar config references in module typings
  • Updated dependencies [63be0f40]
  • Updated dependencies [190482a1]
  • Updated dependencies [4444348d]
  • Updated dependencies [142b32b3]
  • Updated dependencies [42213fa0]
    • @graphql-codegen/visitor-plugin-common@1.18.1

1.2.0

Minor Changes

  • f1b99b90: Added support for generating module types as d.ts

Patch Changes

  • Updated dependencies [64293437]
  • Updated dependencies [fd5843a7]
  • Updated dependencies [d75051f5]
    • @graphql-codegen/visitor-plugin-common@1.17.22

1.1.0

Minor Changes

  • 6b708b69: Added importBaseTypesFrom flag to allow customizations of the import for the base types

Patch Changes

  • 1183d173: Bump all packages to resolve issues with shared dependencies
  • Updated dependencies [1183d173]
    • @graphql-codegen/visitor-plugin-common@1.17.20
    • @graphql-codegen/plugin-helpers@1.18.2

1.0.0

Major Changes

  • faa13973: New Plugin!

Patch Changes

  • Updated dependencies [faa13973]
    • @graphql-codegen/visitor-plugin-common@1.17.18