GraphQL:尝试查询时的未知关键字

时间:2017-10-24 19:45:53

标签: ruby graphql

我目前正在使用github / graphql-client ruby​​ gem来尝试查询我的GraphQL API。这就是我所拥有的。

module MyAPI
  HTTP = GraphQL::Client::HTTP.new("http://myapi.com/graphql")
  Schema = GraphQL::Client.load_schema(HTTP)
  Client = GraphQL::Client.new(schema: Schema, execute: HTTP)
end

# Create the query.
CreateMeeting = MyAPI::Client.parse <<-'GRAPHQL'
  mutation CreateMeeting($name: String!, $meeting_id: String!){
    createMeeting(name: $name, meeting_id: $meeting_id){
      name
    }
  }
GRAPHQL

meeting = {name: 'test', meeting_id: 'm_id'}
MyAPI::Client.query(CreateMeeting, meeting)

这给了我以下错误:

unknown keywords: name, meeting_id

我不确定导致这种情况的原因,因为在API名称和meeting_id的createMeeting中定义为String参数。

感谢任何帮助!

0 个答案:

没有答案