-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include nested fragments in string document mode (#9414)
- Loading branch information
Showing
4 changed files
with
144 additions
and
0 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,6 @@ | ||
--- | ||
'@graphql-codegen/visitor-plugin-common': patch | ||
'@graphql-codegen/client-preset': patch | ||
--- | ||
|
||
Include nested fragments in string documentMode |
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
48 changes: 48 additions & 0 deletions
48
packages/presets/client/tests/fixtures/with-nested-fragment.ts
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,48 @@ | ||
/* eslint-disable @typescript-eslint/ban-ts-comment */ | ||
|
||
//@ts-ignore | ||
const episodeFragment = gql(/* GraphQL */ ` | ||
fragment EpisodeFragment on Episode { | ||
id | ||
title | ||
show { | ||
id | ||
title | ||
} | ||
releaseDate | ||
__typename | ||
} | ||
`); | ||
|
||
//@ts-ignore | ||
const movieFragment = gql(/* GraphQL */ ` | ||
fragment MovieFragment on Movie { | ||
id | ||
title | ||
collection { | ||
id | ||
} | ||
releaseDate | ||
__typename | ||
} | ||
`); | ||
|
||
//@ts-ignore | ||
const videoDetailsFragment = gql(/* GraphQL */ ` | ||
fragment DetailsFragment on Video { | ||
title | ||
__typename | ||
...MovieFragment | ||
...EpisodeFragment | ||
} | ||
`); | ||
|
||
//@ts-ignore | ||
const videoQueryDocument = gql(/* GraphQL */ ` | ||
query Video($id: ID!) { | ||
video(id: $id) { | ||
...DetailsFragment | ||
__typename | ||
} | ||
} | ||
`); |