diff --git a/ui/src/tag/suggest.ts b/ui/src/tag/suggest.ts index c1992dff..040fcbce 100644 --- a/ui/src/tag/suggest.ts +++ b/ui/src/tag/suggest.ts @@ -21,12 +21,13 @@ export const useSuggest = ( const valueResult = useQuery(gqlTags.SuggestTagValue, { variables: {tag: tagKey, query: tagValue}, skip: exactMatch === undefined || skipValue, + fetchPolicy: 'no-cache', }); const usedKeys = usedTags.map((t) => t.tag.key); - const usedValues = usedTags.map((t) => t.value); if (exactMatch && tagValue !== undefined && !skipValue && (allowDuplicateKeys || usedKeys.indexOf(exactMatch.key) === -1)) { + const usedValues = usedTags.filter((t) => t.tag.key === tagKey).map((t) => t.value); return suggestTagValue(exactMatch, tagValue, valueResult, usedValues, createTags); } else { return suggestTag(exactMatch, tagResult, tagKey, usedKeys, allowDuplicateKeys, createTags);