Skip to content
This repository was archived by the owner on Feb 10, 2019. It is now read-only.

normalize $prefix to make it useable as schema #386

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
normalize $prefix to make it useable as schema
hi
this controller uses graphql.prefix config as part of shema name but prefix can be some thing like `api/graphql` or something like it
i just normalize it to make it to search for `api_graphql_schema` instead of `api/graphql_schema` which isn't a valid route param name
for this instance graphql.php is :

```php
[
    'prefix' => 'api/graphql',
    'routes' => '{api_graphql_schema?}',
]
```
  • Loading branch information
RTLer authored Sep 19, 2018
commit b6eafbd19352bd0899e1edecc1680b1955c9af22
2 changes: 1 addition & 1 deletion src/Folklore/GraphQL/GraphQLController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(Request $request)
* @see https://laravel.com/api/5.5/Illuminate/Http/Request.html#method_route
*/

$prefix = config('graphql.prefix');
$prefix = str_replace('/','_',config('graphql.prefix'));

$routeName = is_object($route)
? $route->getName()
Expand Down