-
Notifications
You must be signed in to change notification settings - Fork 334
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(compose/hoist-field): create new field if the target does not exi…
…st (#7676) * fix(compose/hoist-field): create new field if the target does not exist * Update changeset * Update snapshots
- Loading branch information
Showing
16 changed files
with
238 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
'@graphql-mesh/fusion-composition': patch | ||
'@graphql-mesh/fusion-runtime': patch | ||
--- | ||
|
||
If the target hoisted field is a new field name that doesn't exist, create that field and keep the | ||
existing one; | ||
|
||
```ts | ||
createHoistFieldTransform({ | ||
mapping: [ | ||
{ | ||
typeName: 'Query', | ||
pathConfig: ['users', 'results'], | ||
newFieldName: 'usersResults', | ||
}, | ||
], | ||
}) | ||
``` | ||
|
||
```diff | ||
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! | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.