Skip to content

Commit

Permalink
fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
acao committed Sep 9, 2024
1 parent d19672e commit 27d953e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/graphiql/cypress/e2e/docs.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('GraphiQL DocExplorer - search', () => {
beforeEach(() => {
cy.get('.graphiql-sidebar button').eq(0).click();
cy.dataCy('doc-explorer-input').type('test');
cy.dataCy('doc-explorer-option').should('have.length', 7);
cy.dataCy('doc-explorer-option').should('have.length', 8);
});

it('Searches docs for values', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,18 +312,18 @@ export function getAutocompleteSuggestions(
(kind === RuleKinds.OBJECT_FIELD && step === 0)) &&
typeInfo.objectFieldDefs
) {
// @oneOf logic!
console.log(state.prevState?.prevState?.kind, !!typeInfo.inputType);
const { inputType, objectFieldDefs } = typeInfo;
const { string: tokenString } = token;
if (
typeInfo?.inputType &&
'isOneOf' in typeInfo.inputType &&
typeInfo?.inputType?.isOneOf === true &&
(state.prevState?.prevState?.kind !== 'Argument' || token.string !== '{')
inputType &&
'isOneOf' in inputType &&
inputType?.isOneOf === true &&
(prevState?.prevState?.kind !== 'Argument' || tokenString !== '{')
) {
// return empty array early if a oneOf field has already been provided
return [];
}
const objectFields = objectValues(typeInfo.objectFieldDefs);
const objectFields = objectValues(objectFieldDefs);
const completionKind =
kind === RuleKinds.OBJECT_VALUE
? CompletionItemKind.Value
Expand Down

0 comments on commit 27d953e

Please sign in to comment.