0no-co / gql.tada

🪄 Magical GraphQL query engine for TypeScript
https://gql-tada.0no.co
MIT License
2.52k stars 41 forks source link

Unknown directive "@_unmask" Vscode #217

Closed tianyingchun closed 4 months ago

tianyingchun commented 4 months ago

Describe the bug

if we have multi fragment declaration it always give me Unknown directive "@_unmask"

import { graphql } from '@/apollo/graphql';

export const ViewWidgetEntity = graphql(`
// it correct for `@_unmask`
  fragment ViewWidgetEntity on ViewWidgetEntity @_unmask {
    id
    createdAt
    updatedAt
    displayOrder
    entityId
    entityName
    viewWidgetId
  }
`);
import { graphql } from '@/apollo/graphql';

export const ViewWidget = graphql(`
// it give `Unknown directive "@_unmask".` error tips
  fragment ViewWidget on ViewWidget @_unmask {
    id
    createdAt
    updatedAt
    widgetGroupName
    widgetDesc
    widgetPreview
    widgetViewType
    widgetViewConfig
    languageCode
    translations {
      id
      languageCode
      widgetViewConfig
    }
  }
`);
image

Reproduction

No response

gql.tada version

"gql.tada": "1.5.1", "@0no-co/graphqlsp": "1.10.0",

Validations

tianyingchun commented 4 months ago

it just vscode IDE error tips, the application works fine, also run gqldata check

image
JoviDeCroock commented 4 months ago

What do you mean with multi-fragment maybe we are missing a filter here, a more hollistic solution would be to tweak getDiagnostics and use the GraphQL AST instead

tianyingchun commented 4 months ago

it works

kyrylofranko commented 1 month ago

have you found a way to avoid this error? the same in Webstorm

Screenshot 2024-08-04 at 22 21 19
kitten commented 1 month ago

@kyrylofranko This is Webstorm's built in GraphQL support, which at best you'd have to disable. Unfortunately, I'm not sure if they've resolved any issues regarding TypeScript plugins in general, and if gql.tada is now working there. But they responded to issues regarding TypeScript plugins with comments regarding their builtin functionality, which is a bit disappointing