我有一个graphql端点“ https://api.sorare.com/graphql/playground/ ”我想调用这个API端点,调用查询并通过apollo数据源从中制作一个Graphql API,但我不知道如何接近它
数据源
const { RESTDataSource } = require("apollo-datasource-rest");
class PlayerInfoAPI extends RESTDataSource {
constructor() {
super();
this.baseURL = "https://api.sorare.com/graphql/playground/";
}
async getPlayerInfo(slug) {
try {
const re =await this.get()
} catch (err) {
console.log(err);
}
}
}
module.exports = PlayerInfoAPI;