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

fix(compose/hoist-field): create new field if the target does not exist #7676

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

ardatan
Copy link
Owner

@ardatan ardatan commented Sep 12, 2024

If the target hoisted field is a new field name that doesn't exist, create that field and keep the
existing one;

createHoistFieldTransform({
  mapping: [
    {
      typeName: 'Query',
      pathConfig: ['users', 'results'],
      newFieldName: 'usersResults',
    },
  ],
})
type Query {
  users(limit: Int!, page: Int): UserSearchResult # Keep this
+ usersResults(limit: Int!, page: Int): [User!]! # Add a new one
}

scalar _HoistConfig

type UserSearchResult {
  page: Int!
}

type User {
  id: ID!
  name: String!
}

Copy link
Contributor

github-actions bot commented Sep 12, 2024

The build artifacts of hive-gateway as a single executable for Linux-X64 are available at:
Download

Copy link
Contributor

github-actions bot commented Sep 12, 2024

Apollo Federation Subgraph Compatibility Results

Federation 1 Support Federation 2 Support
_service🟢
@key (single)🟢
@key (multi)🟢
@key (composite)🟢
repeatable @key🟢
@requires🟢
@provides🟢
federated tracing🟢
@link🟢
@shareable🟢
@tag🟢
@override🟢
@inaccessible🟢
@composeDirective🟢
@interfaceObject🟢

Learn more:

Copy link
Contributor

github-actions bot commented Sep 12, 2024

The build artifacts of mesh-serve as a single executable for macOS-ARM64 are available at:
Download

Copy link
Contributor

github-actions bot commented Sep 12, 2024

💻 Website Preview

The latest changes are available as preview in: https://f071b885.graphql-mesh.pages.dev

Copy link
Contributor

github-actions bot commented Sep 12, 2024

The build artifacts of hive-gateway as a single executable for macOS-X64 are available at:
Download

Copy link
Contributor

The latest changes of this PR are not available as alpha, since there are no linked changesets for this PR.

Copy link
Contributor

github-actions bot commented Sep 12, 2024

The build artifacts of mesh-serve as a single executable for Windows-X64 are available at:
Download

@ardatan ardatan merged commit adc3293 into master Sep 12, 2024
40 of 41 checks passed
@ardatan ardatan deleted the hoist-field branch September 12, 2024 17:11
@enan69500
Copy link

We still have a problem with this config :
{ typeName: "PointOfSale", pathConfig: ["location", "latitude"], newFieldName: "latitude", },

Not on schema generator but on the hive runtime :
image

@ardatan
Copy link
Owner Author

ardatan commented Sep 13, 2024

Make sure you have updated both. Otherwise, could you create a new issue with a reproduction?

@enan69500
Copy link

This bug is with Prefix ... so new issue. Thanks
#7687

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.

2 participants