2
我是Graphql的新手。对于简单的用例,假设我有简单的模型,Graphql ruby中字段和连接的区别?
class Post < ActiveRecord::Base
has_many :comments
end
下面是我的graphql query_type.rb
PostType = GraphQL::ObjectType.define do
#field :comments, types[CommentType]
#connection :comments, CommentType.connection_type
end
两个field and connection
对我的作品的代码。但是哪一条是正确的路要走。