Skip to content

Commit

Permalink
fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
acao committed Sep 10, 2024
1 parent 295c107 commit 66624e5
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 66624e5

Please sign in to comment.