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

Update graphqlcodegenerator monorepo (major) #184

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

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Aug 5, 2021

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@graphql-codegen/cli (source) 1.21.8 -> 5.0.3 age adoption passing confidence
@graphql-codegen/typescript (source) 1.23.0 -> 4.1.0 age adoption passing confidence

Release Notes

dotansimha/graphql-code-generator (@​graphql-codegen/cli)

v5.0.3

Compare Source

Patch Changes

v5.0.2

Compare Source

Patch Changes

v5.0.1

Compare Source

Patch Changes

v5.0.0

Compare Source

Major Changes
Patch Changes

v4.0.1

Compare Source

Patch Changes

v4.0.0

Compare Source

Major Changes
Patch Changes

v3.3.1

Compare Source

Patch Changes

v3.3.0

Compare Source

Minor Changes
  • #​9151 b7dacb21f Thanks @​'./user/schema.mappers#UserMapper',! - Add watchPattern config option for generates sections.

    By default, watch mode automatically watches all GraphQL schema and document files. This means when a change is detected, Codegen CLI is run.

    A user may want to run Codegen CLI when non-schema and non-document files are changed. Each generates section now has a watchPattern option to allow more file patterns to be added to the list of patterns to watch.

    In the example below, mappers are exported from schema.mappers.ts files. We want to re-run Codegen if the content of *.mappers.ts files change because they change the generated types file. To solve this, we can add mapper file patterns to watch using the glob pattern used for schema and document files.

    // codegen.ts
    const config: CodegenConfig = {
      schema: 'src/schema/**/*.graphql',
      generates: {
        'src/schema/types.ts': {
          plugins: ['typescript', 'typescript-resolvers'],
          config: {
            mappers: {
    
              Book: './book/schema.mappers#BookMapper',
            },
          }
          watchPattern: 'src/schema/**/*.mappers.ts', // Watches mapper files in `watch` mode. Use an array for multiple patterns e.g. `['src/*.pattern1.ts','src/*.pattern2.ts']`
        },
      },
    };

    Then, run Codegen CLI in watch mode:

    yarn graphql-codegen --watch

    Now, updating *.mappers.ts files re-runs Codegen! 🎉

    Note: watchPattern is only used in watch mode i.e. running CLI with --watch flag.

Patch Changes

v3.2.2

Compare Source

Patch Changes

v3.2.1

Compare Source

Patch Changes

v3.2.0

Compare Source

Minor Changes
Patch Changes

v3.1.0

Compare Source

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

v3.0.0

Compare Source

Major Changes
Patch Changes

v2.16.5

Compare Source

Patch Changes

v2.16.4

Compare Source

Patch Changes

v2.16.3

Compare Source

Patch Changes

v2.16.2

Compare Source

Patch Changes

v2.16.1

Compare Source

Patch Changes

v2.16.0

Compare Source

Minor Changes
Patch Changes

v2.15.0

Compare Source

Minor Changes

v2.14.1

Compare Source

Patch Changes

v2.14.0

Compare Source

Minor Changes
Patch Changes

v2.13.12

Compare Source

Patch Changes

v2.13.11

Compare Source

Patch Changes

v2.13.10

Compare Source

Patch Changes

v2.13.9

Compare Source

Patch Changes

v2.13.8

Compare Source

Patch Changes

v2.13.7

Compare Source

Patch Changes

v2.13.6

Compare Source

Patch Changes

v2.13.5

Compare Source

Patch Changes

v2.13.4

Compare Source

Patch Changes

v2.13.3

Compare Source

Patch Changes

v2.13.2

Compare Source

Patch Changes

v2.13.1

Compare Source

Patch Changes

v2.13.0

Compare Source

Minor Changes
Patch Changes

v2.12.2

Compare Source

Patch Changes

v2.12.1

Compare Source

Patch Changes

v2.12.0

Compare Source

Minor Changes
Patch Changes

Configuration

