I was trying to use the graphql query within ruby to fetch github repositories. Before writing the query, I was working on getting the graphql-client working. I'm facing issues with graphql client.
I was following this link for graphql client: https://github.com/github/graphql-client
require 'graphql'
require 'graphql/client'
require 'graphql/client/http'
module MyGraphQL
HTTP = GraphQL::Client::HTTP.new('https://github.com/graphql') do
def client_context
{ access_token: 'xxxxxxxxxxxxxxxxxx' }
end
def headers(_context)
client_context
end
end
Schema = GraphQL::Client.load_schema(HTTP)
Client = GraphQL::Client.new(schema: Schema, execute: HTTP)
end
I'm getting the following errors in a terminal:
'fetch': key not found: "data" (KeyError)
'load'
'load_schema'
'load_schema'