Skip to content

Commit 66624e5

Browse files
committed
fix eslint
1 parent 295c107 commit 66624e5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/graphiql/cypress/e2e/docs.cy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('GraphiQL DocExplorer - search', () => {
2222
beforeEach(() => {
2323
cy.get('.graphiql-sidebar button').eq(0).click();
2424
cy.dataCy('doc-explorer-input').type('test');
25-
cy.dataCy('doc-explorer-option').should('have.length', 7);
25+
cy.dataCy('doc-explorer-option').should('have.length', 8);
2626
});
2727

2828
it('Searches docs for values', () => {

packages/graphql-language-service/src/interface/getAutocompleteSuggestions.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -312,18 +312,18 @@ export function getAutocompleteSuggestions(
312312
(kind === RuleKinds.OBJECT_FIELD && step === 0)) &&
313313
typeInfo.objectFieldDefs
314314
) {
315-
// @oneOf logic!
316-
console.log(state.prevState?.prevState?.kind, !!typeInfo.inputType);
315+
const { inputType, objectFieldDefs } = typeInfo;
316+
const { string: tokenString } = token;
317317
if (
318-
typeInfo?.inputType &&
319-
'isOneOf' in typeInfo.inputType &&
320-
typeInfo?.inputType?.isOneOf === true &&
321-
(state.prevState?.prevState?.kind !== 'Argument' || token.string !== '{')
318+
inputType &&
319+
'isOneOf' in inputType &&
320+
inputType?.isOneOf === true &&
321+
(prevState?.prevState?.kind !== 'Argument' || tokenString !== '{')
322322
) {
323323
// return empty array early if a oneOf field has already been provided
324324
return [];
325325
}
326-
const objectFields = objectValues(typeInfo.objectFieldDefs);
326+
const objectFields = objectValues(objectFieldDefs);
327327
const completionKind =
328328
kind === RuleKinds.OBJECT_VALUE
329329
? CompletionItemKind.Value

0 commit comments

Comments
 (0)