Skip to content

Next major version feature branch #10218

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

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

Next major version feature branch #10218

wants to merge 17 commits into from

Conversation

eddeee888
Copy link
Collaborator

@eddeee888 eddeee888 commented Dec 16, 2024

typescript-resolvers & Federation Changes

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

Refactors

Client Preset

  • Improve Client Preset forwarded and default config

Copy link

changeset-bot bot commented Dec 16, 2024

🦋 Changeset detected

Latest commit: d8919a6

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/cli Major
@graphql-codegen/graphql-modules-preset Major
@graphql-codegen/client-preset Major
@graphql-codegen/core Major
@graphql-codegen/add Major
@graphql-codegen/fragment-matcher Major
@graphql-codegen/introspection Major
@graphql-codegen/schema-ast Major
@graphql-codegen/time Major
@graphql-codegen/typescript-document-nodes Major
@graphql-codegen/gql-tag-operations Major
@graphql-codegen/typescript-operations Major
@graphql-codegen/typed-document-node Major
@graphql-codegen/typescript Major
@graphql-codegen/testing Major

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 6.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/core 5.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/add 6.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/fragment-matcher 6.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/introspection 5.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/schema-ast 5.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/time 6.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/visitor-plugin-common 6.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-document-nodes 5.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/gql-tag-operations 5.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-operations 5.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-resolvers 5.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/typed-document-node 6.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript 5.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/client-preset 5.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/graphql-modules-preset 5.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/testing 4.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎
@graphql-codegen/plugin-helpers 6.0.0-alpha-20250812131146-d8919a6237f19450de571b59081b880c2e7d3494 npm ↗︎ unpkg ↗︎

eddeee888 and others added 9 commits August 5, 2025 22:18
…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
eddeee888 and others added 5 commits August 5, 2025 22:18
…n marked with @external (#10287)

* Ensure @external does not generate resolver types

- Handle external directive when part or whole type is marked
- Add changeset
- Add test cases for @provides and @external

* Format and minor text updates

* Add comments

* Fix __resolveReference not getting generated

* Fix test with __isTypeOf when not needed

* Fix type cast that results in wrong type

* Revert unncessary changes to FieldDefinitionPrintFn

* Re-format

* Convert to use AST Node instead of GraphQL Type

* Update test template

* Cache field nodes to generate for processed objects

* Put FIXME on base-resolvers-visitor to remove Name method
* Update test setup

* Implement @requires combination

* Add changeset

* Force release alpha

* Fix issue with empty array, set up tests

* Generate FederationReferenceTypes once

* Update tests related to FederationReferenceTypes

* Update dev-tests

* Revert force release

* Update test related to mapper
…ion functions (#10377)

* Remove NameNode override and refactor relevant references

* Simplify federation utils by making functions handle nodes

* Fix lint issue
* Add writeOnPartialSuccess flag to partially write successful generateiong

* Update config name from writeOnPartialSuccess to allowPartialOutputs

* Ensure consistent experience on complete failure, update tests

* Restructure code and comment

* Update website schema

* Update doc
* Drop Node 18 support

* Add changeset
* Drop @graphql-tools/prisma-loader

* Add changeset
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