Skip to content

Commit 14b5597

Browse files
authored
fix(graphql): query scope (#1184)
1 parent 7fff546 commit 14b5597

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

app/GraphQL/Mutations/List/SyncExternalProfileMutation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
namespace App\GraphQL\Mutations\List;
66

77
use App\Concerns\GraphQL\RunMiddlewares;
8-
use App\Exceptions\GraphQL\GraphQLAuthorizationException;
98
use App\Features\AllowExternalProfileManagement;
109
use App\Http\Middleware\Api\EnabledOnlyOnLocalhost;
1110
use App\Models\List\ExternalProfile;
1211
use Illuminate\Support\Arr;
1312
use Laravel\Pennant\Middleware\EnsureFeaturesAreActive;
13+
use Nuwave\Lighthouse\Exceptions\AuthorizationException;
1414

1515
class SyncExternalProfileMutation
1616
{
@@ -30,7 +30,7 @@ public function __invoke(null $_, array $args): array
3030

3131
throw_unless(
3232
$profile->canBeSynced(),
33-
GraphQLAuthorizationException::class,
33+
AuthorizationException::class,
3434
'This external profile cannot be synced at the moment.'
3535
);
3636

graphql/Models/Admin/announcement.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ extend type Query {
1717
"Returns a listing of announcement resources given fields."
1818
announcementPagination(
1919
sort: [AnnouncementSort!] @sort
20-
): [Announcement!]! @paginate @scope(name: "current")
20+
): [Announcement!]! @paginate(scopes: ["current"])
2121
}

graphql/Models/Admin/dump.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ extend type Query {
2525
dumpPagination(
2626
where: _ @whereConditions(columnsEnum: DumpFilterableColumns, handler: "App\\GraphQL\\WhereConditions\\WhereConditionsHandler")
2727
sort: [DumpSort!] @sort
28-
): [Dump!]! @paginate @scope(name: "public")
28+
): [Dump!]! @paginate(scopes: ["public"])
2929
}

graphql/Models/Admin/featuredtheme.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ type FeaturedTheme @model(class: "App\\Models\\Admin\\FeaturedTheme") {
2424

2525
extend type Query {
2626
"Returns the first featured theme where the current date is between start_at and end_at dates."
27-
currentfeaturedtheme: FeaturedTheme @scope(name: "current") @first(model: "App\\Models\\Admin\\FeaturedTheme")
27+
currentfeaturedtheme: FeaturedTheme @first(model: "App\\Models\\Admin\\FeaturedTheme", scopes: ["current"])
2828
}

0 commit comments

Comments
 (0)