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

Merged
merged 1 commit into from Jan 30, 2023
Merged

Upcoming Release Changes #8832

merged 1 commit into from Jan 30, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 17, 2023

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/client-preset@1.3.0

Minor Changes

  • #8757 4f290aa72 Thanks @n1ru4l! - Add support for persisted documents.

    You can now generate and embed a persisted documents hash for the executable documents.

    /** codegen.ts */
    import { CodegenConfig } from '@graphql-codegen/cli';
    
    const config: CodegenConfig = {
      schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
      documents: ['src/**/*.tsx'],
      ignoreNoDocuments: true, // for better experience with the watcher
      generates: {
        './src/gql/': {
          preset: 'client',
          plugins: [],
          presetConfig: {
            persistedDocuments: true,
          },
        },
      },
    };
    
    export default config;

    This will generate ./src/gql/persisted-documents.json (dictionary of hashes with their operation string).

    In addition to that each generated document node will have a __meta__.hash property.

    import { gql } from './gql.js';
    
    const allFilmsWithVariablesQueryDocument = graphql(/* GraphQL */ `
      query allFilmsWithVariablesQuery($first: Int!) {
        allFilms(first: $first) {
          edges {
            node {
              ...FilmItem
            }
          }
        }
      }
    `);
    
    console.log((allFilmsWithVariablesQueryDocument as any)['__meta__']['hash']);
  • #8757 4f290aa72 Thanks @n1ru4l! - Add support for embedding metadata in the document AST.

    It is now possible to embed metadata (e.g. for your GraphQL client within the emitted code).

    /** codegen.ts */
    import { CodegenConfig } from '@graphql-codegen/cli';
    
    const config: CodegenConfig = {
      schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
      documents: ['src/**/*.tsx'],
      ignoreNoDocuments: true, // for better experience with the watcher
      generates: {
        './src/gql/': {
          preset: 'client',
          plugins: [],
          presetConfig: {
            onExecutableDocumentNode(documentNode) {
              return {
                operation: documentNode.definitions[0].operation,
                name: documentNode.definitions[0].name.value,
              };
            },
          },
        },
      },
    };
    
    export default config;

    You can then access the metadata via the __meta__ property on the document node.

    import { gql } from './gql.js';
    
    const allFilmsWithVariablesQueryDocument = graphql(/* GraphQL */ `
      query allFilmsWithVariablesQuery($first: Int!) {
        allFilms(first: $first) {
          edges {
            node {
              ...FilmItem
            }
          }
        }
      }
    `);
    
    console.log((allFilmsWithVariablesQueryDocument as any)['__meta__']);

Patch Changes

  • #8757 4f290aa72 Thanks @n1ru4l! - dependencies updates:
  • Updated dependencies [a98198524]:
    • @graphql-codegen/visitor-plugin-common@2.13.8
    • @graphql-codegen/gql-tag-operations@1.6.2
    • @graphql-codegen/typescript-operations@2.5.13
    • @graphql-codegen/typed-document-node@2.3.13
    • @graphql-codegen/typescript@2.8.8

@graphql-cli/codegen@2.4.25

Patch Changes

@graphql-codegen/cli@2.16.5

Patch Changes

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

Patch Changes

  • #8816 a98198524 Thanks @charle692! - Fix issue where visitor-plugin-common emitted ESM imports for Operations when emitLegacyCommonJSImports is true

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

Patch Changes

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

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

Patch Changes

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

@graphql-codegen/typescript-operations@2.5.13

Patch Changes

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

@graphql-codegen/typescript-resolvers@2.7.13

Patch Changes

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

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

Patch Changes

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

@graphql-codegen/typescript@2.8.8

Patch Changes

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

@graphql-codegen/graphql-modules-preset@2.5.12

Patch Changes

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

@github-actions github-actions bot force-pushed the changeset-release/master branch 9 times, most recently from 85b5a08 to 09c99cb Compare January 24, 2023 15:20
@github-actions github-actions bot force-pushed the changeset-release/master branch 3 times, most recently from 25d244a to 0c4018a Compare January 30, 2023 09:40
@n1ru4l n1ru4l merged commit 2a7e9ac into master Jan 30, 2023
@n1ru4l n1ru4l deleted the changeset-release/master branch January 30, 2023 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant