graphql / graphql/graphiql

Does not work in .vue components files - except highlighting

Open
#2,195 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
16.9k
Forks
1.9k
Avg merge
22h 45m
Merged PRs (30d)
70

Description

## Actual Behavior

Query code does not work in .vue files.

When I try to write query on .vue `` nothing works except syntax highlighting (so I guess extension detect's code block correctly). No auto completions, suggestions etc.
But in .ts, .graphql and other files everything works perfectly, so my API schema if for sure loaded correctly.

It does not matter if I use `gql` or `#graphql`.

Also, .vue does work fine in vscode Apollo extension, but not in this one.

## Expected Behavior

It should work in .vue components.

In extension features it's listed

> Load the extension on detecting gql tag in js, ts, jsx, tsx, **vue** files

Also I can see vue in extension source code.

So I think this extension supposed to support vue out of the box?

## Steps to Reproduce the Problem Or Description

demo.vue
```
<template>
<div />
</template>

<script setup>
const demo = `#graphql
query {
me {
id,
email
}
}
`

```

.graphqlrc.js
```
module.exports = {
schema: 'http://localhost:8085/graphql'
};
```

or

```
module.exports = {
schema: 'http://localhost:8085/graphql',
documents: 'src/**/*.{graphql,js,ts,jsx,tsx,vue}'
};
```
Tried multiple config approach, nothing works. But again, I thing it supposed to detect .vue automatically anyway?

## Specifications

- GraphQL for VSCode Extension Version: v0.3.50 or v0.3.41
- VSCode Version: 1.63
- OS Name: Linux Mint
- OS Version: 20.2
- .graphqlrc.js multiple formats

## Logs Of TS Server || GraphQL Language Service
```
1/2/2022, 10:27:49 PM [3] (pid: 66114) graphql-language-service-usage-logs: {"type":"usage","messageType":"initialize"}
```
```

[Info - 21:27:49.99] Starting TS Server
[Info - 21:27:49.99] Using tsserver from: /usr/share/code/resources/app/extensions/node_modules/typescript/lib/tsserver.js
[Info - 21:27:49.101] Forking...
[Info - 21:27:49.107] Starting...
[Info - 21:27:49.108] Forking...
[Info - 21:27:49.111] Starting...
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.