Compare commits

...

4 Commits

Author SHA1 Message Date
Gogs 644f3697c7 Schemas for Subs 2021-07-25 01:56:18 +02:00
Gogs 31d385d3d4 Schemas for Subs 2021-07-25 01:32:49 +02:00
Gogs ebc7ff4f2f Subscription testing 2021-07-25 01:03:10 +02:00
Gogs 67a58a5277 Schemas 2021-06-24 16:13:34 +02:00
3 changed files with 40 additions and 0 deletions
+2
View File
@@ -6,6 +6,7 @@ use App;
use Config;
use Illuminate\Foundation\AliasLoader;
use GermanAirlinesVa\Graphql\Classes\GraphqlServiceProvider;
use Nuwave\Lighthouse\Subscriptions\SubscriptionServiceProvider;
class Plugin extends PluginBase
{
@@ -34,6 +35,7 @@ class Plugin extends PluginBase
App::make('October\Rain\Support\ClassLoader')->addDirectories('graphql');
$this->bootPackages();
App::register(GraphqlServiceProvider::class);
App::register(SubscriptionServiceProvider::class);
}
public function bootPackages()
+23
View File
@@ -0,0 +1,23 @@
title = "CMS"
==
<?php
use Cms\Classes\Theme;
use Cms\Classes\Content;
function resolveCmsContent($root, $args) {
if (! $theme = Theme::getActiveTheme()) {
throw new \Exception(Lang::get('cms::lang.theme.active.not_found'));
}
return Content::loadCached($theme, $args['name']);
}
?>
==
# Content
extend type Query { cmsContent(name: String!): CmsContent! }
type CmsContent { fileName: String! content: String markup: String parsedMarkup: String }
# CMS-wide types
# Backend\Models\User
type BackendUser { id: ID! }
#System\Models\File
type SystemFile { id: ID path: String title: String description: String }
+15
View File
@@ -0,0 +1,15 @@
title = "Fleet"
==
==
# Content
extend type Query {
aircraft: [Aircraft] @all(model: "GermanAirlinesVa\\Fleet\\Models\\Aircraft")
aircraftType: [AircraftType] @all(model: "GermanAirlinesVa\\Fleet\\Models\\AircraftType")
}
type Subscription {
aircraft: [Aircraft] @subscription(class: "GermanAirlinesVa\\Fleet\\Classes\\Aircraft")
}
type Aircraft { name: String! registration: String! }
type AircraftType { type: String! aircrafts: [Aircraft] @hasMany }