|
|
@ -5,7 +5,7 @@ |
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. |
|
|
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
import { Component, ElementRef, OnInit, ViewChild, ViewEncapsulation } from '@angular/core'; |
|
|
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; |
|
|
import { Observable } from 'rxjs'; |
|
|
import { Observable } from 'rxjs'; |
|
|
|
|
|
|
|
|
import * as React from 'react'; |
|
|
import * as React from 'react'; |
|
|
@ -15,17 +15,12 @@ const GraphiQL = require('graphiql'); |
|
|
|
|
|
|
|
|
/* tslint:disable:use-view-encapsulation */ |
|
|
/* tslint:disable:use-view-encapsulation */ |
|
|
|
|
|
|
|
|
import { |
|
|
import { AppsState, GraphQlService } from '@app/shared'; |
|
|
AppsState, |
|
|
|
|
|
GraphQlService, |
|
|
|
|
|
LocalStoreService |
|
|
|
|
|
} from '@app/shared'; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
selector: 'sqx-graphql-page', |
|
|
selector: 'sqx-graphql-page', |
|
|
styleUrls: ['./graphql-page.component.scss'], |
|
|
styleUrls: ['./graphql-page.component.scss'], |
|
|
templateUrl: './graphql-page.component.html', |
|
|
templateUrl: './graphql-page.component.html' |
|
|
encapsulation: ViewEncapsulation.None |
|
|
|
|
|
}) |
|
|
}) |
|
|
export class GraphQLPageComponent implements OnInit { |
|
|
export class GraphQLPageComponent implements OnInit { |
|
|
@ViewChild('graphiQLContainer') |
|
|
@ViewChild('graphiQLContainer') |
|
|
@ -33,8 +28,7 @@ export class GraphQLPageComponent implements OnInit { |
|
|
|
|
|
|
|
|
constructor( |
|
|
constructor( |
|
|
public readonly appsState: AppsState, |
|
|
public readonly appsState: AppsState, |
|
|
private readonly graphQlService: GraphQlService, |
|
|
private readonly graphQlService: GraphQlService |
|
|
private readonly localStoreService: LocalStoreService |
|
|
|
|
|
) { |
|
|
) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -43,11 +37,7 @@ export class GraphQLPageComponent implements OnInit { |
|
|
React.createElement(GraphiQL, { |
|
|
React.createElement(GraphiQL, { |
|
|
fetcher: (params: any) => { |
|
|
fetcher: (params: any) => { |
|
|
return this.request(params); |
|
|
return this.request(params); |
|
|
}, |
|
|
} |
|
|
onEditQuery: (query: string) => { |
|
|
|
|
|
this.localStoreService.set('graphiQlQuery', query); |
|
|
|
|
|
}, |
|
|
|
|
|
query: this.localStoreService.get('graphiQlQuery') |
|
|
|
|
|
}), |
|
|
}), |
|
|
this.graphiQLContainer.nativeElement |
|
|
this.graphiQLContainer.nativeElement |
|
|
); |
|
|
); |
|
|
|