嗨,我有一个 Graphql 请求,我想使用 RestClient 发送,任何人都可以给我建议我该怎么做我想要这种形式的东西
response = RestClient.post("http://localhost:3000/graphql", default_headers,payload) 因为在下面的方法中我使用的是 Graphlient::Client ,它使用了大量的内存。
def make_request(id)
client = Graphlient::Client.new("http:localhost:3000/graphql", headers: {
'Authorization': "API #{@api_key}"
})
query = <<-GRAPHQL
query ($input: FilterInput, $first: Int) {
filterLocations(input: $input, first: $first) {
edges {
cursor
node {
id
attributes{
name
value
}
photos{
fileSize
id
name
}
business{
start
end
}
city
country
GRAPHQL
variables = {
"first": 1,
"input": {
"attributes": [
{
"name": "test",
"value": [
id
]
}
]
}
}
end