Skip to content

Latest commit

 

History

History
347 lines (229 loc) · 14.2 KB

File metadata and controls

347 lines (229 loc) · 14.2 KB

@graphql-codegen/core

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.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.6.8

Patch Changes

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

  • Updated dependencies [307a5d350]:

    • @graphql-codegen/plugin-helpers@3.1.1

2.6.7

Patch Changes

2.6.6

Patch Changes

2.6.5

Patch Changes

2.6.4

Patch Changes

2.6.3

Patch Changes

2.6.2

Patch Changes

2.6.1

Patch Changes

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

  • Updated dependencies [b408f8238]:

    • @graphql-codegen/plugin-helpers@2.6.2

2.6.0

Minor Changes

Patch Changes

  • Updated dependencies [d84afec09]
  • Updated dependencies [a4fe5006b]
  • Updated dependencies [8e44df58b]
    • @graphql-codegen/plugin-helpers@2.5.0

2.5.1

Patch Changes

  • cb9adeb96: Cache validation of documents
  • Updated dependencies [cb9adeb96]
    • @graphql-codegen/plugin-helpers@2.4.1

2.5.0

Minor Changes

  • 754a33715: Performance Profiler --profile

Patch Changes

  • Updated dependencies [754a33715]
    • @graphql-codegen/plugin-helpers@2.4.0

2.4.0

Minor Changes

  • b61dc57cf: feat(core): add graphql@16 in peer dependencies

Patch Changes

  • 8643b3bf3: Add GraphQL 16 as a peerDependency
  • 6002feb3d: Fix exports in package.json files for react-native projects
  • Updated dependencies [6002feb3d]
    • @graphql-codegen/plugin-helpers@2.3.2

2.3.0

Minor Changes

  • 97ddb487a: feat: GraphQL v16 compatibility

Patch Changes

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

2.2.0

Minor Changes

  • 7c60e5acc: feat(core): ability to skip some specific validation rules with skipDocumentsValidation option

Patch Changes

  • Updated dependencies [7c60e5acc]
    • @graphql-codegen/plugin-helpers@2.2.0

2.1.0

Minor Changes

  • 39773f59b: enhance(plugins): use getDocumentNodeFromSchema and other utilities from @graphql-tools/utils
  • 440172cfe: support ESM

Patch Changes

  • 24185985a: bump graphql-tools package versions
  • Updated dependencies [24185985a]
  • Updated dependencies [39773f59b]
  • Updated dependencies [440172cfe]
    • @graphql-codegen/plugin-helpers@2.1.0

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

  • d80efdec4: Removed typescript-compatiblity since it's no longer maintained. Please migrate your codebase to use the latest output of codegen.
  • Updated dependencies [b0cb13df4]
    • @graphql-codegen/plugin-helpers@2.0.0

1.17.10

Patch Changes

  • dfd25caf: chore(deps): bump graphql-tools versions
  • Updated dependencies [dfd25caf]
    • @graphql-codegen/plugin-helpers@1.18.7

1.17.9

Patch Changes

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

1.17.8

Patch Changes

  • 1d7c6432: Bump all packages to allow "^" in deps and fix compatibility issues
  • 1d7c6432: Bump versions of @graphql-tools/ packages to fix issues with loading schemas and SDL comments
  • ac067ea0: Filter prepend and append coming from plugins, make sure not to add empty lines when not needed
  • Updated dependencies [1d7c6432]
  • Updated dependencies [1d7c6432]
    • @graphql-codegen/plugin-helpers@1.17.8