📅 Schedule: Branch creation - "on friday" in timezone Australia/Melbourne, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies Pull requests that update a dependency file label Aug 5, 2021
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from ec0fbf3 to 38a842e Compare August 19, 2021 17:24
@renovate renovate bot changed the title Update graphqlcodegenerator monorepo (major) Update graphqlcodegenerator monorepo to v2 (major) Aug 19, 2021
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from 38a842e to 6ca5b08 Compare August 20, 2021 10:34
@renovate renovate bot changed the title Update graphqlcodegenerator monorepo to v2 (major) Update graphqlcodegenerator monorepo (major) Aug 20, 2021
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from 6ca5b08 to 2a13838 Compare August 23, 2021 06:13
@renovate renovate bot changed the title Update graphqlcodegenerator monorepo (major) Update graphqlcodegenerator monorepo to v2 (major) Aug 23, 2021
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from 2a13838 to 916e485 Compare August 25, 2021 20:32
@renovate renovate bot changed the title Update graphqlcodegenerator monorepo to v2 (major) Update graphqlcodegenerator monorepo (major) Aug 25, 2021
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from 916e485 to c1e8952 Compare August 27, 2021 01:10
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch 3 times, most recently from 1e95d07 to a8ccd2e Compare September 9, 2021 15:48
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch 3 times, most recently from e294c0f to bf91048 Compare September 16, 2021 16:42
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch 3 times, most recently from bbd6db3 to bff9b26 Compare October 14, 2021 15:11
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch 3 times, most recently from c2af3b3 to d0beee7 Compare November 5, 2021 14:39
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch 3 times, most recently from f2fbe66 to 5d4e057 Compare November 18, 2021 15:54
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from 5d4e057 to 624e8bd Compare November 25, 2021 17:50
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch 2 times, most recently from e087217 to b9dcd55 Compare December 10, 2021 00:39
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from b9dcd55 to 11c2474 Compare December 16, 2021 16:50
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from 11c2474 to 5915d44 Compare December 30, 2021 08:30
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch 3 times, most recently from 74b29f7 to ee04788 Compare July 20, 2022 17:10
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch 5 times, most recently from 03678fd to 4f0833b Compare July 30, 2022 17:33
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch 3 times, most recently from a52feb8 to f1092df Compare August 11, 2022 11:57
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from f1092df to 772dbd4 Compare September 25, 2022 18:25
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from 772dbd4 to 1b69f42 Compare November 20, 2022 20:14
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from 1b69f42 to 279cbb2 Compare March 17, 2023 01:53
@renovate renovate bot changed the title Update graphqlcodegenerator monorepo to v2 (major) Update graphqlcodegenerator monorepo to v3 (major) Mar 17, 2023
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from 279cbb2 to 86cfd6b Compare April 17, 2023 13:19
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from 86cfd6b to c1dad81 Compare May 28, 2023 10:18
@renovate renovate bot changed the title Update graphqlcodegenerator monorepo to v3 (major) Update graphqlcodegenerator monorepo to v4 (major) May 28, 2023
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from c1dad81 to 4d85bdf Compare June 1, 2023 15:11
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from 4d85bdf to 94886be Compare June 19, 2023 13:31
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from 94886be to 7182b40 Compare July 25, 2023 09:28
@renovate renovate bot changed the title Update graphqlcodegenerator monorepo to v4 (major) Update graphqlcodegenerator monorepo (major) Jul 25, 2023
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from 7182b40 to 5655465 Compare February 6, 2024 16:47
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch 2 times, most recently from 0049b4b to fbf3719 Compare February 22, 2024 22:44
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from fbf3719 to 7ad9c45 Compare May 17, 2024 11:29
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch 2 times, most recently from 4748fef to 3366edb Compare July 2, 2024 10:21
@renovate renovate bot force-pushed the renovate/major-graphqlcodegenerator-monorepo branch from 3366edb to 6ea7a07 Compare October 7, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants