From d7e3015df2a365a42a73fa54f361a420f867f546 Mon Sep 17 00:00:00 2001 From: U9G Date: Sun, 22 Oct 2023 00:24:19 -0400 Subject: [PATCH] remove dead code --- .../patches/graphql-language-service@5.1.7.patch | 9 ++++----- experiments/browser_based_querying/pnpm-lock.yaml | 10 +++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/experiments/browser_based_querying/patches/graphql-language-service@5.1.7.patch b/experiments/browser_based_querying/patches/graphql-language-service@5.1.7.patch index 6945964a..b46ea6e9 100644 --- a/experiments/browser_based_querying/patches/graphql-language-service@5.1.7.patch +++ b/experiments/browser_based_querying/patches/graphql-language-service@5.1.7.patch @@ -1,18 +1,17 @@ diff --git a/esm/interface/getAutocompleteSuggestions.js b/esm/interface/getAutocompleteSuggestions.js -index ac159d132d095a789b966627d315f4238c79ab60..ec3fabdd1ed75a2175bbd0c8112ba0437a6398cd 100644 +index ac159d132d095a789b966627d315f4238c79ab60..1d6f624a8ad888ebbe8aa9092feb845a7d8205b0 100644 --- a/esm/interface/getAutocompleteSuggestions.js +++ b/esm/interface/getAutocompleteSuggestions.js -@@ -63,6 +63,9 @@ const hasTypeSystemDefinitions = (sdl) => { +@@ -63,6 +63,8 @@ const hasTypeSystemDefinitions = (sdl) => { } return hasTypeSystemDef; }; +const primitives = new Set(['Int', 'Float', 'String', 'Boolean', 'ID']) -+const edgeDirectives = new Set(['fold', 'recurse', 'optional', 'transform']) +const propertyDirectives = new Set(['filter', 'tag', 'output', 'transform']) export function getAutocompleteSuggestions(schema, queryText, cursor, contextToken, fragmentDefs, options) { var _a; const opts = Object.assign(Object.assign({}, options), { schema }); -@@ -234,7 +237,23 @@ export function getAutocompleteSuggestions(schema, queryText, cursor, contextTok +@@ -234,7 +236,23 @@ export function getAutocompleteSuggestions(schema, queryText, cursor, contextTok return getSuggestionsForVariableDefinition(token, schema, kind); } if (kind === RuleKinds.DIRECTIVE) { @@ -29,7 +28,7 @@ index ac159d132d095a789b966627d315f4238c79ab60..ec3fabdd1ed75a2175bbd0c8112ba043 + if (primitives.has(fieldType.name)) { + return getSuggestionsForDirective(token, state, schema, kind).filter(x => propertyDirectives.has(x.label)) + } else { -+ return getSuggestionsForDirective(token, state, schema, kind)//.filter(x => edgeDirectives.has(x.label)) // Don't filter until we can decide if there is a @transform(op: "count") before this directive ++ return getSuggestionsForDirective(token, state, schema, kind) // Don't filter edges until we can decide if there is a @transform(op: "count") before this directive, which would force us to switch to property directives + } + } else { // there has been no '@' so we should autocomplete fields + return getSuggestionsForFieldNames(token, typeInfo, opts); diff --git a/experiments/browser_based_querying/pnpm-lock.yaml b/experiments/browser_based_querying/pnpm-lock.yaml index 426acdf1..40a61fcb 100644 --- a/experiments/browser_based_querying/pnpm-lock.yaml +++ b/experiments/browser_based_querying/pnpm-lock.yaml @@ -6,7 +6,7 @@ settings: patchedDependencies: graphql-language-service@5.1.7: - hash: jkcxw65ywwhpb6sv4fqdhk6zn4 + hash: qivyzqyfs7hon4wbvvbq7vibpa path: patches/graphql-language-service@5.1.7.patch monaco-editor@0.20.0: hash: uf5fj7h4rxeihd5auffjnde5pu @@ -730,7 +730,7 @@ packages: copy-to-clipboard: 3.3.3 framer-motion: 6.5.1(react-dom@18.1.0)(react@18.1.0) graphql: 16.7.1 - graphql-language-service: 5.1.7(patch_hash=jkcxw65ywwhpb6sv4fqdhk6zn4)(graphql@16.7.1) + graphql-language-service: 5.1.7(patch_hash=qivyzqyfs7hon4wbvvbq7vibpa)(graphql@16.7.1) markdown-it: 12.3.2 react: 18.1.0 react-dom: 18.1.0(react@18.1.0) @@ -2577,7 +2577,7 @@ packages: '@codemirror/language': 6.0.0 codemirror: 5.65.14 graphql: 16.7.1 - graphql-language-service: 5.1.7(patch_hash=jkcxw65ywwhpb6sv4fqdhk6zn4)(graphql@16.7.1) + graphql-language-service: 5.1.7(patch_hash=qivyzqyfs7hon4wbvvbq7vibpa)(graphql@16.7.1) dev: false /codemirror@5.65.14: @@ -3574,7 +3574,7 @@ packages: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} dev: true - /graphql-language-service@5.1.7(patch_hash=jkcxw65ywwhpb6sv4fqdhk6zn4)(graphql@16.7.1): + /graphql-language-service@5.1.7(patch_hash=qivyzqyfs7hon4wbvvbq7vibpa)(graphql@16.7.1): resolution: {integrity: sha512-xkawYMJeoNYGhT+SpSH3c2qf6HpGHQ/duDmrseVHBpVCrXAiGnliXGSCC4jyMGgZQ05GytsZ12p0nUo7s6lSSw==} hasBin: true peerDependencies: @@ -4322,7 +4322,7 @@ packages: prettier: ^2.8.0 || ^3.0.0 dependencies: graphql: 16.7.1 - graphql-language-service: 5.1.7(patch_hash=jkcxw65ywwhpb6sv4fqdhk6zn4)(graphql@16.7.1) + graphql-language-service: 5.1.7(patch_hash=qivyzqyfs7hon4wbvvbq7vibpa)(graphql@16.7.1) monaco-editor: 0.20.0(patch_hash=uf5fj7h4rxeihd5auffjnde5pu) picomatch-browser: 2.2.6 prettier: 2.6.2