Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {DataSourceService} from "@tsed/graphql";
import {RESTDataSource} from "apollo-datasource-rest";
import {User} from "../models/User";
@DataSourceService()
export class UserDataSource extends RESTDataSource {
constructor() {
super();
this.baseURL = "https://myapi.com/api/users";
}
getUserById(id: string): Promise {
return this.get(`/${id}`);
}
}