dotansimha / graphql-code-generator

A tool for generating code based on a GraphQL schema and GraphQL operations (query/mutation/subscription), with flexible support for custom plugins.
https://the-guild.dev/graphql/codegen/
MIT License
10.72k stars 1.31k forks source link

Add generated resolversMap to typescript-resolvers plugin meta #10007

Closed eddeee888 closed 3 weeks ago

eddeee888 commented 3 weeks ago

Description

This PR extends typescript-resolvers plugin's meta to have the generated resolver map type. This is useful for Server Preset as it needs to refer to this type when generating resolvers.generated.ts

This changes the meta shape slightly to have user defined types in the schema under generatedResolvers.userDefined instead of generatedResolvers. New shape:

meta: {
  generatedResolverTypes: {
      resolversMap: { name: string };
      userDefined: Record<string, { name: string }>;
    }
}

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

changeset-bot[bot] commented 3 weeks ago

🦋 Changeset detected

Latest commit: 4555bc46e3e4ee1c6e0744437585b0e50da232b8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages | Name | Type | | ------------------------------------------ | ----- | | @graphql-codegen/visitor-plugin-common | Minor | | @graphql-codegen/typescript-resolvers | Minor | | @graphql-codegen/typescript-document-nodes | Patch | | @graphql-codegen/gql-tag-operations | Patch | | @graphql-codegen/typescript-operations | Patch | | @graphql-codegen/typed-document-node | Patch | | @graphql-codegen/typescript | Patch | | @graphql-codegen/graphql-modules-preset | Patch | | @graphql-codegen/client-preset | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

github-actions[bot] commented 3 weeks ago
### 💻 Website Preview The latest changes are available as preview in: [https://5712341e.graphql-code-generator.pages.dev](https://5712341e.graphql-code-generator.pages.dev)
github-actions[bot] commented 3 weeks ago

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets): Package Version Info
@graphql-codegen/visitor-plugin-common 5.3.0-alpha-20240616104522-4555bc46e3e4ee1c6e0744437585b0e50da232b8 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-document-nodes 4.0.8-alpha-20240616104522-4555bc46e3e4ee1c6e0744437585b0e50da232b8 npm ↗︎ unpkg ↗︎
@graphql-codegen/gql-tag-operations 4.0.8-alpha-20240616104522-4555bc46e3e4ee1c6e0744437585b0e50da232b8 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-operations 4.2.2-alpha-20240616104522-4555bc46e3e4ee1c6e0744437585b0e50da232b8 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-resolvers 4.2.0-alpha-20240616104522-4555bc46e3e4ee1c6e0744437585b0e50da232b8 npm ↗︎ unpkg ↗︎
@graphql-codegen/typed-document-node 5.0.8-alpha-20240616104522-4555bc46e3e4ee1c6e0744437585b0e50da232b8 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript 4.0.8-alpha-20240616104522-4555bc46e3e4ee1c6e0744437585b0e50da232b8 npm ↗︎ unpkg ↗︎
@graphql-codegen/client-preset 4.3.1-alpha-20240616104522-4555bc46e3e4ee1c6e0744437585b0e50da232b8 npm ↗︎ unpkg ↗︎
@graphql-codegen/graphql-modules-preset 4.0.8-alpha-20240616104522-4555bc46e3e4ee1c6e0744437585b0e50da232b8 npm ↗︎ unpkg ↗︎