2

我在 GraphQl(Apollo JS/Graphql Ruby)中遇到了这个错误: Error Error: GraphQL error: Field 'pagination' doesn't accept argument 'pagination' GraphQL error: Variable $pagination is declared by Clients but not used. Reload the page and try again.

我有这个查询:

query Clients($pagination: PaginationInput) {
  clients {
     data {
       ....Fragment
     }
     pagination(pagination: $pagination) {
       ....Fragment
     }

  }
}

我有这个作为我的输入类型:

class PaginatedClientsType < Types::BaseObject
   field :data, ...
   field :pagination, PaginationType ... do 
     argument :pagination, PaginationInput, required: false
   end
end

这在我的query_type.rb文件中:

field :clients, ::Types::Paginated::ClientsType, null: false do
   argument :pagination, PaginationInput, required: false
end

def clients(pagination:)
  ...
end

// and i've added to no avail:
field :pagination ... do
   argument :pagination, PaginationInput, required: false
end
def pagination(pagination:)
...
end

关于如何将论点传递给此顶层以外的其他东西的任何想法client?我在这里阅读过文档,但无法弄清楚。

谢谢!

4

0 回答 0