在Graphql中,schema和documents有什么区别?
Schema如下:
type Query {
fo: String
}
但是文件的样式为:
query SomeQuery {
foo {
bar
}
}
这个规范真的很令人困惑。https://graphql.github.io/graphql-spec/June2018/#sec-Language.Document
我通常使用 schema,但是在 graphql-code-generator 中为了客户端类型生成需要文档文件。https://graphql-code-generator.com/docs/getting-started/documents-field