Skip to content

Commit

Permalink
npm test passing
Browse files Browse the repository at this point in the history
  • Loading branch information
twof committed Dec 20, 2023
1 parent dc7bcf1 commit 03eab4e
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 55 deletions.
8 changes: 0 additions & 8 deletions src/language/__tests__/lexer-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
13 changes: 0 additions & 13 deletions src/language/__tests__/printer-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions src/language/__tests__/visitor-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
8 changes: 1 addition & 7 deletions src/language/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
8 changes: 0 additions & 8 deletions src/language/lexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down Expand Up @@ -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 (
Expand Down
8 changes: 1 addition & 7 deletions src/language/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,7 @@ const printDocASTReducer: ASTReducer<string> = {
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, ', '), ')');

Expand Down

0 comments on commit 03eab4e

Please sign in to comment.