ScreamZ
ScreamZ

Reputation: 602

Graphql file path autocompletion in VSCODE

Looks like my vscode refuse to give me auto-completion on .graphql file import path… Do you have any idea why ?error

I've specific Gql extension activated…

Name: GraphQL for VSCode
Id: kumar-harsh.graphql-for-vscode
Description: GraphQL syntax highlighting, linting, auto-complete, and more!
Version: 1.15.3
Publisher: Kumar Harsh
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=kumar-harsh.graphql-for-vscode

Also definition TS

declare module '*/get-course.gql' {
  import { DocumentNode } from 'graphql';
  const defaultDocument: DocumentNode;
  export const GetCourses: DocumentNode;

  export default defaultDocument;
}

It doesn't give auto-complete in js file neither…

Thank in advance…

Upvotes: 2

Views: 1740

Answers (2)

SkrewEverything
SkrewEverything

Reputation: 2523

I know it is an almost 2 years old question but I just encountered the same problem.

I just wanted to post the answer for anyone with the same problem.

Installing this very popular Path Intellisense (~5M downloads) plugin solved my problem and VSCode started showing autocompletion for my graphql files.

Before installing the plugin: enter image description here

After installing the plugin: enter image description here

Upvotes: 2

Pramod S. Nikam
Pramod S. Nikam

Reputation: 4539

Looks .graphql filetypes are not included in default vs code autocomplete plugin.

You can install GraphQL prisma.vscode-graphql or similar plugin to achieve this.

Upvotes: -1

Related Questions