This commit is contained in:
Your Name 2021-08-04 00:56:18 +02:00
parent 51941b88ee
commit f01509cab1
12 changed files with 112 additions and 139 deletions

View File

@ -14,10 +14,9 @@ class Authentication
public function handle($request, Closure $next)
{
if ($request->input('gql_session') === 'SUPER_SECRET_TOKEN') {
return "false";
}
else {
return "true";
return 'false';
} else {
return 'true';
}
return $next($request);

View File

@ -43,8 +43,11 @@ class Plugin extends PluginBase
$this->app->singleton(DatabaseManager::class, function ($app) {
return $app->make('db');
});
\Illuminate\Support\Facades\Broadcast::routes(['prefix' => '', 'middleware' => 'GermanAirlinesVA\\Graphql\\Classes\\Authentication']);
require("channels/channels.php");
\Illuminate\Support\Facades\Broadcast::routes([
'prefix' => '',
'middleware' => 'GermanAirlinesVA\\Graphql\\Classes\\Authentication',
]);
require 'channels/channels.php';
Config::set('database.connections.germanairlinesva_graphql', Config::get('germanairlinesva.graphql::connection'));
}

View File

@ -15,10 +15,9 @@ class Authentication
public function handle($request, Closure $next)
{
if ($request->header('Gql-Session') === 'SUPER_SECRET_KEY_HEADER') {
return "";
}
else {
throw new AccessDeniedHttpException;
return '';
} else {
throw new AccessDeniedHttpException();
}
return $next($request);

View File

@ -69,6 +69,6 @@ class Dummy extends GraphQLSubscription
*/
public function resolve($root, array $args, GraphQLContext $context, ResolveInfo $resolveInfo): array
{
return array($root);
return [$root];
}
}

View File

@ -5,7 +5,7 @@ use BackendMenu;
class GraphqlKey extends Controller
{
public $implement = [ 'Backend\Behaviors\ListController' ];
public $implement = ['Backend\Behaviors\ListController'];
public $listConfig = 'config_list.yaml';

View File

@ -11,7 +11,8 @@
data-trigger=".control-list input[type=checkbox]"
data-trigger-condition="checked"
data-request-success="$(this).prop('disabled', true)"
data-stripe-load-indicator>
data-stripe-load-indicator
>
<?= e(trans('backend::lang.list.delete_selected')) ?>
</button>
</div>

View File

@ -1,5 +1,4 @@
title = "CMS"
==
title = "CMS" ==
<?php
use Cms\Classes\Theme;
use Cms\Classes\Content;
@ -12,12 +11,6 @@ function resolveCmsContent($root, $args) {
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 }
== # 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 }

View File

@ -1,32 +1,8 @@
title = "Fleet"
==
==
# Content
extend type Query {
aircraft: [Aircraft] @all(model: "GermanAirlinesVa\\Fleet\\Models\\Aircraft")
aircraftType: [AircraftType] @all(model: "GermanAirlinesVa\\Fleet\\Models\\AircraftType")
}
extend type Subscription {
aircraftAdded: Aircraft @subscription(class: "GermanAirlinesVa\\Fleet\\Classes\\AircraftAdded")
}
extend type Mutation {
addAircraft(
aircraft_type_id: ID!,
home_airport_id: ID!,
name: String!,
registration: String!
): Aircraft
@create(model: "GermanAirlinesVa\\Fleet\\Models\\Aircraft")
@broadcast(subscription: "aircraftAdded")
}
type Aircraft {
id: ID!
aircraft_type_id: ID!
home_airport_id: ID!
name: String!
registration: String!
}
type AircraftType { type: String! aircrafts: [Aircraft] @hasMany }
title = "Fleet" == == # Content extend type Query { aircraft: [Aircraft] @all(model:
"GermanAirlinesVa\\Fleet\\Models\\Aircraft") aircraftType: [AircraftType] @all(model:
"GermanAirlinesVa\\Fleet\\Models\\AircraftType") } extend type Subscription { aircraftAdded: Aircraft
@subscription(class: "GermanAirlinesVa\\Fleet\\Classes\\AircraftAdded") } extend type Mutation { addAircraft(
aircraft_type_id: ID!, home_airport_id: ID!, name: String!, registration: String! ): Aircraft @create(model:
"GermanAirlinesVa\\Fleet\\Models\\Aircraft") @broadcast(subscription: "aircraftAdded") } type Aircraft { id: ID!
aircraft_type_id: ID! home_airport_id: ID! name: String! registration: String! } type AircraftType { type: String!
aircrafts: [Aircraft] @hasMany }

View File

@ -23,11 +23,13 @@
'engine' => 'Engine',
'enable_cache' => [
'label' => 'Enable Schema Cache',
'comment' => 'A large part of the Schema generation is parsing the various graph definition into an AST. These operations are pretty expensive so it is recommended to enable caching in production mode.',
'comment' =>
'A large part of the Schema generation is parsing the various graph definition into an AST. These operations are pretty expensive so it is recommended to enable caching in production mode.',
],
'batched_queries' => [
'label' => 'Batched Queries',
'comment' => 'GraphQL query batching means sending multiple queries to the server in one request. You may set this flag to process/deny batched queries.',
'comment' =>
'GraphQL query batching means sending multiple queries to the server in one request. You may set this flag to process/deny batched queries.',
],
],
];