Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADVISING-1145]: Add API Capabilities for Subscriptions #365

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ app-modules/**/resources/js/dist/*
/.phpactor.json
**/.DS_Store
public/api-docs/*
/_lighthouse_ide_helper.php
/programmatic-types.graphql
/schema-directives.graphql
23 changes: 15 additions & 8 deletions app-modules/notifications/graphql/subscription.graphql
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
type UserSubscription @model(class: "subscription") {
type UserSubscription
@model(class: "AdvisingApp\\Notifications\\Models\\Subscription") {
"Unique primary key."
id: ID!
"The user related to this subscription."
user: User! @belongsTo
"The subscribable the user is subscribed to."
subscribable: Educatable! @morphTo
"The created date of the subscription."
created_at: DateTime
"The updated date of the subscription."
updated_at: DateTime
}

extend type Query {
"Get a subscription by its primary key."
userSubscription(
"Search by primary key."
id: ID! @whereKey
): UserSubscription @find @canResolved(ability: "view")

"Get all subscriptions."
userSubscriptions: [UserSubscription!]!
@paginate
@canModel(ability: "viewAny")

"Get a subscription by its primary key."
findUserSubscription(
"The primary key of the subscription."
id: ID! @whereKey
): UserSubscription @find @canResolved(ability: "view")
}

extend type Mutation {
Expand All @@ -36,5 +43,5 @@ extend type Mutation {
deleteUserSubscription(
"The primary key of the subscription."
id: ID! @whereKey
): UserSubscription @delete @canFind(ability: "delete")
): UserSubscription @delete @canFind(ability: "delete", find: "id")
}
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"lomkit/laravel-rest-api": "^2.3",
"maatwebsite/excel": "^3.1",
"microsoft/microsoft-graph": "^1.109",
"mll-lab/graphql-php-scalars": "^6.2",
"nuwave/lighthouse": "^6.28",
"owen-it/laravel-auditing": "dev-feature/queued-auditing@dev",
"saade/filament-fullcalendar": "^3.1",
Expand Down Expand Up @@ -204,6 +205,7 @@
"@php artisan lighthouse:print-schema -W -D public"
],
"generate-api-docs": [
"@php artisan lighthouse:ide-helper",
"@prettier-format",
"@print-schema",
"npm run api-docs:generate"
Expand Down
65 changes: 63 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

use Illuminate\Support\Facades\Facade;
use App\Providers\MultiConnectionParallelTestingServiceProvider;
use Nuwave\Lighthouse\WhereConditions\WhereConditionsServiceProvider;

return [
/*
Expand Down Expand Up @@ -233,6 +234,7 @@
App\Providers\HealthServiceProvider::class,
App\Providers\FilamentServiceProvider::class,
MultiConnectionParallelTestingServiceProvider::class,
WhereConditionsServiceProvider::class,
],

/*
Expand Down