我们如何在 graphQL 中的公共列上进行数据连接。
例如在 SQL 中:选择 t.name 和 z.address,其中 t.id=z.id;
这是如何由 graphQL 查询管理的。
我在Angular中有两项服务:
MonitoringService.service.ts:
import { ClientAppSettingService } from './clientAppSettings.service';
import { Injectable, Inject } from '@angular/core';
@Injectable()
export class MonitoringService
{
constructor(private _clientAppSettingService: ClientAppSettingService)
{
this.getclientAppSettings();
}
getclientAppSettings(): any {
this._clientAppSettingService.getConfig().subscribe(result => {
this.data = result;
}, error => console.error(error));
}
Run Code Online (Sandbox Code Playgroud)
和ClientAppSetting.service.ts:
import { Injectable, Inject } from '@angular/core';
import { AppSettingsClient } from '../models/appSettingsClient';
import { HttpClient } from '@angular/common/http';
@Injectable()
export class ClientAppSettingService {
appUrl: string = "";
constructor(private http: HttpClient, @Inject('BASE_URL') baseUrl: string) {
this.appUrl …Run Code Online (Sandbox Code Playgroud)