diff --git a/src/language/__tests__/lexer-test.ts b/src/language/__tests__/lexer-test.ts index 8ec91df52f..080431794f 100644 --- a/src/language/__tests__/lexer-test.ts +++ b/src/language/__tests__/lexer-test.ts @@ -936,13 +936,6 @@ describe('Lexer', () => { value: undefined, }); - expect(lexOne('?')).to.contain({ - kind: TokenKind.QUESTION_MARK, - start: 0, - end: 1, - value: undefined, - }); - expect(lexOne('$')).to.contain({ kind: TokenKind.DOLLAR, start: 0, @@ -1188,7 +1181,6 @@ describe('isPunctuatorTokenKind', () => { it('returns true for punctuator tokens', () => { expect(isPunctuatorToken('!')).to.equal(true); - expect(isPunctuatorToken('?')).to.equal(true); expect(isPunctuatorToken('$')).to.equal(true); expect(isPunctuatorToken('&')).to.equal(true); expect(isPunctuatorToken('(')).to.equal(true); diff --git a/src/language/__tests__/printer-test.ts b/src/language/__tests__/printer-test.ts index 5da202ba1a..c890e21198 100644 --- a/src/language/__tests__/printer-test.ts +++ b/src/language/__tests__/printer-test.ts @@ -223,19 +223,6 @@ describe('Printer: Query document', () => { ...frag @onFragmentSpread } } - field3! - field4? - requiredField5: field5! - requiredSelectionSet(first: 10)! @directive { - field - } - unsetListItemsRequiredList: listField[]! - requiredListItemsUnsetList: listField[!] - requiredListItemsRequiredList: listField[!]! - unsetListItemsOptionalList: listField[]? - optionalListItemsUnsetList: listField[?] - optionalListItemsOptionalList: listField[?]? - multidimensionalList: listField[[[!]!]!]! } ... @skip(unless: $foo) { id diff --git a/src/language/__tests__/visitor-test.ts b/src/language/__tests__/visitor-test.ts index d7579abf69..1837c65dd5 100644 --- a/src/language/__tests__/visitor-test.ts +++ b/src/language/__tests__/visitor-test.ts @@ -654,18 +654,6 @@ describe('Visitor', () => { ['leave', 'Field', 1, undefined], ['leave', 'SelectionSet', 'selectionSet', 'Field'], ['leave', 'Field', 0, undefined], - ['enter', 'Field', 1, undefined], - ['enter', 'Name', 'name', 'Field'], - ['leave', 'Name', 'name', 'Field'], - ['enter', 'NonNullAssertion', 'nullabilityAssertion', 'Field'], - ['leave', 'NonNullAssertion', 'nullabilityAssertion', 'Field'], - ['leave', 'Field', 1, undefined], - ['enter', 'Field', 2, undefined], - ['enter', 'Name', 'name', 'Field'], - ['leave', 'Name', 'name', 'Field'], - ['enter', 'ErrorBoundary', 'nullabilityAssertion', 'Field'], - ['leave', 'ErrorBoundary', 'nullabilityAssertion', 'Field'], - ['leave', 'Field', 2, undefined], ['leave', 'SelectionSet', 'selectionSet', 'InlineFragment'], ['leave', 'InlineFragment', 1, undefined], ['enter', 'InlineFragment', 2, undefined], diff --git a/src/language/ast.ts b/src/language/ast.ts index 103b2d1233..6b4b058366 100644 --- a/src/language/ast.ts +++ b/src/language/ast.ts @@ -207,13 +207,7 @@ export const QueryDocumentKeys: { VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'], Variable: ['name'], SelectionSet: ['selections'], - Field: [ - 'alias', - 'name', - 'arguments', - 'directives', - 'selectionSet', - ], + Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'], Argument: ['name', 'value'], FragmentSpread: ['name', 'directives'], diff --git a/src/language/lexer.ts b/src/language/lexer.ts index c20c879700..e849578f22 100644 --- a/src/language/lexer.ts +++ b/src/language/lexer.ts @@ -91,7 +91,6 @@ export class Lexer { export function isPunctuatorTokenKind(kind: TokenKind): boolean { return ( kind === TokenKind.BANG || - kind === TokenKind.QUESTION_MARK || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || @@ -282,13 +281,6 @@ function readNextToken(lexer: Lexer, start: number): Token { return createToken(lexer, TokenKind.PIPE, position, position + 1); case 0x007d: // } return createToken(lexer, TokenKind.BRACE_R, position, position + 1); - case 0x003f: // ? - return createToken( - lexer, - TokenKind.QUESTION_MARK, - position, - position + 1, - ); // StringValue case 0x0022: // " if ( diff --git a/src/language/printer.ts b/src/language/printer.ts index 9b797948b3..1654c9f4ac 100644 --- a/src/language/printer.ts +++ b/src/language/printer.ts @@ -55,13 +55,7 @@ const printDocASTReducer: ASTReducer = { SelectionSet: { leave: ({ selections }) => block(selections) }, Field: { - leave({ - alias, - name, - arguments: args, - directives, - selectionSet, - }) { + leave({ alias, name, arguments: args, directives, selectionSet }) { const prefix = join([wrap('', alias, ': '), name], ''); let argsLine = prefix + wrap('(', join(args, ', '), ')');