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.81k stars 1.32k forks source link

[federation][resolvers] Add `generateInternalResolversIfNeeded. __resolveReference` to generate `__resolveReference` only when resolvable #9989

Open eddeee888 opened 4 months ago

eddeee888 commented 4 months ago

Description

From Apollo Federation doc: https://www.apollographql.com/docs/federation/federated-types/federated-directives/#resolvable: when there's no resolvable @keys on an object type in a subgraph, we cannot move to the object type in said subgraph.

This PR:

Type of change

Please delete options that are not relevant.

Screenshots/Sandbox (if appropriate/relevant):

Adding links to sandbox or providing screenshots can help us understand more about this PR and take action on it as appropriate

How Has This Been Tested?

changeset-bot[bot] commented 4 months ago

🦋 Changeset detected

Latest commit: 479c1af93bb14f5e9a4626e50a1a6057c0e1af8d

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

This PR includes changesets to release 10 packages | Name | Type | | ------------------------------------------ | ----- | | @graphql-codegen/visitor-plugin-common | Minor | | @graphql-codegen/typescript-resolvers | Minor | | @graphql-codegen/plugin-helpers | 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 4 months 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/cli 5.0.3-alpha-20240930134227-479c1af93bb14f5e9a4626e50a1a6057c0e1af8d npm ↗︎ unpkg ↗︎
@graphql-codegen/visitor-plugin-common 5.4.0-alpha-20240930134227-479c1af93bb14f5e9a4626e50a1a6057c0e1af8d npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-document-nodes 4.0.10-alpha-20240930134227-479c1af93bb14f5e9a4626e50a1a6057c0e1af8d npm ↗︎ unpkg ↗︎
@graphql-codegen/gql-tag-operations 4.0.10-alpha-20240930134227-479c1af93bb14f5e9a4626e50a1a6057c0e1af8d npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-operations 4.3.0-alpha-20240930134227-479c1af93bb14f5e9a4626e50a1a6057c0e1af8d npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-resolvers 4.3.0-alpha-20240930134227-479c1af93bb14f5e9a4626e50a1a6057c0e1af8d npm ↗︎ unpkg ↗︎
@graphql-codegen/typed-document-node 5.0.10-alpha-20240930134227-479c1af93bb14f5e9a4626e50a1a6057c0e1af8d npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript 4.1.0-alpha-20240930134227-479c1af93bb14f5e9a4626e50a1a6057c0e1af8d npm ↗︎ unpkg ↗︎
@graphql-codegen/client-preset 4.4.0-alpha-20240930134227-479c1af93bb14f5e9a4626e50a1a6057c0e1af8d npm ↗︎ unpkg ↗︎
@graphql-codegen/graphql-modules-preset 4.0.10-alpha-20240930134227-479c1af93bb14f5e9a4626e50a1a6057c0e1af8d npm ↗︎ unpkg ↗︎
@graphql-codegen/testing 3.0.4-alpha-20240930134227-479c1af93bb14f5e9a4626e50a1a6057c0e1af8d npm ↗︎ unpkg ↗︎
@graphql-codegen/plugin-helpers 5.1.0-alpha-20240930134227-479c1af93bb14f5e9a4626e50a1a6057c0e1af8d npm ↗︎ unpkg ↗︎
github-actions[bot] commented 4 months ago
### 💻 Website Preview The latest changes are available as preview in: [https://14232f0f.graphql-code-generator.pages.dev](https://14232f0f.graphql-code-generator.pages.dev)