【问题标题】:How to format graphql schema like golang struct in vscode?如何在vscode中格式化像golang struct这样的graphql模式?
【发布时间】:2020-12-26 23:35:42
【问题描述】:

如何让它的格式和上面的一样?

input UpsertMerchantInput {
    id:          ID     @rules(apply: ["bail","sometimes","exists:merchants,id"])
    name:        String @rules(apply: ["required_without:input.id","max:255"])
    description: String @rules(apply: ["required_without:input.id","max:3000"])
    logo:        Upload @rules(apply: ["required_without:input.id","image"])
    firebase:    Upload @rules(apply: ["required_without:input.id","mimetypes:application/json"])
}

input UpsertMerchantInput {
    id: ID @rules(apply: ["bail", "sometimes", "exists:merchants,id"])
    name: String @rules(apply: ["required_without:input.id", "max:255"])
    description: String @rules(apply: ["required_without:input.id", "max:3000"])
    logo: Upload @rules(apply: ["required_without:input.id", "image"])
    firebase: Upload
    @rules(apply: ["required_without:input.id", "mimetypes:application/json"])
}

只是添加一些额外的垃圾文本以通过 stackoverflow 后验证...

【问题讨论】:

标签: visual-studio-code graphql schema formatter


【解决方案1】:

是的,我只是制作自己的格式化程序 https://marketplace.visualstudio.com/items?itemName=sooxt.pretty-graphql

【讨论】:

    猜你喜欢
    • 2021-04-29
    • 2018-12-22
    • 2016-10-27
    • 1970-01-01
    • 2023-04-10
    • 1970-01-01
    • 2014-12-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多