mirror of https://github.com/Squidex/squidex.git
14 changed files with 77 additions and 31 deletions
@ -0,0 +1,27 @@ |
|||
/* |
|||
* Squidex Headless CMS |
|||
* |
|||
* @license |
|||
* Copyright (c) Sebastian Stehle. All rights reserved |
|||
*/ |
|||
|
|||
import { HttpClient } from '@angular/common/http'; |
|||
import { Injectable } from '@angular/core'; |
|||
import { Observable } from 'rxjs'; |
|||
|
|||
import { ApiUrlConfig } from 'framework'; |
|||
|
|||
@Injectable() |
|||
export class GraphQlService { |
|||
constructor( |
|||
private readonly http: HttpClient, |
|||
private readonly apiUrl: ApiUrlConfig |
|||
) { |
|||
} |
|||
|
|||
public query(appName: string, params: any): Observable<any> { |
|||
const url = this.apiUrl.buildUrl(`api/content/${appName}/graphql`) |
|||
|
|||
return this.http.post(url, params); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue