Skip to content

Latest commit

 

History

History
763 lines (492 loc) · 27.8 KB

File metadata and controls

763 lines (492 loc) · 27.8 KB

@graphql-codegen/graphql-modules-preset

4.0.17

Patch Changes

4.0.16

Patch Changes

4.0.15

Patch Changes

4.0.14

Patch Changes

4.0.13

Patch Changes

4.0.12

Patch Changes

4.0.11

Patch Changes

4.0.10

Patch Changes

4.0.9

Patch Changes

4.0.8

Patch Changes

4.0.7

Patch Changes

4.0.6

Patch Changes

4.0.5

Patch Changes

4.0.4

Patch Changes

4.0.3

Patch Changes

4.0.2

Patch Changes

4.0.1

Patch Changes

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

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

2.5.11

Patch Changes

2.5.10

Patch Changes

2.5.9

Patch Changes

2.5.8

Patch Changes

2.5.7

Patch Changes

2.5.6

Patch Changes

2.5.5

Patch Changes

2.5.4

Patch Changes

2.5.3

Patch Changes

2.5.2

Patch Changes

2.5.1

Patch Changes

2.5.0

Minor Changes

2.4.2

Patch Changes

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]

2.4.0

Minor Changes

Patch Changes

  • Updated dependencies [68bb30e19]
  • Updated dependencies [d84afec09]
  • Updated dependencies [a4fe5006b]
  • Updated dependencies [8e44df58b]

2.3.14

Patch Changes

  • Updated dependencies [aa1e6eafd]
  • Updated dependencies [a42fcbfe4]
  • Updated dependencies [8b10f22be]

2.3.13

Patch Changes

2.3.12

Patch Changes

2.3.11

Patch Changes

2.3.10

Patch Changes

2.3.9

Patch Changes

2.3.8

Patch Changes

2.3.7

Patch Changes

2.3.6

Patch Changes

2.3.5

Patch Changes

2.3.4

Patch Changes

2.3.3

Patch Changes

  • Updated dependencies [c8ef37ae0]
  • Updated dependencies [754a33715]
  • Updated dependencies [bef4376d5]
  • Updated dependencies [be7cb3a82]

2.3.2

Patch Changes

2.3.1

Patch Changes

  • Updated dependencies [a9f1f1594]
  • Updated dependencies [9ea6621ec]

2.3.0

Minor Changes

  • 97ddb487a: feat: GraphQL v16 compatibility

Patch Changes

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

2.1.5

Patch Changes

2.1.4

Patch Changes

2.1.3

Patch Changes

  • Updated dependencies [d6c2d4c09]
  • Updated dependencies [feeae1c66]
  • Updated dependencies [5086791ac]

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]

2.1.1

Patch Changes

2.1.0

Minor Changes

  • 440172cfe: support ESM

Patch Changes

  • Updated dependencies [290170262]
  • Updated dependencies [24185985a]
  • Updated dependencies [39773f59b]
  • Updated dependencies [440172cfe]

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

1.2.10

Patch Changes

1.2.9

Patch Changes

1.2.8

Patch Changes

1.2.7

Patch Changes

1.2.6

Patch Changes

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]

1.2.4

Patch Changes

  • 23862e7e: fix(naming-convention): revert and pin change-case-all dependency for workaround #3256
  • Updated dependencies [23862e7e]

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]

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]

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]

1.1.0

Minor Changes

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

Patch Changes

1.0.0

Major Changes

  • faa13973: New Plugin!

Patch Changes