Skip to content

Commit 28ac9e7

Browse files
Justin ScottMikk Mihkel Nurges
Justin Scott
authored and
Mikk Mihkel Nurges
committed
Checks for lumen when determining schema. (#247)
Lumen returns an array from the Request#routes method. Laravel returns an object or string. This patch checks for the absence of lumen before expecting an object.
1 parent ddc3e2c commit 28ac9e7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Rebing/GraphQL/GraphQLController.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function query(Request $request, $schema = null)
1616
if (is_lumen() && $request->request->count() > 1) {
1717
$schema = implode('/', $request->request->all());
1818
}
19-
elseif ($request->route()->parameters && count($request->route()->parameters) > 1) {
19+
elseif (!is_lumen() && $request->route()->parameters && count($request->route()->parameters) > 1) {
2020
$schema = implode('/', $request->route()->parameters);
2121
}
2222

@@ -68,11 +68,11 @@ protected function queryContext()
6868
public function graphiql(Request $request, $schema = null)
6969
{
7070
$graphqlPath = '/'.config('graphql.prefix');
71-
if ($schema)
71+
if ($schema)
7272
{
7373
$graphqlPath .= '/' . $schema;
7474
}
75-
75+
7676
$view = config('graphql.graphiql.view', 'graphql::graphiql');
7777
return view($view, [
7878
'graphql_schema' => 'graphql_schema',

0 commit comments

Comments
 (0)