mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
fix(graphql): query scope (#1184)
This commit is contained in:
@@ -5,12 +5,12 @@ declare(strict_types=1);
|
||||
namespace App\GraphQL\Mutations\List;
|
||||
|
||||
use App\Concerns\GraphQL\RunMiddlewares;
|
||||
use App\Exceptions\GraphQL\GraphQLAuthorizationException;
|
||||
use App\Features\AllowExternalProfileManagement;
|
||||
use App\Http\Middleware\Api\EnabledOnlyOnLocalhost;
|
||||
use App\Models\List\ExternalProfile;
|
||||
use Illuminate\Support\Arr;
|
||||
use Laravel\Pennant\Middleware\EnsureFeaturesAreActive;
|
||||
use Nuwave\Lighthouse\Exceptions\AuthorizationException;
|
||||
|
||||
class SyncExternalProfileMutation
|
||||
{
|
||||
@@ -30,7 +30,7 @@ class SyncExternalProfileMutation
|
||||
|
||||
throw_unless(
|
||||
$profile->canBeSynced(),
|
||||
GraphQLAuthorizationException::class,
|
||||
AuthorizationException::class,
|
||||
'This external profile cannot be synced at the moment.'
|
||||
);
|
||||
|
||||
|
||||
@@ -17,5 +17,5 @@ extend type Query {
|
||||
"Returns a listing of announcement resources given fields."
|
||||
announcementPagination(
|
||||
sort: [AnnouncementSort!] @sort
|
||||
): [Announcement!]! @paginate @scope(name: "current")
|
||||
): [Announcement!]! @paginate(scopes: ["current"])
|
||||
}
|
||||
@@ -25,5 +25,5 @@ extend type Query {
|
||||
dumpPagination(
|
||||
where: _ @whereConditions(columnsEnum: DumpFilterableColumns, handler: "App\\GraphQL\\WhereConditions\\WhereConditionsHandler")
|
||||
sort: [DumpSort!] @sort
|
||||
): [Dump!]! @paginate @scope(name: "public")
|
||||
): [Dump!]! @paginate(scopes: ["public"])
|
||||
}
|
||||
@@ -24,5 +24,5 @@ type FeaturedTheme @model(class: "App\\Models\\Admin\\FeaturedTheme") {
|
||||
|
||||
extend type Query {
|
||||
"Returns the first featured theme where the current date is between start_at and end_at dates."
|
||||
currentfeaturedtheme: FeaturedTheme @scope(name: "current") @first(model: "App\\Models\\Admin\\FeaturedTheme")
|
||||
currentfeaturedtheme: FeaturedTheme @first(model: "App\\Models\\Admin\\FeaturedTheme", scopes: ["current"])
|
||||
}
|
||||
Reference in New Issue
Block a user