graphql / vscode-graphql

MIGRATED: VSCode GraphQL extension (autocompletion, go-to definition, syntax highlighting)
https://marketplace.visualstudio.com/items?itemName=Prisma.vscode-graphql
MIT License
555 stars 71 forks source link

Inline fragment(s) not working #341

Closed pruss closed 2 years ago

pruss commented 2 years ago

Actual Behavior

Having segment which should return different properties depending on the type. Instead of return valid data it just returns null. As query is working with different other ide it's not a problem with the query.

Expected Behavior

Inline fragments returns valid data Result:

{
  "data": {
    "content": {
      "content": {
        "id": "1168",
        "locale": "de-DE",
        "version": "6",
        "options": [
          {
            "id": "3198",
            "hexCode": "#c0c0c0",
            "value": "silber"
          },
          {
            "id": "3188",
            "value": "Purple Zuhause"
          },
          {
            "id": "7468",
            "value": "1"
          },
          {
            "id": "5238",
            "value": "Apple"
          }
        ]
      }
    }
  }
}

Steps to Reproduce the Problem Or Description

query getDTAttribute($Id: String! = "1168") {
  content {
    content(id: $Id) {
      ...Attribute
    }
  }
}
fragment Attribute on DTAttribute {
  id
  locale
  version
  options {
    ... on DTAttColorImpl {
      id
      hexCode
    }
    ... on DTAttOptionImpl {
      id
    }
    value
  }
}

Result:

{
  "data": null
}

Specifications

Logs Of TS Server || GraphQL Language Service

acao commented 2 years ago

is this when using the in-extension query execution? I think I know what could be the issue..

pruss commented 2 years ago

Yes.

pruss commented 2 years ago

0.3.21 breaks inline query execution?

pruss commented 2 years ago

With this version the extension can't be activated?

acao commented 2 years ago

huh that is strange, we have the extension activating all the time now using *

acao commented 2 years ago

added to the lsp here

https://github.com/graphql/graphiql/pull/2111