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

Next major version feature branch #10218

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Next major version feature branch #10218

wants to merge 10 commits into from

Conversation

eddeee888
Copy link
Collaborator

@eddeee888 eddeee888 commented Dec 16, 2024

Related: #10206

Breaking Changes

  • No longer generate UnwrappedObject utility type, as this was used to support the wrong previously generated type.
  • Deprecate onlyResolveTypeForInterfaces because majority of use cases cannot implement resolvers in Interfaces.
  • Deprecate generateInternalResolversIfNeeded.__resolveReference because types do not have __resolveReference if they are not Federation entities or are not resolvable. Users should not have to manually set this option. This option was put in to wait for this major version.
  • Do not generate __isTypeOf for non-implementing-types or non-union-members
  • Do not inline parent types for Federation Entities resolvers anymore. This makes handling mappers and deciding @external, @provides and @key @key scenarios easier

Copy link

changeset-bot bot commented Dec 16, 2024

🦋 Changeset detected

Latest commit: 0b0c9bf

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

This PR includes changesets to release 18 packages
Name Type
@graphql-codegen/visitor-plugin-common Major
@graphql-codegen/typescript-resolvers Major
@graphql-codegen/plugin-helpers Major
@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/introspection Patch
@graphql-codegen/client-preset Patch
@graphql-codegen/graphql-modules-preset Patch
@graphql-codegen/cli Patch
@graphql-codegen/core Patch
@graphql-codegen/testing Patch
@graphql-codegen/add Patch
@graphql-codegen/fragment-matcher Patch
@graphql-codegen/schema-ast Patch
@graphql-codegen/time 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

Copy link
Contributor

github-actions bot commented Dec 16, 2024

💻 Website Preview

The latest changes are available as preview in: https://pr-10218.graphql-code-generator.pages.dev

Copy link
Contributor

github-actions bot commented Jan 9, 2025

🚀 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.6-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/core 4.0.3-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/add 5.0.4-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/fragment-matcher 5.1.1-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/introspection 4.0.4-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/schema-ast 4.1.1-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/time 5.0.2-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/visitor-plugin-common 6.0.0-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-document-nodes 4.0.17-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/gql-tag-operations 4.0.18-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-operations 4.6.1-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-resolvers 5.0.0-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/typed-document-node 5.1.2-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript 4.1.7-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/client-preset 4.8.1-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/graphql-modules-preset 4.0.17-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/testing 3.0.5-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎
@graphql-codegen/plugin-helpers 6.0.0-alpha-20250329081240-1a64f6d2f211bdd3623a04b001a1dab8e0c92d3c npm ↗︎ unpkg ↗︎

@eddeee888 eddeee888 changed the title Federation feature branch Next major version feature branch Jan 28, 2025
@eddeee888 eddeee888 force-pushed the federation-fixes branch 2 times, most recently from fd51b95 to 56fea45 Compare January 29, 2025 09:27
eddeee888 and others added 9 commits March 21, 2025 21:21
…face` entities, fix Interface types having non-meta resolver fields (#10221)

* Add __resolveReference for applicable Interfaces

- Deprecate generateInternalResolversIfNeeded.__resolveReference
- Fix tests
- Deprecate onlyResolveTypeForInterfaces
- Add changeset
- Cleanup
- Handle __resolveReference generation in Interface
- Let FieldDefinition decide whether to generate __resolveReference by checking whether parent has resolvable key

* Fix test
…pes (of Interfaces) or Union members (#10283)

* Implement logic to only generate __isTypeOf for implementing types OR union members

* Remove unused types

* Add changeset

* Remove generateInternalResolversIfNeeded

* Fix dev tests

* Refactor to use parsedSchemaMeta
…esolversParentTypes instead of each resolver (#10297)

* Bring reference selection set to ResolversParentTypes

* Put back old types to extractReferenceSelectionSet

* Update tests for TDD

* Handle parent type consistently for __resolveReference and subsequent resolvers

* Update tests
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.

1 participant