Skip to content

Commit

Permalink
Merge pull request #39 from imolorhe/master
Browse files Browse the repository at this point in the history
Master to staging
  • Loading branch information
imolorhe committed Jun 2, 2017
2 parents 0db67bd + 14a4f8e commit 87e5711
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
5 changes: 3 additions & 2 deletions chrome-ext-files/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Altair GraphQL Client",
"short_name": "Altair",
"description": "The only graphQL client you'll ever need.",
"version": "1.2.1",
"version": "1.2.2",
"icons": {
"16": "assets/img/altair_logo_128.png",
"48": "assets/img/altair_logo_128.png",
Expand All @@ -20,5 +20,6 @@
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
"background": {
"scripts": ["js/background.js"]
}
},
"offline_enabled": true
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "altair",
"version": "1.2.1",
"version": "1.2.2",
"license": "MIT",
"main": "electron/main.js",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
(click)="goToType(arg.type.inspect())"
>
{{ arg.name }}
<span class="doc-viewer-item-value" *ngIf="arg.defaultValue">= {{ arg.defaultValue }}</span>
<span class="doc-viewer-item-value" *ngIf="arg.defaultValue && arg.defaultValue.toString">= {{ arg.defaultValue }}</span>
</span>
<span class="doc-viewer-item-type doc-viewer-item-query-type"
<span class="doc-viewer-item-type doc-viewer-item-query-type no-link-link"
(click)="goToType(arg.type.inspect())"
>
{{ arg.type.inspect() }}
Expand All @@ -33,9 +33,11 @@
</div>
</div>
<!--Field type-->
<div class="doc-viewer-section-title">Type</div>
<ng-container *ngIf="gqlSchema && data && gqlSchema.getType(cleanName(data.type.inspect()))">
<app-doc-viewer-type
[data]="gqlSchema.getType(cleanName(data.type.inspect()))"
(goToFieldChange)="goToField($event.name, $event.parentType)"
(goToTypeChange)="goToType($event.name)"
></app-doc-viewer-type>
</ng-container>
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ export class DocViewerFieldComponent implements OnInit {
}

goToField(name, parentType) {
// console.log('field field', name, parentType);
this.goToFieldChange.next({ name, parentType });
}

goToType(name) {
// console.log('field type', name);
this.goToTypeChange.next({ name });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
>
{{ item.name }}
</span>
<ng-container *ngIf="item.args.length">
<ng-container *ngIf="item.args && item.args.length">
(
<span *ngFor="let arg of item.args; let last = last">
<span
class="doc-viewer-item-field no-link-link"
(click)="goToType(arg.type.inspect())"
>
{{ arg.name }}
<span class="doc-viewer-item-value" *ngIf="arg.defaultValue">= {{ arg.defaultValue }}</span>
<span class="doc-viewer-item-value" *ngIf="arg.defaultValue && arg.defaultValue.toString">= {{ arg.defaultValue }}</span>
</span>
<span
class="doc-viewer-item-type no-link-link"
Expand All @@ -54,7 +54,7 @@
)
</ng-container>
<span
class="doc-viewer-item-type doc-viewer-item-query-type"
class="doc-viewer-item-type doc-viewer-item-query-type no-link-link"
(click)="goToType(item.type.inspect())"
>
{{ item.type.inspect() }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<div class="doc-viewer-items">
<div [ngSwitch]="docView.view">
<ng-container *ngSwitchCase="'root'">
<div *ngFor="let item of rootTypes">
<div class="doc-viewer-item" *ngFor="let item of rootTypes">
<span class="no-link-link" *ngIf="item" (click)="goToType(item.name)">{{ item.name }}</span>
</div>
</ng-container>
Expand Down
1 change: 0 additions & 1 deletion src/app/services/gql.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export class GqlService {
if (data) {
const schema = buildClientSchema(data);

console.log(schema.getType('Edition').getValues());
// One type => many fields
// One field => One type
return schema;
Expand Down

0 comments on commit 87e5711

Please sign in to comment.