-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix issue with import type specifiers
- Loading branch information
1 parent
d5f8300
commit 4814b34
Showing
3 changed files
with
112 additions
and
2 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import * as path from 'path' | ||
|
||
export const input = ` | ||
import gql from 'graphql-tag' | ||
import { DateISOString } from 'date-iso-string' | ||
const query = gql\` | ||
query Test($id: ID!) { | ||
human(id: $id) { | ||
id | ||
name | ||
# @graphql-typegen external as import { type Blah } from 'date-iso-string' | ||
appearsIn | ||
# @graphql-typegen external as import { type DateISOString } from 'date-iso-string' | ||
birthday | ||
} | ||
} | ||
\` | ||
` | ||
|
||
export const options = { | ||
addTypename: false, | ||
schemaFile: path.resolve(__dirname, '../../../starwars.graphql'), | ||
} | ||
|
||
export const expected = ` | ||
import gql from 'graphql-tag' | ||
import { DateISOString, type Blah } from 'date-iso-string' | ||
const query = gql\` | ||
query Test($id: ID!) { | ||
human(id: $id) { | ||
id | ||
name | ||
# @graphql-typegen external as import { type Blah } from 'date-iso-string' | ||
appearsIn | ||
# @graphql-typegen external as import { type DateISOString } from 'date-iso-string' | ||
birthday | ||
} | ||
} | ||
\` | ||
// @graphql-typegen auto-generated | ||
type TestQueryVariables = { | ||
id: string, | ||
} | ||
// @graphql-typegen auto-generated | ||
type TestQueryData = { | ||
human: { | ||
id: string, | ||
name: string, | ||
appearsIn: Array<Blah | null>, | ||
birthday: DateISOString | null, | ||
} | null, | ||
} | ||
` |