-
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: don't extract field types of extract input types
- Loading branch information
1 parent
3c37706
commit 93f5f85
Showing
3 changed files
with
59 additions
and
1 deletion.
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,47 @@ | ||
import * as path from 'path' | ||
|
||
export const file = 'file.js' | ||
|
||
export const input = ` | ||
// @flow | ||
import gql from 'graphql-tag' | ||
const mutation = gql\` | ||
mutation testExtractInput( | ||
# @graphql-typegen extract | ||
$input: TestExtractInput! | ||
) { | ||
testExtractInput(input: $input) | ||
} | ||
\` | ||
` | ||
|
||
export const options = { | ||
addTypename: false, | ||
schemaFile: path.resolve(__dirname, '../../starwars.graphql'), | ||
} | ||
|
||
export const expected = ` | ||
// @flow | ||
import gql from 'graphql-tag' | ||
import { type DateISOString } from '../../src/DateISOString' | ||
const mutation = gql\` | ||
mutation testExtractInput( | ||
# @graphql-typegen extract | ||
$input: TestExtractInput! | ||
) { | ||
testExtractInput(input: $input) | ||
} | ||
\` | ||
// @graphql-typegen auto-generated | ||
type TestExtractInputMutationVariables = { input: TestExtractInput } | ||
// @graphql-typegen auto-generated | ||
type TestExtractInput = { | ||
foo: string, | ||
bar: number, | ||
date?: ?DateISOString, | ||
json?: ?mixed, | ||
} | ||
// @graphql-typegen auto-generated | ||
type TestExtractInputMutationData = { testExtractInput: ?boolean } | ||
` |