Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
376 views
in Technique[技术] by (71.8m points)

javascript - VSCODE中的Graphql文件路径自动完成(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 ?(好像我的vscode拒绝给我自动完成.graphql文件导入路径的步骤……您知道为什么吗?)

错误

I've specific Gql extension activated…(我已激活特定的Gql扩展程序…)

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(也定义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…(它也不会在js文件中提供自动完成功能…)

Thank in advance…(预先感谢…)

  ask by ScreamZ translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Looks .graphql filetypes are not included in default vs code autocomplete plugin.(外观.graphql文件类型不包含在默认vs代码自动完成插件中。)

You can install GraphQL prisma.vscode-graphql or similar plugin to achieve this.(您可以安装GraphQL pyramida.vscode-graphql或类似插件来实现此目的。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...