Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upcoming Release Changes #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

github-actions[bot]
Copy link

@github-actions github-actions bot commented Jun 6, 2022

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.

Releases

@graphql-codegen/cli@3.1.0

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

@graphql-codegen/core@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

@graphql-codegen/typescript-resolvers@3.1.0

Minor Changes

Patch Changes

@graphql-codegen/client-preset@2.1.0

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

@graphql-codegen/gql-tag-operations-preset@2.1.0

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

@graphql-codegen/graphql-modules-preset@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

@graphql-codegen/plugin-helpers@4.1.0

Minor Changes

  • #8893 a118c307a Thanks @n1ru4l! - mark plugins in config optional

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

@graphql-cli/codegen@3.0.1

Patch Changes

@graphql-codegen/add@4.0.1

Patch Changes

@graphql-codegen/fragment-matcher@4.0.1

Patch Changes

@graphql-codegen/introspection@3.0.1

Patch Changes

@graphql-codegen/schema-ast@3.0.1

Patch Changes

@graphql-codegen/visitor-plugin-common@3.0.1

Patch Changes

@graphql-codegen/typescript-document-nodes@3.0.1

Patch Changes

@graphql-codegen/gql-tag-operations@2.0.1

Patch Changes

@graphql-codegen/typescript-operations@3.0.1

Patch Changes

@graphql-codegen/typed-document-node@3.0.1

Patch Changes

@graphql-codegen/typescript@3.0.1

Patch Changes

@graphql-codegen/testing@2.0.1

Patch Changes

@github-actions github-actions bot force-pushed the changeset-release/master branch 2 times, most recently from 97aceef to 8e4dc2f Compare June 7, 2022 08:53
@github-actions github-actions bot force-pushed the changeset-release/master branch 3 times, most recently from c867d2b to 42ce2fd Compare August 11, 2022 07:53
@github-actions github-actions bot force-pushed the changeset-release/master branch 3 times, most recently from 39f5af4 to 89f8fd9 Compare January 10, 2023 08:29
@github-actions github-actions bot force-pushed the changeset-release/master branch 4 times, most recently from 5ac12fa to 270da22 Compare January 25, 2023 23:32
@github-actions github-actions bot force-pushed the changeset-release/master branch 3 times, most recently from fbb0690 to 4c93777 Compare February 7, 2023 15:46
@github-actions github-actions bot force-pushed the changeset-release/master branch 6 times, most recently from 17e63cc to 306263f Compare February 20, 2023 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
0 participants