This repository was archived by the owner on Sep 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
[EXPERIMENTAL] - support inputUnion #351
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
704269d
add inputUnion fork, get tests running
acao f206810
cleanup, update contributing guidelines
acao 6465439
fix command in CONTRIBUTING
acao 7899f65
cleanup tests
acao d2e0716
return InputDef, add more examples
acao 90f58ed
used NamedType instead of InputDef in InputUnionMember parser rules
acao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -81,6 +81,8 @@ export const ParseRules: {[name: string]: ParseRule} = { | |
return 'EnumDef'; | ||
case 'input': | ||
return 'InputDef'; | ||
case 'inputUnion': | ||
return 'InputUnionDef'; | ||
case 'extend': | ||
return 'ExtendDef'; | ||
case 'directive': | ||
|
@@ -196,6 +198,7 @@ export const ParseRules: {[name: string]: ParseRule} = { | |
Type(token: Token) { | ||
return token.value === '[' ? 'ListType' : 'NonNullType'; | ||
}, | ||
InputUnionValue: [p('{'), list('ObjectField'), p('}')], | ||
// NonNullType has been merged into ListType to simplify. | ||
ListType: [p('['), 'Type', p(']'), opt(p('!'))], | ||
NonNullType: ['NamedType', opt(p('!'))], | ||
|
@@ -252,6 +255,14 @@ export const ParseRules: {[name: string]: ParseRule} = { | |
list('UnionMember', p('|')), | ||
], | ||
UnionMember: ['NamedType'], | ||
InputUnionDef: [ | ||
word('inputUnion'), | ||
name('atom'), | ||
list('Directive'), | ||
p('='), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think we need the optional |
||
list('InputUnionMember', p('|')), | ||
], | ||
InputUnionMember: ['NamedType'], | ||
EnumDef: [ | ||
word('enum'), | ||
name('atom'), | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't figure out how to get
Value
to return this in the case statement above, but maybe that's because I never saw akind
for it?