From 8e9a34c6b7fe22cc4703fe142cbb204fa54670f5 Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Thu, 11 Jun 2020 14:25:52 +0200 Subject: [PATCH 01/11] Add failing test for variables + subscriptions --- .../Subscriptions/SubscriptionTest.php | 49 +++++++++++++++++-- tests/Utils/Subscriptions/OnPostUpdated.php | 26 ++++++++++ 2 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 tests/Utils/Subscriptions/OnPostUpdated.php diff --git a/tests/Integration/Subscriptions/SubscriptionTest.php b/tests/Integration/Subscriptions/SubscriptionTest.php index ac5e485790..7f37dd9403 100644 --- a/tests/Integration/Subscriptions/SubscriptionTest.php +++ b/tests/Integration/Subscriptions/SubscriptionTest.php @@ -28,14 +28,24 @@ protected function setUp(): void body: String } + enum PostStatus { + PUBLISHED @enum(value: "published") + DELETED @enum(value: "deleted") + } + type Subscription { onPostCreated: Post + onPostUpdated(status: PostStatus!): Post } type Mutation { createPost(post: String!): Post @field(resolver: "{$this->qualifyTestResolver()}") @broadcast(subscription: "onPostCreated") + + updatePost(post: String!): Post + @field(resolver: "{$this->qualifyTestResolver()}") + @broadcast(subscription: "onPostUpdated") } type Query { @@ -46,7 +56,7 @@ protected function setUp(): void public function testSendsSubscriptionChannelInResponse(): void { - $response = $this->subscribe(); + $response = $this->subscribeToOnPostCreatedSubscription(); $subscriber = app(StorageManager::class)->subscribersByTopic('ON_POST_CREATED')->first(); $this->assertInstanceOf(Subscriber::class, $subscriber); @@ -90,7 +100,7 @@ public function testSendsSubscriptionChannelInBatchedResponse(): void public function testCanBroadcastSubscriptions(): void { - $this->subscribe(); + $this->subscribeToOnPostCreatedSubscription(); $this->graphQL(/** @lang GraphQL */ ' mutation { createPost(post: "Foobar") { @@ -131,6 +141,39 @@ public function testThrowsWithMissingOperationName(): void ]); } + public function testSubscriptionWithEnumInputCorrectlyResolves(): void + { + $this->postGraphQL([ + 'query' => /** @lang GraphQL */ ' + subscription OnPostUpdated($status: PostStatus!) { + onPostUpdated(status: $status) { + body + } + } + ', + 'variables' => [ + 'status' => 'DELETED', + ], + 'operationName' => 'OnPostUpdated', + ]); + + $this->graphQL(/** @lang GraphQL */ ' + mutation { + updatePost(post: "Foobar") { + body + } + } + '); + + /** @var \Nuwave\Lighthouse\Subscriptions\Broadcasters\LogBroadcaster $log */ + $log = app(BroadcastManager::class)->driver(); + $this->assertCount(1, $log->broadcasts()); + + $broadcasted = Arr::get(Arr::first($log->broadcasts()), 'data', []); + $this->assertArrayHasKey('onPostUpdated', $broadcasted); + $this->assertSame(['body' => 'Foobar'], $broadcasted['onPostUpdated']); + } + /** * @param mixed[] $args * @return mixed[] @@ -143,7 +186,7 @@ public function resolve($root, array $args): array /** * @return \Illuminate\Testing\TestResponse */ - protected function subscribe() + protected function subscribeToOnPostCreatedSubscription() { return $this->postGraphQL([ 'query' => /** @lang GraphQL */ ' diff --git a/tests/Utils/Subscriptions/OnPostUpdated.php b/tests/Utils/Subscriptions/OnPostUpdated.php new file mode 100644 index 0000000000..a7e19ba8ba --- /dev/null +++ b/tests/Utils/Subscriptions/OnPostUpdated.php @@ -0,0 +1,26 @@ + Date: Sun, 14 Jun 2020 15:34:00 +0200 Subject: [PATCH 02/11] Uncover the bug --- src/Schema/Directives/BroadcastDirective.php | 2 +- src/Subscriptions/Subscriber.php | 1 + src/Subscriptions/SubscriptionBroadcaster.php | 1 + src/Subscriptions/SubscriptionRegistry.php | 4 ++-- src/Subscriptions/SubscriptionResolverProvider.php | 2 ++ 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Schema/Directives/BroadcastDirective.php b/src/Schema/Directives/BroadcastDirective.php index a55a505cfd..a1a29231c5 100644 --- a/src/Schema/Directives/BroadcastDirective.php +++ b/src/Schema/Directives/BroadcastDirective.php @@ -39,7 +39,7 @@ public function handleField(FieldValue $fieldValue, Closure $next): FieldValue $resolver = $fieldValue->getResolver(); return $fieldValue->setResolver(function () use ($resolver) { - $resolved = call_user_func_array($resolver, func_get_args()); + $resolved = $resolver(...func_get_args()); $subscriptionField = $this->directiveArgValue('subscription'); $shouldQueue = $this->directiveArgValue('shouldQueue'); diff --git a/src/Subscriptions/Subscriber.php b/src/Subscriptions/Subscriber.php index 6e6a003205..6843484aa1 100644 --- a/src/Subscriptions/Subscriber.php +++ b/src/Subscriptions/Subscriber.php @@ -113,6 +113,7 @@ public function unserialize($subscription): void unserialize($data['query']) ); $this->operationName = $data['operation_name']; + // TODO ensure we properly unserialize enum's $this->args = $data['args']; $this->context = $this->contextSerializer()->unserialize( $data['context'] diff --git a/src/Subscriptions/SubscriptionBroadcaster.php b/src/Subscriptions/SubscriptionBroadcaster.php index d47dcca84b..21d3bcec5f 100644 --- a/src/Subscriptions/SubscriptionBroadcaster.php +++ b/src/Subscriptions/SubscriptionBroadcaster.php @@ -95,6 +95,7 @@ function (Subscriber $subscriber) use ($root): void { $subscriber->setRoot($root), $subscriber->operationName ); + dump($data); $this->broadcastManager->broadcast( $subscriber, diff --git a/src/Subscriptions/SubscriptionRegistry.php b/src/Subscriptions/SubscriptionRegistry.php index ffdf098d14..d20586d7c3 100644 --- a/src/Subscriptions/SubscriptionRegistry.php +++ b/src/Subscriptions/SubscriptionRegistry.php @@ -35,14 +35,14 @@ class SubscriptionRegistry /** * A map from operation names to channel names. * - * @var string[] + * @var array */ protected $subscribers = []; /** * Active subscription fields of the schema. * - * @var \Nuwave\Lighthouse\Schema\Types\GraphQLSubscription[] + * @var array */ protected $subscriptions = []; diff --git a/src/Subscriptions/SubscriptionResolverProvider.php b/src/Subscriptions/SubscriptionResolverProvider.php index b4cf450636..f135af618a 100644 --- a/src/Subscriptions/SubscriptionResolverProvider.php +++ b/src/Subscriptions/SubscriptionResolverProvider.php @@ -87,6 +87,8 @@ function (string $class): bool { $subscriber, $subscription->encodeTopic($subscriber, $fieldName) ); + + return null; }; } } From 371989a2f4696cbf64a726360b194620ba870f0f Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 14 Jun 2020 13:34:14 +0000 Subject: [PATCH 03/11] Apply fixes from StyleCI --- src/Subscriptions/SubscriptionResolverProvider.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Subscriptions/SubscriptionResolverProvider.php b/src/Subscriptions/SubscriptionResolverProvider.php index f135af618a..b4cf450636 100644 --- a/src/Subscriptions/SubscriptionResolverProvider.php +++ b/src/Subscriptions/SubscriptionResolverProvider.php @@ -87,8 +87,6 @@ function (string $class): bool { $subscriber, $subscription->encodeTopic($subscriber, $fieldName) ); - - return null; }; } } From 64efa2a97c40f53721e6085be09688ce0d077c10 Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Tue, 25 Aug 2020 21:33:47 +0200 Subject: [PATCH 04/11] Partial fix not considering batched requests --- src/Subscriptions/SubscriptionResolverProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Subscriptions/SubscriptionResolverProvider.php b/src/Subscriptions/SubscriptionResolverProvider.php index af8ab34d00..257e49a882 100644 --- a/src/Subscriptions/SubscriptionResolverProvider.php +++ b/src/Subscriptions/SubscriptionResolverProvider.php @@ -73,7 +73,7 @@ function (string $class): bool { } $subscriber = new Subscriber( - $args, + $context->request()->get('variables'), // @TODO: This must be changed to correctly consider batched requests $context, $resolveInfo ); From 1dc6c9b9c71f761f71418c1881c87a87098a66ea Mon Sep 17 00:00:00 2001 From: Alex Bouma Date: Tue, 25 Aug 2020 21:34:01 +0200 Subject: [PATCH 05/11] Add test case for batched requests --- .../Subscriptions/SubscriptionTest.php | 51 +++++++++++++++++-- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/tests/Integration/Subscriptions/SubscriptionTest.php b/tests/Integration/Subscriptions/SubscriptionTest.php index dd94edd5d4..176c841492 100644 --- a/tests/Integration/Subscriptions/SubscriptionTest.php +++ b/tests/Integration/Subscriptions/SubscriptionTest.php @@ -165,11 +165,54 @@ public function testSubscriptionWithEnumInputCorrectlyResolves(): void ]); $this->graphQL(/** @lang GraphQL */ ' - mutation { - updatePost(post: "Foobar") { - body + mutation { + updatePost(post: "Foobar") { + body + } + } + '); + + /** @var \Nuwave\Lighthouse\Subscriptions\Broadcasters\LogBroadcaster $log */ + $log = app(BroadcastManager::class)->driver(); + $this->assertCount(1, $log->broadcasts()); + + $broadcasted = Arr::get(Arr::first($log->broadcasts()), 'data', []); + $this->assertArrayHasKey('onPostUpdated', $broadcasted); + $this->assertSame(['body' => 'Foobar'], $broadcasted['onPostUpdated']); + } + + public function testSubscriptionWithEnumInputCorrectlyResolvesUsingBatchedQuery(): void + { + $this + ->postGraphQL([ + [ + 'query' => /** @lang GraphQL */ ' + { + bar + } + ', + ], + [ + 'query' => /** @lang GraphQL */ ' + subscription OnPostUpdated($status: PostStatus!) { + onPostUpdated(status: $status) { + body + } + } + ', + 'variables' => [ + 'status' => 'DELETED', + ], + 'operationName' => 'OnPostUpdated', + ], + ]); + + $this->graphQL(/** @lang GraphQL */ ' + mutation { + updatePost(post: "Foobar") { + body + } } - } '); /** @var \Nuwave\Lighthouse\Subscriptions\Broadcasters\LogBroadcaster $log */ From 7491d2fa4c324909a5ae4cc39eec0bb1252df18d Mon Sep 17 00:00:00 2001 From: stayallive Date: Tue, 25 Aug 2020 19:35:17 +0000 Subject: [PATCH 06/11] Prettify docs --- docs/2.6/api-reference/directives.md | 30 +++++------ docs/3.0/api-reference/directives.md | 50 +++++++++--------- docs/3.0/api-reference/scalars.md | 6 +-- docs/3.0/extensions/subscriptions.md | 2 +- docs/3.0/guides/file-uploads.md | 2 +- docs/3.1/api-reference/directives.md | 50 +++++++++--------- docs/3.1/api-reference/scalars.md | 6 +-- docs/3.1/extensions/subscriptions.md | 2 +- docs/3.1/guides/file-uploads.md | 2 +- docs/3.2/api-reference/directives.md | 50 +++++++++--------- docs/3.2/api-reference/scalars.md | 6 +-- docs/3.2/extensions/subscriptions.md | 2 +- docs/3.2/guides/file-uploads.md | 2 +- docs/3.3/api-reference/directives.md | 50 +++++++++--------- docs/3.3/api-reference/scalars.md | 6 +-- docs/3.3/extensions/subscriptions.md | 2 +- docs/3.3/guides/custom-directives.md | 2 +- docs/3.3/guides/file-uploads.md | 2 +- docs/3.4/api-reference/directives.md | 50 +++++++++--------- docs/3.4/api-reference/scalars.md | 6 +-- docs/3.4/extensions/subscriptions.md | 2 +- docs/3.4/guides/custom-directives.md | 2 +- docs/3.4/guides/file-uploads.md | 2 +- docs/3.5/api-reference/directives.md | 50 +++++++++--------- docs/3.5/api-reference/scalars.md | 6 +-- docs/3.5/extensions/subscriptions.md | 2 +- docs/3.5/guides/custom-directives.md | 2 +- docs/3.5/guides/file-uploads.md | 2 +- docs/3.6/api-reference/directives.md | 50 +++++++++--------- docs/3.6/api-reference/scalars.md | 6 +-- docs/3.6/extensions/subscriptions.md | 2 +- docs/3.6/guides/custom-directives.md | 2 +- docs/3.6/guides/file-uploads.md | 2 +- docs/3.7/api-reference/directives.md | 40 +++++++------- docs/3.7/api-reference/scalars.md | 6 +-- .../custom-directives/argument-directives.md | 2 +- docs/3.7/digging-deeper/file-uploads.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/3.7/the-basics/directives.md | 8 +-- docs/4.0/api-reference/directives.md | 44 ++++++++-------- docs/4.0/api-reference/scalars.md | 6 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.0/digging-deeper/file-uploads.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.0/the-basics/directives.md | 8 +-- docs/4.1/api-reference/directives.md | 46 ++++++++-------- docs/4.1/api-reference/scalars.md | 6 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.1/digging-deeper/file-uploads.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.1/the-basics/directives.md | 8 +-- docs/4.10/api-reference/directives.md | 50 +++++++++--------- docs/4.10/api-reference/scalars.md | 6 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.10/digging-deeper/file-uploads.md | 2 +- .../4.10/eloquent/complex-where-conditions.md | 2 +- docs/4.10/security/authorization.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.10/the-basics/directives.md | 8 +-- docs/4.11/api-reference/directives.md | 50 +++++++++--------- docs/4.11/api-reference/scalars.md | 6 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.11/digging-deeper/file-uploads.md | 2 +- .../4.11/eloquent/complex-where-conditions.md | 2 +- docs/4.11/security/authorization.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.11/the-basics/directives.md | 8 +-- docs/4.12/api-reference/directives.md | 50 +++++++++--------- docs/4.12/api-reference/scalars.md | 8 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.12/digging-deeper/file-uploads.md | 2 +- .../4.12/eloquent/complex-where-conditions.md | 2 +- docs/4.12/security/authorization.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.12/the-basics/directives.md | 8 +-- docs/4.13/api-reference/directives.md | 52 +++++++++---------- docs/4.13/api-reference/scalars.md | 8 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.13/digging-deeper/file-uploads.md | 2 +- .../4.13/eloquent/complex-where-conditions.md | 2 +- docs/4.13/security/authorization.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.13/the-basics/directives.md | 8 +-- docs/4.14/api-reference/directives.md | 52 +++++++++---------- docs/4.14/api-reference/scalars.md | 8 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.14/digging-deeper/file-uploads.md | 2 +- .../4.14/eloquent/complex-where-conditions.md | 2 +- docs/4.14/security/authorization.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.14/the-basics/directives.md | 8 +-- docs/4.15/api-reference/directives.md | 52 +++++++++---------- docs/4.15/api-reference/scalars.md | 8 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.15/digging-deeper/file-uploads.md | 2 +- .../4.15/eloquent/complex-where-conditions.md | 2 +- docs/4.15/security/authorization.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.15/the-basics/directives.md | 8 +-- docs/4.16/api-reference/directives.md | 52 +++++++++---------- docs/4.16/api-reference/scalars.md | 10 ++-- .../custom-directives/argument-directives.md | 2 +- docs/4.16/digging-deeper/file-uploads.md | 2 +- .../4.16/eloquent/complex-where-conditions.md | 2 +- docs/4.16/security/authorization.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.16/the-basics/directives.md | 8 +-- docs/4.2/api-reference/directives.md | 46 ++++++++-------- docs/4.2/api-reference/scalars.md | 6 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.2/digging-deeper/file-uploads.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.2/the-basics/directives.md | 8 +-- docs/4.3/api-reference/directives.md | 46 ++++++++-------- docs/4.3/api-reference/scalars.md | 6 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.3/digging-deeper/file-uploads.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.3/the-basics/directives.md | 8 +-- docs/4.4/api-reference/directives.md | 46 ++++++++-------- docs/4.4/api-reference/scalars.md | 6 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.4/digging-deeper/file-uploads.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.4/the-basics/directives.md | 8 +-- docs/4.5/api-reference/directives.md | 46 ++++++++-------- docs/4.5/api-reference/scalars.md | 6 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.5/digging-deeper/file-uploads.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.5/the-basics/directives.md | 8 +-- docs/4.6/api-reference/directives.md | 46 ++++++++-------- docs/4.6/api-reference/scalars.md | 6 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.6/digging-deeper/file-uploads.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.6/the-basics/directives.md | 8 +-- docs/4.7/api-reference/directives.md | 46 ++++++++-------- docs/4.7/api-reference/scalars.md | 6 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.7/digging-deeper/file-uploads.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.7/the-basics/directives.md | 8 +-- docs/4.8/api-reference/directives.md | 48 ++++++++--------- docs/4.8/api-reference/scalars.md | 6 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.8/digging-deeper/file-uploads.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.8/the-basics/directives.md | 8 +-- docs/4.9/api-reference/directives.md | 48 ++++++++--------- docs/4.9/api-reference/scalars.md | 6 +-- .../custom-directives/argument-directives.md | 2 +- docs/4.9/digging-deeper/file-uploads.md | 2 +- docs/4.9/eloquent/complex-where-conditions.md | 2 +- docs/4.9/security/authorization.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/4.9/the-basics/directives.md | 8 +-- docs/master/api-reference/directives.md | 42 +++++++-------- docs/master/api-reference/scalars.md | 10 ++-- .../custom-directives/argument-directives.md | 2 +- docs/master/digging-deeper/file-uploads.md | 2 +- .../eloquent/complex-where-conditions.md | 2 +- docs/master/security/authorization.md | 2 +- .../subscriptions/trigger-subscriptions.md | 2 +- docs/master/the-basics/directives.md | 8 +-- 165 files changed, 896 insertions(+), 896 deletions(-) diff --git a/docs/2.6/api-reference/directives.md b/docs/2.6/api-reference/directives.md index c10c386cae..75fbbb529f 100644 --- a/docs/2.6/api-reference/directives.md +++ b/docs/2.6/api-reference/directives.md @@ -218,7 +218,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -292,7 +292,7 @@ Pass a class and a method to the `resolver` argument and separate them with an ` ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\Http\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\Http\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -312,7 +312,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\Http\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\Http\\GraphQL\\Types\\UserType@created_at") } ``` @@ -380,7 +380,7 @@ Fire an event after a mutation has taken place. It requires the `fire` argument ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(fire: "App\\Events\\PostCreated") + @event(fire: "App\\Events\\PostCreated") } ``` @@ -484,8 +484,8 @@ Inject a value from the context object into the arguments. This is really useful ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create(model: "App\\Post") - @inject(context: "user.id", name: "user_id") + @create(model: "App\\Post") + @inject(context: "user.id", name: "user_id") } ``` @@ -499,7 +499,7 @@ Set the `resolver` argument to a function that returns the implementing Object T ```graphql interface Commentable - @interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -575,9 +575,9 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) } ``` @@ -655,10 +655,10 @@ it if the need arises. ```graphql type User - @node( - resolver: "App\\GraphQL\\NodeResolver@resolveUser" - typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" - ) { +@node( + resolver: "App\\GraphQL\\NodeResolver@resolveUser" + typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" +) { name: String! } ``` @@ -791,7 +791,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @search diff --git a/docs/3.0/api-reference/directives.md b/docs/3.0/api-reference/directives.md index c82b3f3e94..e8e51dbadd 100644 --- a/docs/3.0/api-reference/directives.md +++ b/docs/3.0/api-reference/directives.md @@ -138,7 +138,7 @@ The `subscription` argument must reference the name of a subscription field. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -148,7 +148,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -240,7 +240,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -249,7 +249,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -271,7 +271,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -389,7 +389,7 @@ Pass a class and a method to the `resolver` argument and separate them with an ` ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -409,7 +409,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -451,7 +451,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -498,7 +498,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(fire: "App\\Events\\PostCreated") + @event(fire: "App\\Events\\PostCreated") } ``` @@ -601,8 +601,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -615,8 +615,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -630,7 +630,7 @@ Set the `resolver` argument to a function that returns the implementing Object T ```graphql interface Commentable - @interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -710,10 +710,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -790,10 +790,10 @@ it if the need arises. ```graphql type User - @node( - resolver: "App\\GraphQL\\NodeResolver@resolveUser" - typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" - ) { +@node( + resolver: "App\\GraphQL\\NodeResolver@resolveUser" + typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" +) { name: String! } ``` @@ -984,7 +984,7 @@ Validate an argument using [Laravel's built-in validation rules](https://laravel ```graphql type Query { users(countryCode: String @rules(apply: ["string", "size:2"])): [User!]! - @paginate + @paginate } ``` @@ -1049,7 +1049,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @search @@ -1086,7 +1086,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` diff --git a/docs/3.0/api-reference/scalars.md b/docs/3.0/api-reference/scalars.md index 322fe8b2e4..102e831fd3 100644 --- a/docs/3.0/api-reference/scalars.md +++ b/docs/3.0/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/3.0/extensions/subscriptions.md b/docs/3.0/extensions/subscriptions.md index 165548943a..f6d7c4e652 100644 --- a/docs/3.0/extensions/subscriptions.md +++ b/docs/3.0/extensions/subscriptions.md @@ -159,7 +159,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/3.0/guides/file-uploads.md b/docs/3.0/guides/file-uploads.md index 0d95ef59ff..9a022df0c8 100644 --- a/docs/3.0/guides/file-uploads.md +++ b/docs/3.0/guides/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/3.1/api-reference/directives.md b/docs/3.1/api-reference/directives.md index c739434631..081e8efd9f 100644 --- a/docs/3.1/api-reference/directives.md +++ b/docs/3.1/api-reference/directives.md @@ -138,7 +138,7 @@ The `subscription` argument must reference the name of a subscription field. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -148,7 +148,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -240,7 +240,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -249,7 +249,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -271,7 +271,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -389,7 +389,7 @@ Pass a class and a method to the `resolver` argument and separate them with an ` ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -409,7 +409,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -451,7 +451,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -498,7 +498,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -601,8 +601,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -615,8 +615,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -630,7 +630,7 @@ Set the `resolver` argument to a function that returns the implementing Object T ```graphql interface Commentable - @interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -710,10 +710,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -790,10 +790,10 @@ it if the need arises. ```graphql type User - @node( - resolver: "App\\GraphQL\\NodeResolver@resolveUser" - typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" - ) { +@node( + resolver: "App\\GraphQL\\NodeResolver@resolveUser" + typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" +) { name: String! } ``` @@ -984,7 +984,7 @@ Validate an argument using [Laravel's built-in validation rules](https://laravel ```graphql type Query { users(countryCode: String @rules(apply: ["string", "size:2"])): [User!]! - @paginate + @paginate } ``` @@ -1049,7 +1049,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @search @@ -1086,7 +1086,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` diff --git a/docs/3.1/api-reference/scalars.md b/docs/3.1/api-reference/scalars.md index 322fe8b2e4..102e831fd3 100644 --- a/docs/3.1/api-reference/scalars.md +++ b/docs/3.1/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/3.1/extensions/subscriptions.md b/docs/3.1/extensions/subscriptions.md index 165548943a..f6d7c4e652 100644 --- a/docs/3.1/extensions/subscriptions.md +++ b/docs/3.1/extensions/subscriptions.md @@ -159,7 +159,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/3.1/guides/file-uploads.md b/docs/3.1/guides/file-uploads.md index 0d95ef59ff..9a022df0c8 100644 --- a/docs/3.1/guides/file-uploads.md +++ b/docs/3.1/guides/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/3.2/api-reference/directives.md b/docs/3.2/api-reference/directives.md index c739434631..081e8efd9f 100644 --- a/docs/3.2/api-reference/directives.md +++ b/docs/3.2/api-reference/directives.md @@ -138,7 +138,7 @@ The `subscription` argument must reference the name of a subscription field. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -148,7 +148,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -240,7 +240,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -249,7 +249,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -271,7 +271,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -389,7 +389,7 @@ Pass a class and a method to the `resolver` argument and separate them with an ` ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -409,7 +409,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -451,7 +451,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -498,7 +498,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -601,8 +601,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -615,8 +615,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -630,7 +630,7 @@ Set the `resolver` argument to a function that returns the implementing Object T ```graphql interface Commentable - @interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -710,10 +710,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -790,10 +790,10 @@ it if the need arises. ```graphql type User - @node( - resolver: "App\\GraphQL\\NodeResolver@resolveUser" - typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" - ) { +@node( + resolver: "App\\GraphQL\\NodeResolver@resolveUser" + typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" +) { name: String! } ``` @@ -984,7 +984,7 @@ Validate an argument using [Laravel's built-in validation rules](https://laravel ```graphql type Query { users(countryCode: String @rules(apply: ["string", "size:2"])): [User!]! - @paginate + @paginate } ``` @@ -1049,7 +1049,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @search @@ -1086,7 +1086,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` diff --git a/docs/3.2/api-reference/scalars.md b/docs/3.2/api-reference/scalars.md index 322fe8b2e4..102e831fd3 100644 --- a/docs/3.2/api-reference/scalars.md +++ b/docs/3.2/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/3.2/extensions/subscriptions.md b/docs/3.2/extensions/subscriptions.md index 165548943a..f6d7c4e652 100644 --- a/docs/3.2/extensions/subscriptions.md +++ b/docs/3.2/extensions/subscriptions.md @@ -159,7 +159,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/3.2/guides/file-uploads.md b/docs/3.2/guides/file-uploads.md index 0d95ef59ff..9a022df0c8 100644 --- a/docs/3.2/guides/file-uploads.md +++ b/docs/3.2/guides/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/3.3/api-reference/directives.md b/docs/3.3/api-reference/directives.md index be4abb80cb..bbc0589f65 100644 --- a/docs/3.3/api-reference/directives.md +++ b/docs/3.3/api-reference/directives.md @@ -138,7 +138,7 @@ The `subscription` argument must reference the name of a subscription field. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -148,7 +148,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -274,7 +274,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -283,7 +283,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -305,7 +305,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -425,7 +425,7 @@ Pass a class and a method to the `resolver` argument and separate them with an ` ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -445,7 +445,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -487,7 +487,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -534,7 +534,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -637,8 +637,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -651,8 +651,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -666,7 +666,7 @@ Set the `resolver` argument to a function that returns the implementing Object T ```graphql interface Commentable - @interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -746,10 +746,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -826,10 +826,10 @@ it if the need arises. ```graphql type User - @node( - resolver: "App\\GraphQL\\NodeResolver@resolveUser" - typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" - ) { +@node( + resolver: "App\\GraphQL\\NodeResolver@resolveUser" + typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" +) { name: String! } ``` @@ -1020,7 +1020,7 @@ Validate an argument using [Laravel's built-in validation rules](https://laravel ```graphql type Query { users(countryCode: String @rules(apply: ["string", "size:2"])): [User!]! - @paginate + @paginate } ``` @@ -1085,7 +1085,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @search @@ -1160,7 +1160,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` diff --git a/docs/3.3/api-reference/scalars.md b/docs/3.3/api-reference/scalars.md index 322fe8b2e4..102e831fd3 100644 --- a/docs/3.3/api-reference/scalars.md +++ b/docs/3.3/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/3.3/extensions/subscriptions.md b/docs/3.3/extensions/subscriptions.md index 165548943a..f6d7c4e652 100644 --- a/docs/3.3/extensions/subscriptions.md +++ b/docs/3.3/extensions/subscriptions.md @@ -159,7 +159,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/3.3/guides/custom-directives.md b/docs/3.3/guides/custom-directives.md index 32388224d2..e69733ca40 100644 --- a/docs/3.3/guides/custom-directives.md +++ b/docs/3.3/guides/custom-directives.md @@ -185,7 +185,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: [Date!]! @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } ``` diff --git a/docs/3.3/guides/file-uploads.md b/docs/3.3/guides/file-uploads.md index 0d95ef59ff..9a022df0c8 100644 --- a/docs/3.3/guides/file-uploads.md +++ b/docs/3.3/guides/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/3.4/api-reference/directives.md b/docs/3.4/api-reference/directives.md index d673c9df00..0113ec38b2 100644 --- a/docs/3.4/api-reference/directives.md +++ b/docs/3.4/api-reference/directives.md @@ -138,7 +138,7 @@ The `subscription` argument must reference the name of a subscription field. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -148,7 +148,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -274,7 +274,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -283,7 +283,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -305,7 +305,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -425,7 +425,7 @@ Pass a class and a method to the `resolver` argument and separate them with an ` ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -445,7 +445,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -487,7 +487,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -534,7 +534,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -640,8 +640,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -654,8 +654,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -669,7 +669,7 @@ Set the `resolver` argument to a function that returns the implementing Object T ```graphql interface Commentable - @interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -749,10 +749,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -832,10 +832,10 @@ it if the need arises. ```graphql type User - @node( - resolver: "App\\GraphQL\\NodeResolver@resolveUser" - typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" - ) { +@node( + resolver: "App\\GraphQL\\NodeResolver@resolveUser" + typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" +) { name: String! } ``` @@ -1026,7 +1026,7 @@ Validate an argument using [Laravel's built-in validation rules](https://laravel ```graphql type Query { users(countryCode: String @rules(apply: ["string", "size:2"])): [User!]! - @paginate + @paginate } ``` @@ -1091,7 +1091,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @search @@ -1166,7 +1166,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` diff --git a/docs/3.4/api-reference/scalars.md b/docs/3.4/api-reference/scalars.md index 322fe8b2e4..102e831fd3 100644 --- a/docs/3.4/api-reference/scalars.md +++ b/docs/3.4/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/3.4/extensions/subscriptions.md b/docs/3.4/extensions/subscriptions.md index 165548943a..f6d7c4e652 100644 --- a/docs/3.4/extensions/subscriptions.md +++ b/docs/3.4/extensions/subscriptions.md @@ -159,7 +159,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/3.4/guides/custom-directives.md b/docs/3.4/guides/custom-directives.md index 32388224d2..e69733ca40 100644 --- a/docs/3.4/guides/custom-directives.md +++ b/docs/3.4/guides/custom-directives.md @@ -185,7 +185,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: [Date!]! @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } ``` diff --git a/docs/3.4/guides/file-uploads.md b/docs/3.4/guides/file-uploads.md index 0d95ef59ff..9a022df0c8 100644 --- a/docs/3.4/guides/file-uploads.md +++ b/docs/3.4/guides/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/3.5/api-reference/directives.md b/docs/3.5/api-reference/directives.md index e9f0e46ada..3c8744f9b3 100644 --- a/docs/3.5/api-reference/directives.md +++ b/docs/3.5/api-reference/directives.md @@ -138,7 +138,7 @@ The `subscription` argument must reference the name of a subscription field. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -148,7 +148,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -274,7 +274,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -283,7 +283,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -305,7 +305,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -425,7 +425,7 @@ Pass a class and a method to the `resolver` argument and separate them with an ` ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -445,7 +445,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -487,7 +487,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -534,7 +534,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -640,8 +640,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -654,8 +654,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -669,7 +669,7 @@ Set the `resolver` argument to a function that returns the implementing Object T ```graphql interface Commentable - @interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -749,10 +749,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -832,10 +832,10 @@ it if the need arises. ```graphql type User - @node( - resolver: "App\\GraphQL\\NodeResolver@resolveUser" - typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" - ) { +@node( + resolver: "App\\GraphQL\\NodeResolver@resolveUser" + typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" +) { name: String! } ``` @@ -1026,7 +1026,7 @@ Validate an argument using [Laravel's built-in validation rules](https://laravel ```graphql type Query { users(countryCode: String @rules(apply: ["string", "size:2"])): [User!]! - @paginate + @paginate } ``` @@ -1091,7 +1091,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @search @@ -1166,7 +1166,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` diff --git a/docs/3.5/api-reference/scalars.md b/docs/3.5/api-reference/scalars.md index 322fe8b2e4..102e831fd3 100644 --- a/docs/3.5/api-reference/scalars.md +++ b/docs/3.5/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/3.5/extensions/subscriptions.md b/docs/3.5/extensions/subscriptions.md index 165548943a..f6d7c4e652 100644 --- a/docs/3.5/extensions/subscriptions.md +++ b/docs/3.5/extensions/subscriptions.md @@ -159,7 +159,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/3.5/guides/custom-directives.md b/docs/3.5/guides/custom-directives.md index b5dc671146..4eae3b2c1f 100644 --- a/docs/3.5/guides/custom-directives.md +++ b/docs/3.5/guides/custom-directives.md @@ -254,7 +254,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: [Date!]! @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } ``` diff --git a/docs/3.5/guides/file-uploads.md b/docs/3.5/guides/file-uploads.md index 0d95ef59ff..9a022df0c8 100644 --- a/docs/3.5/guides/file-uploads.md +++ b/docs/3.5/guides/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/3.6/api-reference/directives.md b/docs/3.6/api-reference/directives.md index fd1715d091..43b06b107a 100644 --- a/docs/3.6/api-reference/directives.md +++ b/docs/3.6/api-reference/directives.md @@ -138,7 +138,7 @@ The `subscription` argument must reference the name of a subscription field. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -148,7 +148,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -274,7 +274,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -283,7 +283,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -305,7 +305,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -425,7 +425,7 @@ Pass a class and a method to the `resolver` argument and separate them with an ` ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -445,7 +445,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -487,7 +487,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -534,7 +534,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -640,8 +640,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -654,8 +654,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -669,7 +669,7 @@ Set the `resolver` argument to a function that returns the implementing Object T ```graphql interface Commentable - @interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -749,10 +749,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -832,10 +832,10 @@ it if the need arises. ```graphql type User - @node( - resolver: "App\\GraphQL\\NodeResolver@resolveUser" - typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" - ) { +@node( + resolver: "App\\GraphQL\\NodeResolver@resolveUser" + typeResolver: "App\\GraphQL\\NodeResolver@resolveNodeType" +) { name: String! } ``` @@ -1026,7 +1026,7 @@ Validate an argument using [Laravel's built-in validation rules](https://laravel ```graphql type Query { users(countryCode: String @rules(apply: ["string", "size:2"])): [User!]! - @paginate + @paginate } ``` @@ -1091,7 +1091,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @search @@ -1166,7 +1166,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` diff --git a/docs/3.6/api-reference/scalars.md b/docs/3.6/api-reference/scalars.md index 322fe8b2e4..102e831fd3 100644 --- a/docs/3.6/api-reference/scalars.md +++ b/docs/3.6/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/3.6/extensions/subscriptions.md b/docs/3.6/extensions/subscriptions.md index 165548943a..f6d7c4e652 100644 --- a/docs/3.6/extensions/subscriptions.md +++ b/docs/3.6/extensions/subscriptions.md @@ -159,7 +159,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/3.6/guides/custom-directives.md b/docs/3.6/guides/custom-directives.md index ace0c7226e..f95df8f5c3 100644 --- a/docs/3.6/guides/custom-directives.md +++ b/docs/3.6/guides/custom-directives.md @@ -255,7 +255,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: [Date!]! @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } ``` diff --git a/docs/3.6/guides/file-uploads.md b/docs/3.6/guides/file-uploads.md index 0d95ef59ff..9a022df0c8 100644 --- a/docs/3.6/guides/file-uploads.md +++ b/docs/3.6/guides/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/3.7/api-reference/directives.md b/docs/3.7/api-reference/directives.md index 3344a031f3..9deae089e3 100644 --- a/docs/3.7/api-reference/directives.md +++ b/docs/3.7/api-reference/directives.md @@ -226,7 +226,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -257,7 +257,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -441,7 +441,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -450,7 +450,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -491,7 +491,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -659,7 +659,7 @@ Pass a class and a method to the `resolver` argument and separate them with an ` ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -701,7 +701,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -781,7 +781,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -854,7 +854,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1081,8 +1081,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1117,8 +1117,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1133,7 +1133,7 @@ Set the `resolver` argument to a function that returns the implementing Object T ```graphql interface Commentable - @interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1268,10 +1268,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1794,7 +1794,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @search @@ -1893,7 +1893,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` diff --git a/docs/3.7/api-reference/scalars.md b/docs/3.7/api-reference/scalars.md index e090da931c..4c931fc583 100644 --- a/docs/3.7/api-reference/scalars.md +++ b/docs/3.7/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/3.7/custom-directives/argument-directives.md b/docs/3.7/custom-directives/argument-directives.md index 95594f4f76..d9ae83e27d 100644 --- a/docs/3.7/custom-directives/argument-directives.md +++ b/docs/3.7/custom-directives/argument-directives.md @@ -182,7 +182,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: [Date!]! @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } ``` diff --git a/docs/3.7/digging-deeper/file-uploads.md b/docs/3.7/digging-deeper/file-uploads.md index 3f2d9e82ad..5ec0ca962d 100644 --- a/docs/3.7/digging-deeper/file-uploads.md +++ b/docs/3.7/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/3.7/subscriptions/trigger-subscriptions.md b/docs/3.7/subscriptions/trigger-subscriptions.md index 0b20951ef4..164c26ffe4 100644 --- a/docs/3.7/subscriptions/trigger-subscriptions.md +++ b/docs/3.7/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/3.7/the-basics/directives.md b/docs/3.7/the-basics/directives.md index 2a281890ee..415b334195 100644 --- a/docs/3.7/the-basics/directives.md +++ b/docs/3.7/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Reuse existing Laravel authentication middleware - @middleware(checks: ["auth:api"]) + # Resolve as a paginated list + @paginate + # Reuse existing Laravel authentication middleware + @middleware(checks: ["auth:api"]) } ``` diff --git a/docs/4.0/api-reference/directives.md b/docs/4.0/api-reference/directives.md index 540d731eee..71fad16231 100644 --- a/docs/4.0/api-reference/directives.md +++ b/docs/4.0/api-reference/directives.md @@ -255,7 +255,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -286,7 +286,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -486,7 +486,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -495,7 +495,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -536,7 +536,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -698,7 +698,7 @@ Pass a class and a method to the `resolver` argument and separate them with an ` ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -740,7 +740,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -820,7 +820,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -893,7 +893,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1109,8 +1109,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1145,8 +1145,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1161,7 +1161,7 @@ Set the `resolver` argument to a function that returns the implementing Object T ```graphql interface Commentable - @interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolver: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1296,10 +1296,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1363,8 +1363,8 @@ to the `@field` directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -1827,7 +1827,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @search @@ -1961,7 +1961,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` diff --git a/docs/4.0/api-reference/scalars.md b/docs/4.0/api-reference/scalars.md index e090da931c..4c931fc583 100644 --- a/docs/4.0/api-reference/scalars.md +++ b/docs/4.0/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.0/custom-directives/argument-directives.md b/docs/4.0/custom-directives/argument-directives.md index c3718b6a00..b5c218bc3c 100644 --- a/docs/4.0/custom-directives/argument-directives.md +++ b/docs/4.0/custom-directives/argument-directives.md @@ -178,7 +178,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.0/digging-deeper/file-uploads.md b/docs/4.0/digging-deeper/file-uploads.md index 3f2d9e82ad..5ec0ca962d 100644 --- a/docs/4.0/digging-deeper/file-uploads.md +++ b/docs/4.0/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.0/subscriptions/trigger-subscriptions.md b/docs/4.0/subscriptions/trigger-subscriptions.md index 0b20951ef4..164c26ffe4 100644 --- a/docs/4.0/subscriptions/trigger-subscriptions.md +++ b/docs/4.0/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.0/the-basics/directives.md b/docs/4.0/the-basics/directives.md index 2a281890ee..415b334195 100644 --- a/docs/4.0/the-basics/directives.md +++ b/docs/4.0/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Reuse existing Laravel authentication middleware - @middleware(checks: ["auth:api"]) + # Resolve as a paginated list + @paginate + # Reuse existing Laravel authentication middleware + @middleware(checks: ["auth:api"]) } ``` diff --git a/docs/4.1/api-reference/directives.md b/docs/4.1/api-reference/directives.md index 8ffc31dea4..1851063e7b 100644 --- a/docs/4.1/api-reference/directives.md +++ b/docs/4.1/api-reference/directives.md @@ -255,7 +255,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -289,7 +289,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -490,7 +490,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -499,7 +499,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -541,7 +541,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -704,7 +704,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -747,7 +747,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -827,7 +827,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -900,7 +900,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1119,8 +1119,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1155,8 +1155,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1171,7 +1171,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1307,10 +1307,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1374,8 +1374,8 @@ to the `@field` directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -1842,7 +1842,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @search @@ -1976,7 +1976,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` @@ -2296,7 +2296,7 @@ enum Operator { type Query { people( where: WhereConstraints - @whereConstraints(columns: ["age", "type", "haircolour", "height"]) + @whereConstraints(columns: ["age", "type", "haircolour", "height"]) ): [Person!]! } ``` diff --git a/docs/4.1/api-reference/scalars.md b/docs/4.1/api-reference/scalars.md index e090da931c..4c931fc583 100644 --- a/docs/4.1/api-reference/scalars.md +++ b/docs/4.1/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.1/custom-directives/argument-directives.md b/docs/4.1/custom-directives/argument-directives.md index 3109924f00..c990e7dce4 100644 --- a/docs/4.1/custom-directives/argument-directives.md +++ b/docs/4.1/custom-directives/argument-directives.md @@ -178,7 +178,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.1/digging-deeper/file-uploads.md b/docs/4.1/digging-deeper/file-uploads.md index 779d0faf82..63734c70f2 100644 --- a/docs/4.1/digging-deeper/file-uploads.md +++ b/docs/4.1/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.1/subscriptions/trigger-subscriptions.md b/docs/4.1/subscriptions/trigger-subscriptions.md index 0b20951ef4..164c26ffe4 100644 --- a/docs/4.1/subscriptions/trigger-subscriptions.md +++ b/docs/4.1/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.1/the-basics/directives.md b/docs/4.1/the-basics/directives.md index 2a281890ee..415b334195 100644 --- a/docs/4.1/the-basics/directives.md +++ b/docs/4.1/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Reuse existing Laravel authentication middleware - @middleware(checks: ["auth:api"]) + # Resolve as a paginated list + @paginate + # Reuse existing Laravel authentication middleware + @middleware(checks: ["auth:api"]) } ``` diff --git a/docs/4.10/api-reference/directives.md b/docs/4.10/api-reference/directives.md index 7ff855f847..6881e6fc81 100644 --- a/docs/4.10/api-reference/directives.md +++ b/docs/4.10/api-reference/directives.md @@ -261,7 +261,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -295,7 +295,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -478,7 +478,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -519,7 +519,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -703,7 +703,7 @@ This directive can also be used as a [nested arg resolver](../concepts/arg-resol ```graphql type Mutation { updateUser(id: Int, deleteTasks: [Int!]! @delete(relation: "tasks")): User - @update + @update } ``` @@ -714,7 +714,7 @@ possible model that can be deleted. ```graphql type Mutation { updateTask(id: Int, deleteUser: Boolean @delete(relation: "user")): Task - @update + @update } ``` @@ -757,7 +757,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -800,7 +800,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -886,7 +886,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -991,7 +991,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1263,8 +1263,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1299,8 +1299,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1315,7 +1315,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1441,7 +1441,7 @@ If you want to pass down only the arguments in sequence, use the `passOrdered` o ```graphql type User { purchasedItemsCount(year: Int!, includeReturns: Boolean): Int - @method(passOrdered: true) + @method(passOrdered: true) } ``` @@ -1495,10 +1495,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1711,8 +1711,8 @@ to the `@field` directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -1956,7 +1956,7 @@ Here's an example of how you could define it in your schema: type Query { allPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! @all paginatedPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! - @paginate + @paginate } "A custom description for this custom enum." @@ -2380,7 +2380,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @scope @@ -2576,7 +2576,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` diff --git a/docs/4.10/api-reference/scalars.md b/docs/4.10/api-reference/scalars.md index e090da931c..4c931fc583 100644 --- a/docs/4.10/api-reference/scalars.md +++ b/docs/4.10/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.10/custom-directives/argument-directives.md b/docs/4.10/custom-directives/argument-directives.md index 75dee9bf4a..1d67b68d33 100644 --- a/docs/4.10/custom-directives/argument-directives.md +++ b/docs/4.10/custom-directives/argument-directives.md @@ -183,7 +183,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.10/digging-deeper/file-uploads.md b/docs/4.10/digging-deeper/file-uploads.md index 779d0faf82..63734c70f2 100644 --- a/docs/4.10/digging-deeper/file-uploads.md +++ b/docs/4.10/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.10/eloquent/complex-where-conditions.md b/docs/4.10/eloquent/complex-where-conditions.md index fa9ec88242..05635dedd9 100644 --- a/docs/4.10/eloquent/complex-where-conditions.md +++ b/docs/4.10/eloquent/complex-where-conditions.md @@ -106,7 +106,7 @@ want to re-use a list of allowed columns. Here's how your schema could look like ```graphql type Query { allPeople(where: _ @whereConditions(columnsEnum: "PersonColumn")): [Person!]! - @all + @all paginatedPeople( where: _ @whereConditions(columnsEnum: "PersonColumn") diff --git a/docs/4.10/security/authorization.md b/docs/4.10/security/authorization.md index f4509638b7..6813f4dd83 100644 --- a/docs/4.10/security/authorization.md +++ b/docs/4.10/security/authorization.md @@ -117,7 +117,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` diff --git a/docs/4.10/subscriptions/trigger-subscriptions.md b/docs/4.10/subscriptions/trigger-subscriptions.md index 0b20951ef4..164c26ffe4 100644 --- a/docs/4.10/subscriptions/trigger-subscriptions.md +++ b/docs/4.10/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.10/the-basics/directives.md b/docs/4.10/the-basics/directives.md index 2b47c981f9..d89c714414 100644 --- a/docs/4.10/the-basics/directives.md +++ b/docs/4.10/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Require authentication - @guard(with: "api") + # Resolve as a paginated list + @paginate + # Require authentication + @guard(with: "api") } ``` diff --git a/docs/4.11/api-reference/directives.md b/docs/4.11/api-reference/directives.md index c1c52ba5f6..d532d425a3 100644 --- a/docs/4.11/api-reference/directives.md +++ b/docs/4.11/api-reference/directives.md @@ -261,7 +261,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -295,7 +295,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -478,7 +478,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -519,7 +519,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -703,7 +703,7 @@ This directive can also be used as a [nested arg resolver](../concepts/arg-resol ```graphql type Mutation { updateUser(id: Int, deleteTasks: [Int!]! @delete(relation: "tasks")): User - @update + @update } ``` @@ -714,7 +714,7 @@ possible model that can be deleted. ```graphql type Mutation { updateTask(id: Int, deleteUser: Boolean @delete(relation: "user")): Task - @update + @update } ``` @@ -757,7 +757,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -800,7 +800,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -886,7 +886,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -991,7 +991,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1267,8 +1267,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1303,8 +1303,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1319,7 +1319,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1445,7 +1445,7 @@ If you want to pass down only the arguments in sequence, use the `passOrdered` o ```graphql type User { purchasedItemsCount(year: Int!, includeReturns: Boolean): Int - @method(passOrdered: true) + @method(passOrdered: true) } ``` @@ -1499,10 +1499,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1715,8 +1715,8 @@ to the `@field` directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -1960,7 +1960,7 @@ Here's an example of how you could define it in your schema: type Query { allPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! @all paginatedPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! - @paginate + @paginate } "A custom description for this custom enum." @@ -2384,7 +2384,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @scope @@ -2580,7 +2580,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` diff --git a/docs/4.11/api-reference/scalars.md b/docs/4.11/api-reference/scalars.md index e090da931c..4c931fc583 100644 --- a/docs/4.11/api-reference/scalars.md +++ b/docs/4.11/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.11/custom-directives/argument-directives.md b/docs/4.11/custom-directives/argument-directives.md index 75dee9bf4a..1d67b68d33 100644 --- a/docs/4.11/custom-directives/argument-directives.md +++ b/docs/4.11/custom-directives/argument-directives.md @@ -183,7 +183,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.11/digging-deeper/file-uploads.md b/docs/4.11/digging-deeper/file-uploads.md index 779d0faf82..63734c70f2 100644 --- a/docs/4.11/digging-deeper/file-uploads.md +++ b/docs/4.11/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.11/eloquent/complex-where-conditions.md b/docs/4.11/eloquent/complex-where-conditions.md index fa9ec88242..05635dedd9 100644 --- a/docs/4.11/eloquent/complex-where-conditions.md +++ b/docs/4.11/eloquent/complex-where-conditions.md @@ -106,7 +106,7 @@ want to re-use a list of allowed columns. Here's how your schema could look like ```graphql type Query { allPeople(where: _ @whereConditions(columnsEnum: "PersonColumn")): [Person!]! - @all + @all paginatedPeople( where: _ @whereConditions(columnsEnum: "PersonColumn") diff --git a/docs/4.11/security/authorization.md b/docs/4.11/security/authorization.md index 3acf7e9013..bde4c82a38 100644 --- a/docs/4.11/security/authorization.md +++ b/docs/4.11/security/authorization.md @@ -120,7 +120,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` diff --git a/docs/4.11/subscriptions/trigger-subscriptions.md b/docs/4.11/subscriptions/trigger-subscriptions.md index 0b20951ef4..164c26ffe4 100644 --- a/docs/4.11/subscriptions/trigger-subscriptions.md +++ b/docs/4.11/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.11/the-basics/directives.md b/docs/4.11/the-basics/directives.md index 2b47c981f9..d89c714414 100644 --- a/docs/4.11/the-basics/directives.md +++ b/docs/4.11/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Require authentication - @guard(with: "api") + # Resolve as a paginated list + @paginate + # Require authentication + @guard(with: "api") } ``` diff --git a/docs/4.12/api-reference/directives.md b/docs/4.12/api-reference/directives.md index 0e4f04dab5..665dd83cb2 100644 --- a/docs/4.12/api-reference/directives.md +++ b/docs/4.12/api-reference/directives.md @@ -261,7 +261,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -295,7 +295,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -478,7 +478,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -519,7 +519,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -703,7 +703,7 @@ This directive can also be used as a [nested arg resolver](../concepts/arg-resol ```graphql type Mutation { updateUser(id: Int, deleteTasks: [Int!]! @delete(relation: "tasks")): User - @update + @update } ``` @@ -714,7 +714,7 @@ possible model that can be deleted. ```graphql type Mutation { updateTask(id: Int, deleteUser: Boolean @delete(relation: "user")): Task - @update + @update } ``` @@ -757,7 +757,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -800,7 +800,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -886,7 +886,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -991,7 +991,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1267,8 +1267,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1303,8 +1303,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1319,7 +1319,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1445,7 +1445,7 @@ If you want to pass down only the arguments in sequence, use the `passOrdered` o ```graphql type User { purchasedItemsCount(year: Int!, includeReturns: Boolean): Int - @method(passOrdered: true) + @method(passOrdered: true) } ``` @@ -1499,10 +1499,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1715,8 +1715,8 @@ to the `@field` directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -1960,7 +1960,7 @@ Here's an example of how you could define it in your schema: type Query { allPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! @all paginatedPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! - @paginate + @paginate } "A custom description for this custom enum." @@ -2382,7 +2382,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @scope @@ -2578,7 +2578,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` diff --git a/docs/4.12/api-reference/scalars.md b/docs/4.12/api-reference/scalars.md index 7004fca1f0..8a2e5a579d 100644 --- a/docs/4.12/api-reference/scalars.md +++ b/docs/4.12/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime and timezone string in ISO 8601 format `Y-m-dTH:i:sO`, e.g. `2020-04-20T13:53:12+02:00`." scalar DateTimeTz - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeTz") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeTz") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -48,7 +48,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.12/custom-directives/argument-directives.md b/docs/4.12/custom-directives/argument-directives.md index 75dee9bf4a..1d67b68d33 100644 --- a/docs/4.12/custom-directives/argument-directives.md +++ b/docs/4.12/custom-directives/argument-directives.md @@ -183,7 +183,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.12/digging-deeper/file-uploads.md b/docs/4.12/digging-deeper/file-uploads.md index 779d0faf82..63734c70f2 100644 --- a/docs/4.12/digging-deeper/file-uploads.md +++ b/docs/4.12/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.12/eloquent/complex-where-conditions.md b/docs/4.12/eloquent/complex-where-conditions.md index fa9ec88242..05635dedd9 100644 --- a/docs/4.12/eloquent/complex-where-conditions.md +++ b/docs/4.12/eloquent/complex-where-conditions.md @@ -106,7 +106,7 @@ want to re-use a list of allowed columns. Here's how your schema could look like ```graphql type Query { allPeople(where: _ @whereConditions(columnsEnum: "PersonColumn")): [Person!]! - @all + @all paginatedPeople( where: _ @whereConditions(columnsEnum: "PersonColumn") diff --git a/docs/4.12/security/authorization.md b/docs/4.12/security/authorization.md index 7314b4cc6c..33230039fb 100644 --- a/docs/4.12/security/authorization.md +++ b/docs/4.12/security/authorization.md @@ -120,7 +120,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` diff --git a/docs/4.12/subscriptions/trigger-subscriptions.md b/docs/4.12/subscriptions/trigger-subscriptions.md index 0b20951ef4..164c26ffe4 100644 --- a/docs/4.12/subscriptions/trigger-subscriptions.md +++ b/docs/4.12/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.12/the-basics/directives.md b/docs/4.12/the-basics/directives.md index 2b47c981f9..d89c714414 100644 --- a/docs/4.12/the-basics/directives.md +++ b/docs/4.12/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Require authentication - @guard(with: "api") + # Resolve as a paginated list + @paginate + # Require authentication + @guard(with: "api") } ``` diff --git a/docs/4.13/api-reference/directives.md b/docs/4.13/api-reference/directives.md index 5113c5cb26..47b923c475 100644 --- a/docs/4.13/api-reference/directives.md +++ b/docs/4.13/api-reference/directives.md @@ -262,7 +262,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -296,7 +296,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -479,7 +479,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -520,7 +520,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -704,7 +704,7 @@ This directive can also be used as a [nested arg resolver](../concepts/arg-resol ```graphql type Mutation { updateUser(id: Int, deleteTasks: [Int!]! @delete(relation: "tasks")): User - @update + @update } ``` @@ -715,7 +715,7 @@ possible model that can be deleted. ```graphql type Mutation { updateTask(id: Int, deleteUser: Boolean @delete(relation: "user")): Task - @update + @update } ``` @@ -758,7 +758,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -801,7 +801,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -887,7 +887,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -992,7 +992,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1277,8 +1277,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1313,8 +1313,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1329,7 +1329,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1455,7 +1455,7 @@ If you want to pass down only the arguments in sequence, use the `passOrdered` o ```graphql type User { purchasedItemsCount(year: Int!, includeReturns: Boolean): Int - @method(passOrdered: true) + @method(passOrdered: true) } ``` @@ -1509,10 +1509,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1713,8 +1713,8 @@ to the [@field](#field) directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -1958,7 +1958,7 @@ Here's an example of how you could define it in your schema: type Query { allPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! @all paginatedPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! - @paginate + @paginate } "A custom description for this custom enum." @@ -2384,7 +2384,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @scope @@ -2579,7 +2579,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` @@ -2758,7 +2758,7 @@ Client libraries such as Apollo base their caching mechanism on that assumption. ```graphql type Mutation { updatePost(id: ID! @rename(attribute: "post_id"), content: String): Post - @update + @update } ``` diff --git a/docs/4.13/api-reference/scalars.md b/docs/4.13/api-reference/scalars.md index ae96daa209..d4a3baab37 100644 --- a/docs/4.13/api-reference/scalars.md +++ b/docs/4.13/api-reference/scalars.md @@ -6,7 +6,7 @@ using [@scalar](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime and timezone string in ISO 8601 format `Y-m-dTH:i:sO`, e.g. `2020-04-20T13:53:12+02:00`." scalar DateTimeTz - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeTz") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeTz") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -48,7 +48,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.13/custom-directives/argument-directives.md b/docs/4.13/custom-directives/argument-directives.md index aa289f011d..bbe3493891 100644 --- a/docs/4.13/custom-directives/argument-directives.md +++ b/docs/4.13/custom-directives/argument-directives.md @@ -186,7 +186,7 @@ Lighthouse's [@whereBetween](../api-reference/directives.md#wherebetween) is one ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.13/digging-deeper/file-uploads.md b/docs/4.13/digging-deeper/file-uploads.md index 923e411940..60ad237326 100644 --- a/docs/4.13/digging-deeper/file-uploads.md +++ b/docs/4.13/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.13/eloquent/complex-where-conditions.md b/docs/4.13/eloquent/complex-where-conditions.md index 30a823bcda..3741948fed 100644 --- a/docs/4.13/eloquent/complex-where-conditions.md +++ b/docs/4.13/eloquent/complex-where-conditions.md @@ -106,7 +106,7 @@ want to re-use a list of allowed columns. Here's how your schema could look like ```graphql type Query { allPeople(where: _ @whereConditions(columnsEnum: "PersonColumn")): [Person!]! - @all + @all paginatedPeople( where: _ @whereConditions(columnsEnum: "PersonColumn") diff --git a/docs/4.13/security/authorization.md b/docs/4.13/security/authorization.md index 8f262cec44..853ddd58c9 100644 --- a/docs/4.13/security/authorization.md +++ b/docs/4.13/security/authorization.md @@ -120,7 +120,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` diff --git a/docs/4.13/subscriptions/trigger-subscriptions.md b/docs/4.13/subscriptions/trigger-subscriptions.md index 8c283056b2..1b6f89e7fa 100644 --- a/docs/4.13/subscriptions/trigger-subscriptions.md +++ b/docs/4.13/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.13/the-basics/directives.md b/docs/4.13/the-basics/directives.md index 71311d47d0..e4ba3d930d 100644 --- a/docs/4.13/the-basics/directives.md +++ b/docs/4.13/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Require authentication - @guard(with: "api") + # Resolve as a paginated list + @paginate + # Require authentication + @guard(with: "api") } ``` diff --git a/docs/4.14/api-reference/directives.md b/docs/4.14/api-reference/directives.md index 5113c5cb26..47b923c475 100644 --- a/docs/4.14/api-reference/directives.md +++ b/docs/4.14/api-reference/directives.md @@ -262,7 +262,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -296,7 +296,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -479,7 +479,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -520,7 +520,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -704,7 +704,7 @@ This directive can also be used as a [nested arg resolver](../concepts/arg-resol ```graphql type Mutation { updateUser(id: Int, deleteTasks: [Int!]! @delete(relation: "tasks")): User - @update + @update } ``` @@ -715,7 +715,7 @@ possible model that can be deleted. ```graphql type Mutation { updateTask(id: Int, deleteUser: Boolean @delete(relation: "user")): Task - @update + @update } ``` @@ -758,7 +758,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -801,7 +801,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -887,7 +887,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -992,7 +992,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1277,8 +1277,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1313,8 +1313,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1329,7 +1329,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1455,7 +1455,7 @@ If you want to pass down only the arguments in sequence, use the `passOrdered` o ```graphql type User { purchasedItemsCount(year: Int!, includeReturns: Boolean): Int - @method(passOrdered: true) + @method(passOrdered: true) } ``` @@ -1509,10 +1509,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1713,8 +1713,8 @@ to the [@field](#field) directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -1958,7 +1958,7 @@ Here's an example of how you could define it in your schema: type Query { allPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! @all paginatedPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! - @paginate + @paginate } "A custom description for this custom enum." @@ -2384,7 +2384,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @scope @@ -2579,7 +2579,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` @@ -2758,7 +2758,7 @@ Client libraries such as Apollo base their caching mechanism on that assumption. ```graphql type Mutation { updatePost(id: ID! @rename(attribute: "post_id"), content: String): Post - @update + @update } ``` diff --git a/docs/4.14/api-reference/scalars.md b/docs/4.14/api-reference/scalars.md index ae96daa209..d4a3baab37 100644 --- a/docs/4.14/api-reference/scalars.md +++ b/docs/4.14/api-reference/scalars.md @@ -6,7 +6,7 @@ using [@scalar](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime and timezone string in ISO 8601 format `Y-m-dTH:i:sO`, e.g. `2020-04-20T13:53:12+02:00`." scalar DateTimeTz - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeTz") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeTz") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -48,7 +48,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.14/custom-directives/argument-directives.md b/docs/4.14/custom-directives/argument-directives.md index aa289f011d..bbe3493891 100644 --- a/docs/4.14/custom-directives/argument-directives.md +++ b/docs/4.14/custom-directives/argument-directives.md @@ -186,7 +186,7 @@ Lighthouse's [@whereBetween](../api-reference/directives.md#wherebetween) is one ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.14/digging-deeper/file-uploads.md b/docs/4.14/digging-deeper/file-uploads.md index 923e411940..60ad237326 100644 --- a/docs/4.14/digging-deeper/file-uploads.md +++ b/docs/4.14/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.14/eloquent/complex-where-conditions.md b/docs/4.14/eloquent/complex-where-conditions.md index 30a823bcda..3741948fed 100644 --- a/docs/4.14/eloquent/complex-where-conditions.md +++ b/docs/4.14/eloquent/complex-where-conditions.md @@ -106,7 +106,7 @@ want to re-use a list of allowed columns. Here's how your schema could look like ```graphql type Query { allPeople(where: _ @whereConditions(columnsEnum: "PersonColumn")): [Person!]! - @all + @all paginatedPeople( where: _ @whereConditions(columnsEnum: "PersonColumn") diff --git a/docs/4.14/security/authorization.md b/docs/4.14/security/authorization.md index 8f262cec44..853ddd58c9 100644 --- a/docs/4.14/security/authorization.md +++ b/docs/4.14/security/authorization.md @@ -120,7 +120,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` diff --git a/docs/4.14/subscriptions/trigger-subscriptions.md b/docs/4.14/subscriptions/trigger-subscriptions.md index 8c283056b2..1b6f89e7fa 100644 --- a/docs/4.14/subscriptions/trigger-subscriptions.md +++ b/docs/4.14/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.14/the-basics/directives.md b/docs/4.14/the-basics/directives.md index 71311d47d0..e4ba3d930d 100644 --- a/docs/4.14/the-basics/directives.md +++ b/docs/4.14/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Require authentication - @guard(with: "api") + # Resolve as a paginated list + @paginate + # Require authentication + @guard(with: "api") } ``` diff --git a/docs/4.15/api-reference/directives.md b/docs/4.15/api-reference/directives.md index d4874030d3..9e0d37bcd4 100644 --- a/docs/4.15/api-reference/directives.md +++ b/docs/4.15/api-reference/directives.md @@ -262,7 +262,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -296,7 +296,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -479,7 +479,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -520,7 +520,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -704,7 +704,7 @@ This directive can also be used as a [nested arg resolver](../concepts/arg-resol ```graphql type Mutation { updateUser(id: Int, deleteTasks: [Int!]! @delete(relation: "tasks")): User - @update + @update } ``` @@ -715,7 +715,7 @@ possible model that can be deleted. ```graphql type Mutation { updateTask(id: Int, deleteUser: Boolean @delete(relation: "user")): Task - @update + @update } ``` @@ -758,7 +758,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -801,7 +801,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -887,7 +887,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -992,7 +992,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1277,8 +1277,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1313,8 +1313,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1329,7 +1329,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1455,7 +1455,7 @@ If you want to pass down only the arguments in sequence, use the `passOrdered` o ```graphql type User { purchasedItemsCount(year: Int!, includeReturns: Boolean): Int - @method(passOrdered: true) + @method(passOrdered: true) } ``` @@ -1509,10 +1509,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1713,8 +1713,8 @@ to the [@field](#field) directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -1958,7 +1958,7 @@ Here's an example of how you could define it in your schema: type Query { allPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! @all paginatedPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! - @paginate + @paginate } "A custom description for this custom enum." @@ -2384,7 +2384,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @scope @@ -2579,7 +2579,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` @@ -2758,7 +2758,7 @@ Client libraries such as Apollo base their caching mechanism on that assumption. ```graphql type Mutation { updatePost(id: ID! @rename(attribute: "post_id"), content: String): Post - @update + @update } ``` diff --git a/docs/4.15/api-reference/scalars.md b/docs/4.15/api-reference/scalars.md index ae96daa209..d4a3baab37 100644 --- a/docs/4.15/api-reference/scalars.md +++ b/docs/4.15/api-reference/scalars.md @@ -6,7 +6,7 @@ using [@scalar](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime and timezone string in ISO 8601 format `Y-m-dTH:i:sO`, e.g. `2020-04-20T13:53:12+02:00`." scalar DateTimeTz - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeTz") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeTz") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -48,7 +48,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.15/custom-directives/argument-directives.md b/docs/4.15/custom-directives/argument-directives.md index aa289f011d..bbe3493891 100644 --- a/docs/4.15/custom-directives/argument-directives.md +++ b/docs/4.15/custom-directives/argument-directives.md @@ -186,7 +186,7 @@ Lighthouse's [@whereBetween](../api-reference/directives.md#wherebetween) is one ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.15/digging-deeper/file-uploads.md b/docs/4.15/digging-deeper/file-uploads.md index 923e411940..60ad237326 100644 --- a/docs/4.15/digging-deeper/file-uploads.md +++ b/docs/4.15/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.15/eloquent/complex-where-conditions.md b/docs/4.15/eloquent/complex-where-conditions.md index 30a823bcda..3741948fed 100644 --- a/docs/4.15/eloquent/complex-where-conditions.md +++ b/docs/4.15/eloquent/complex-where-conditions.md @@ -106,7 +106,7 @@ want to re-use a list of allowed columns. Here's how your schema could look like ```graphql type Query { allPeople(where: _ @whereConditions(columnsEnum: "PersonColumn")): [Person!]! - @all + @all paginatedPeople( where: _ @whereConditions(columnsEnum: "PersonColumn") diff --git a/docs/4.15/security/authorization.md b/docs/4.15/security/authorization.md index 8f262cec44..853ddd58c9 100644 --- a/docs/4.15/security/authorization.md +++ b/docs/4.15/security/authorization.md @@ -120,7 +120,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` diff --git a/docs/4.15/subscriptions/trigger-subscriptions.md b/docs/4.15/subscriptions/trigger-subscriptions.md index 8c283056b2..1b6f89e7fa 100644 --- a/docs/4.15/subscriptions/trigger-subscriptions.md +++ b/docs/4.15/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.15/the-basics/directives.md b/docs/4.15/the-basics/directives.md index 71311d47d0..e4ba3d930d 100644 --- a/docs/4.15/the-basics/directives.md +++ b/docs/4.15/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Require authentication - @guard(with: "api") + # Resolve as a paginated list + @paginate + # Require authentication + @guard(with: "api") } ``` diff --git a/docs/4.16/api-reference/directives.md b/docs/4.16/api-reference/directives.md index d4874030d3..9e0d37bcd4 100644 --- a/docs/4.16/api-reference/directives.md +++ b/docs/4.16/api-reference/directives.md @@ -262,7 +262,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -296,7 +296,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -479,7 +479,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -520,7 +520,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -704,7 +704,7 @@ This directive can also be used as a [nested arg resolver](../concepts/arg-resol ```graphql type Mutation { updateUser(id: Int, deleteTasks: [Int!]! @delete(relation: "tasks")): User - @update + @update } ``` @@ -715,7 +715,7 @@ possible model that can be deleted. ```graphql type Mutation { updateTask(id: Int, deleteUser: Boolean @delete(relation: "user")): Task - @update + @update } ``` @@ -758,7 +758,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -801,7 +801,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -887,7 +887,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -992,7 +992,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1277,8 +1277,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1313,8 +1313,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1329,7 +1329,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1455,7 +1455,7 @@ If you want to pass down only the arguments in sequence, use the `passOrdered` o ```graphql type User { purchasedItemsCount(year: Int!, includeReturns: Boolean): Int - @method(passOrdered: true) + @method(passOrdered: true) } ``` @@ -1509,10 +1509,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1713,8 +1713,8 @@ to the [@field](#field) directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -1958,7 +1958,7 @@ Here's an example of how you could define it in your schema: type Query { allPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! @all paginatedPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! - @paginate + @paginate } "A custom description for this custom enum." @@ -2384,7 +2384,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @scope @@ -2579,7 +2579,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` @@ -2758,7 +2758,7 @@ Client libraries such as Apollo base their caching mechanism on that assumption. ```graphql type Mutation { updatePost(id: ID! @rename(attribute: "post_id"), content: String): Post - @update + @update } ``` diff --git a/docs/4.16/api-reference/scalars.md b/docs/4.16/api-reference/scalars.md index 4e982ea314..1fed36d8a2 100644 --- a/docs/4.16/api-reference/scalars.md +++ b/docs/4.16/api-reference/scalars.md @@ -6,7 +6,7 @@ using [@scalar](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime and timezone string in ISO 8601 format `Y-m-dTH:i:sO`, e.g. `2020-04-20T13:53:12+02:00`." scalar DateTimeTz - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeTz") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeTz") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -48,7 +48,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string in ISO 8601 format in UTC with nanoseconds `YYYY-MM-DDTHH:mm:ss.SSSSSSZ`, e.g. `2020-04-20T16:20:04.000000Z`." scalar DateTimeUtc - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeUtc") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeUtc") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -60,7 +60,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.16/custom-directives/argument-directives.md b/docs/4.16/custom-directives/argument-directives.md index aa289f011d..bbe3493891 100644 --- a/docs/4.16/custom-directives/argument-directives.md +++ b/docs/4.16/custom-directives/argument-directives.md @@ -186,7 +186,7 @@ Lighthouse's [@whereBetween](../api-reference/directives.md#wherebetween) is one ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.16/digging-deeper/file-uploads.md b/docs/4.16/digging-deeper/file-uploads.md index 923e411940..60ad237326 100644 --- a/docs/4.16/digging-deeper/file-uploads.md +++ b/docs/4.16/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.16/eloquent/complex-where-conditions.md b/docs/4.16/eloquent/complex-where-conditions.md index 30a823bcda..3741948fed 100644 --- a/docs/4.16/eloquent/complex-where-conditions.md +++ b/docs/4.16/eloquent/complex-where-conditions.md @@ -106,7 +106,7 @@ want to re-use a list of allowed columns. Here's how your schema could look like ```graphql type Query { allPeople(where: _ @whereConditions(columnsEnum: "PersonColumn")): [Person!]! - @all + @all paginatedPeople( where: _ @whereConditions(columnsEnum: "PersonColumn") diff --git a/docs/4.16/security/authorization.md b/docs/4.16/security/authorization.md index 8f262cec44..853ddd58c9 100644 --- a/docs/4.16/security/authorization.md +++ b/docs/4.16/security/authorization.md @@ -120,7 +120,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` diff --git a/docs/4.16/subscriptions/trigger-subscriptions.md b/docs/4.16/subscriptions/trigger-subscriptions.md index 8c283056b2..1b6f89e7fa 100644 --- a/docs/4.16/subscriptions/trigger-subscriptions.md +++ b/docs/4.16/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.16/the-basics/directives.md b/docs/4.16/the-basics/directives.md index 71311d47d0..e4ba3d930d 100644 --- a/docs/4.16/the-basics/directives.md +++ b/docs/4.16/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Require authentication - @guard(with: "api") + # Resolve as a paginated list + @paginate + # Require authentication + @guard(with: "api") } ``` diff --git a/docs/4.2/api-reference/directives.md b/docs/4.2/api-reference/directives.md index 5474379484..2771b90dc2 100644 --- a/docs/4.2/api-reference/directives.md +++ b/docs/4.2/api-reference/directives.md @@ -267,7 +267,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -301,7 +301,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -506,7 +506,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -515,7 +515,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -557,7 +557,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -723,7 +723,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -766,7 +766,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -852,7 +852,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -925,7 +925,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1160,8 +1160,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1196,8 +1196,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1212,7 +1212,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1352,10 +1352,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1553,8 +1553,8 @@ to the `@field` directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -2024,7 +2024,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @search @@ -2158,7 +2158,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` @@ -2478,7 +2478,7 @@ enum Operator { type Query { people( where: WhereConstraints - @whereConstraints(columns: ["age", "type", "haircolour", "height"]) + @whereConstraints(columns: ["age", "type", "haircolour", "height"]) ): [Person!]! } ``` diff --git a/docs/4.2/api-reference/scalars.md b/docs/4.2/api-reference/scalars.md index e090da931c..4c931fc583 100644 --- a/docs/4.2/api-reference/scalars.md +++ b/docs/4.2/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.2/custom-directives/argument-directives.md b/docs/4.2/custom-directives/argument-directives.md index 3109924f00..c990e7dce4 100644 --- a/docs/4.2/custom-directives/argument-directives.md +++ b/docs/4.2/custom-directives/argument-directives.md @@ -178,7 +178,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.2/digging-deeper/file-uploads.md b/docs/4.2/digging-deeper/file-uploads.md index 779d0faf82..63734c70f2 100644 --- a/docs/4.2/digging-deeper/file-uploads.md +++ b/docs/4.2/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.2/subscriptions/trigger-subscriptions.md b/docs/4.2/subscriptions/trigger-subscriptions.md index 0b20951ef4..164c26ffe4 100644 --- a/docs/4.2/subscriptions/trigger-subscriptions.md +++ b/docs/4.2/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.2/the-basics/directives.md b/docs/4.2/the-basics/directives.md index 2a281890ee..415b334195 100644 --- a/docs/4.2/the-basics/directives.md +++ b/docs/4.2/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Reuse existing Laravel authentication middleware - @middleware(checks: ["auth:api"]) + # Resolve as a paginated list + @paginate + # Reuse existing Laravel authentication middleware + @middleware(checks: ["auth:api"]) } ``` diff --git a/docs/4.3/api-reference/directives.md b/docs/4.3/api-reference/directives.md index 39d28253ee..8e11f377d6 100644 --- a/docs/4.3/api-reference/directives.md +++ b/docs/4.3/api-reference/directives.md @@ -267,7 +267,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -301,7 +301,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -506,7 +506,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -515,7 +515,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -557,7 +557,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -729,7 +729,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -772,7 +772,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -858,7 +858,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -963,7 +963,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1198,8 +1198,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1234,8 +1234,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1250,7 +1250,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1390,10 +1390,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1591,8 +1591,8 @@ to the `@field` directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -2094,7 +2094,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @search @@ -2257,7 +2257,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` @@ -2597,7 +2597,7 @@ enum Operator { type Query { people( where: WhereConstraints - @whereConstraints(columns: ["age", "type", "haircolour", "height"]) + @whereConstraints(columns: ["age", "type", "haircolour", "height"]) ): [Person!]! } ``` diff --git a/docs/4.3/api-reference/scalars.md b/docs/4.3/api-reference/scalars.md index e090da931c..4c931fc583 100644 --- a/docs/4.3/api-reference/scalars.md +++ b/docs/4.3/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.3/custom-directives/argument-directives.md b/docs/4.3/custom-directives/argument-directives.md index 3109924f00..c990e7dce4 100644 --- a/docs/4.3/custom-directives/argument-directives.md +++ b/docs/4.3/custom-directives/argument-directives.md @@ -178,7 +178,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.3/digging-deeper/file-uploads.md b/docs/4.3/digging-deeper/file-uploads.md index 779d0faf82..63734c70f2 100644 --- a/docs/4.3/digging-deeper/file-uploads.md +++ b/docs/4.3/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.3/subscriptions/trigger-subscriptions.md b/docs/4.3/subscriptions/trigger-subscriptions.md index 0b20951ef4..164c26ffe4 100644 --- a/docs/4.3/subscriptions/trigger-subscriptions.md +++ b/docs/4.3/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.3/the-basics/directives.md b/docs/4.3/the-basics/directives.md index 8d0a56ff68..4631d51d93 100644 --- a/docs/4.3/the-basics/directives.md +++ b/docs/4.3/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Reuse existing Laravel authentication middleware - @middleware(checks: ["auth:api"]) + # Resolve as a paginated list + @paginate + # Reuse existing Laravel authentication middleware + @middleware(checks: ["auth:api"]) } ``` diff --git a/docs/4.4/api-reference/directives.md b/docs/4.4/api-reference/directives.md index e211a9d32e..28779e0290 100644 --- a/docs/4.4/api-reference/directives.md +++ b/docs/4.4/api-reference/directives.md @@ -267,7 +267,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -301,7 +301,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -506,7 +506,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -515,7 +515,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -557,7 +557,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -765,7 +765,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -808,7 +808,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -894,7 +894,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -999,7 +999,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1234,8 +1234,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1270,8 +1270,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1286,7 +1286,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1426,10 +1426,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1642,8 +1642,8 @@ to the `@field` directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -2170,7 +2170,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @search @@ -2333,7 +2333,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` @@ -2673,7 +2673,7 @@ enum Operator { type Query { people( where: WhereConstraints - @whereConstraints(columns: ["age", "type", "haircolour", "height"]) + @whereConstraints(columns: ["age", "type", "haircolour", "height"]) ): [Person!]! } ``` diff --git a/docs/4.4/api-reference/scalars.md b/docs/4.4/api-reference/scalars.md index e090da931c..4c931fc583 100644 --- a/docs/4.4/api-reference/scalars.md +++ b/docs/4.4/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.4/custom-directives/argument-directives.md b/docs/4.4/custom-directives/argument-directives.md index 3109924f00..c990e7dce4 100644 --- a/docs/4.4/custom-directives/argument-directives.md +++ b/docs/4.4/custom-directives/argument-directives.md @@ -178,7 +178,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.4/digging-deeper/file-uploads.md b/docs/4.4/digging-deeper/file-uploads.md index 779d0faf82..63734c70f2 100644 --- a/docs/4.4/digging-deeper/file-uploads.md +++ b/docs/4.4/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.4/subscriptions/trigger-subscriptions.md b/docs/4.4/subscriptions/trigger-subscriptions.md index 0b20951ef4..164c26ffe4 100644 --- a/docs/4.4/subscriptions/trigger-subscriptions.md +++ b/docs/4.4/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.4/the-basics/directives.md b/docs/4.4/the-basics/directives.md index 8d0a56ff68..4631d51d93 100644 --- a/docs/4.4/the-basics/directives.md +++ b/docs/4.4/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Reuse existing Laravel authentication middleware - @middleware(checks: ["auth:api"]) + # Resolve as a paginated list + @paginate + # Reuse existing Laravel authentication middleware + @middleware(checks: ["auth:api"]) } ``` diff --git a/docs/4.5/api-reference/directives.md b/docs/4.5/api-reference/directives.md index 1bda165c8e..50b2dcedb0 100644 --- a/docs/4.5/api-reference/directives.md +++ b/docs/4.5/api-reference/directives.md @@ -267,7 +267,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -301,7 +301,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -506,7 +506,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -515,7 +515,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -557,7 +557,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -765,7 +765,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -808,7 +808,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -894,7 +894,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -999,7 +999,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1234,8 +1234,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1270,8 +1270,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1286,7 +1286,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1426,10 +1426,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1642,8 +1642,8 @@ to the `@field` directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -2170,7 +2170,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @search @@ -2343,7 +2343,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` @@ -2725,7 +2725,7 @@ enum Operator { type Query { people( where: WhereConstraints - @whereConstraints(columns: ["age", "type", "haircolour", "height"]) + @whereConstraints(columns: ["age", "type", "haircolour", "height"]) ): [Person!]! } ``` diff --git a/docs/4.5/api-reference/scalars.md b/docs/4.5/api-reference/scalars.md index e090da931c..4c931fc583 100644 --- a/docs/4.5/api-reference/scalars.md +++ b/docs/4.5/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.5/custom-directives/argument-directives.md b/docs/4.5/custom-directives/argument-directives.md index 3109924f00..c990e7dce4 100644 --- a/docs/4.5/custom-directives/argument-directives.md +++ b/docs/4.5/custom-directives/argument-directives.md @@ -178,7 +178,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.5/digging-deeper/file-uploads.md b/docs/4.5/digging-deeper/file-uploads.md index 779d0faf82..63734c70f2 100644 --- a/docs/4.5/digging-deeper/file-uploads.md +++ b/docs/4.5/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.5/subscriptions/trigger-subscriptions.md b/docs/4.5/subscriptions/trigger-subscriptions.md index 0b20951ef4..164c26ffe4 100644 --- a/docs/4.5/subscriptions/trigger-subscriptions.md +++ b/docs/4.5/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.5/the-basics/directives.md b/docs/4.5/the-basics/directives.md index 8d0a56ff68..4631d51d93 100644 --- a/docs/4.5/the-basics/directives.md +++ b/docs/4.5/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Reuse existing Laravel authentication middleware - @middleware(checks: ["auth:api"]) + # Resolve as a paginated list + @paginate + # Reuse existing Laravel authentication middleware + @middleware(checks: ["auth:api"]) } ``` diff --git a/docs/4.6/api-reference/directives.md b/docs/4.6/api-reference/directives.md index f48b36f20b..c6eb6eedc3 100644 --- a/docs/4.6/api-reference/directives.md +++ b/docs/4.6/api-reference/directives.md @@ -267,7 +267,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -301,7 +301,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -506,7 +506,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -515,7 +515,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -557,7 +557,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -765,7 +765,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -808,7 +808,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -894,7 +894,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -999,7 +999,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1234,8 +1234,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1270,8 +1270,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1286,7 +1286,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1426,10 +1426,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1642,8 +1642,8 @@ to the `@field` directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -2170,7 +2170,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @scope @@ -2366,7 +2366,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` @@ -2748,7 +2748,7 @@ enum Operator { type Query { people( where: WhereConstraints - @whereConstraints(columns: ["age", "type", "haircolour", "height"]) + @whereConstraints(columns: ["age", "type", "haircolour", "height"]) ): [Person!]! } ``` diff --git a/docs/4.6/api-reference/scalars.md b/docs/4.6/api-reference/scalars.md index e090da931c..4c931fc583 100644 --- a/docs/4.6/api-reference/scalars.md +++ b/docs/4.6/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.6/custom-directives/argument-directives.md b/docs/4.6/custom-directives/argument-directives.md index 3109924f00..c990e7dce4 100644 --- a/docs/4.6/custom-directives/argument-directives.md +++ b/docs/4.6/custom-directives/argument-directives.md @@ -178,7 +178,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.6/digging-deeper/file-uploads.md b/docs/4.6/digging-deeper/file-uploads.md index 779d0faf82..63734c70f2 100644 --- a/docs/4.6/digging-deeper/file-uploads.md +++ b/docs/4.6/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.6/subscriptions/trigger-subscriptions.md b/docs/4.6/subscriptions/trigger-subscriptions.md index 0b20951ef4..164c26ffe4 100644 --- a/docs/4.6/subscriptions/trigger-subscriptions.md +++ b/docs/4.6/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.6/the-basics/directives.md b/docs/4.6/the-basics/directives.md index 8d0a56ff68..4631d51d93 100644 --- a/docs/4.6/the-basics/directives.md +++ b/docs/4.6/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Reuse existing Laravel authentication middleware - @middleware(checks: ["auth:api"]) + # Resolve as a paginated list + @paginate + # Reuse existing Laravel authentication middleware + @middleware(checks: ["auth:api"]) } ``` diff --git a/docs/4.7/api-reference/directives.md b/docs/4.7/api-reference/directives.md index 56cb7cb5ab..43a9b7aebc 100644 --- a/docs/4.7/api-reference/directives.md +++ b/docs/4.7/api-reference/directives.md @@ -267,7 +267,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -301,7 +301,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -525,7 +525,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -534,7 +534,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -587,7 +587,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -795,7 +795,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -838,7 +838,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -924,7 +924,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -1032,7 +1032,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1267,8 +1267,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1303,8 +1303,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1319,7 +1319,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1468,10 +1468,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1684,8 +1684,8 @@ to the `@field` directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -2221,7 +2221,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @scope @@ -2417,7 +2417,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` @@ -2799,7 +2799,7 @@ enum Operator { type Query { people( where: WhereConstraints - @whereConstraints(columns: ["age", "type", "haircolour", "height"]) + @whereConstraints(columns: ["age", "type", "haircolour", "height"]) ): [Person!]! } ``` diff --git a/docs/4.7/api-reference/scalars.md b/docs/4.7/api-reference/scalars.md index e090da931c..4c931fc583 100644 --- a/docs/4.7/api-reference/scalars.md +++ b/docs/4.7/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.7/custom-directives/argument-directives.md b/docs/4.7/custom-directives/argument-directives.md index 3109924f00..c990e7dce4 100644 --- a/docs/4.7/custom-directives/argument-directives.md +++ b/docs/4.7/custom-directives/argument-directives.md @@ -178,7 +178,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.7/digging-deeper/file-uploads.md b/docs/4.7/digging-deeper/file-uploads.md index 779d0faf82..63734c70f2 100644 --- a/docs/4.7/digging-deeper/file-uploads.md +++ b/docs/4.7/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.7/subscriptions/trigger-subscriptions.md b/docs/4.7/subscriptions/trigger-subscriptions.md index 0b20951ef4..164c26ffe4 100644 --- a/docs/4.7/subscriptions/trigger-subscriptions.md +++ b/docs/4.7/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.7/the-basics/directives.md b/docs/4.7/the-basics/directives.md index 8d0a56ff68..4631d51d93 100644 --- a/docs/4.7/the-basics/directives.md +++ b/docs/4.7/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Reuse existing Laravel authentication middleware - @middleware(checks: ["auth:api"]) + # Resolve as a paginated list + @paginate + # Reuse existing Laravel authentication middleware + @middleware(checks: ["auth:api"]) } ``` diff --git a/docs/4.8/api-reference/directives.md b/docs/4.8/api-reference/directives.md index 0f498487c9..ae160bd784 100644 --- a/docs/4.8/api-reference/directives.md +++ b/docs/4.8/api-reference/directives.md @@ -267,7 +267,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -301,7 +301,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -525,7 +525,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -534,7 +534,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` @@ -587,7 +587,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -771,7 +771,7 @@ This directive can also be used as a [nested arg resolver](../concepts/arg-resol ```graphql type Mutation { updateUser(id: Int, deleteTasks: [Int!]! @delete(relation: "tasks")): User - @update + @update } ``` @@ -782,7 +782,7 @@ possible model that can be deleted. ```graphql type Mutation { updateTask(id: Int, deleteUser: Boolean @delete(relation: "user")): Task - @update + @update } ``` @@ -825,7 +825,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -868,7 +868,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -954,7 +954,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -1059,7 +1059,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1311,8 +1311,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1347,8 +1347,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1363,7 +1363,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1506,10 +1506,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1722,8 +1722,8 @@ to the `@field` directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -2323,7 +2323,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @scope @@ -2519,7 +2519,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` diff --git a/docs/4.8/api-reference/scalars.md b/docs/4.8/api-reference/scalars.md index e090da931c..4c931fc583 100644 --- a/docs/4.8/api-reference/scalars.md +++ b/docs/4.8/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.8/custom-directives/argument-directives.md b/docs/4.8/custom-directives/argument-directives.md index 76ad44205f..4faad7f796 100644 --- a/docs/4.8/custom-directives/argument-directives.md +++ b/docs/4.8/custom-directives/argument-directives.md @@ -183,7 +183,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.8/digging-deeper/file-uploads.md b/docs/4.8/digging-deeper/file-uploads.md index 779d0faf82..63734c70f2 100644 --- a/docs/4.8/digging-deeper/file-uploads.md +++ b/docs/4.8/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.8/subscriptions/trigger-subscriptions.md b/docs/4.8/subscriptions/trigger-subscriptions.md index 0b20951ef4..164c26ffe4 100644 --- a/docs/4.8/subscriptions/trigger-subscriptions.md +++ b/docs/4.8/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.8/the-basics/directives.md b/docs/4.8/the-basics/directives.md index 2b47c981f9..d89c714414 100644 --- a/docs/4.8/the-basics/directives.md +++ b/docs/4.8/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Require authentication - @guard(with: "api") + # Resolve as a paginated list + @paginate + # Require authentication + @guard(with: "api") } ``` diff --git a/docs/4.9/api-reference/directives.md b/docs/4.9/api-reference/directives.md index 8b70ab9fea..0e34814e7e 100644 --- a/docs/4.9/api-reference/directives.md +++ b/docs/4.9/api-reference/directives.md @@ -267,7 +267,7 @@ Broadcast the results of a mutation to subscribed clients. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -301,7 +301,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -482,7 +482,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -523,7 +523,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -707,7 +707,7 @@ This directive can also be used as a [nested arg resolver](../concepts/arg-resol ```graphql type Mutation { updateUser(id: Int, deleteTasks: [Int!]! @delete(relation: "tasks")): User - @update + @update } ``` @@ -718,7 +718,7 @@ possible model that can be deleted. ```graphql type Mutation { updateTask(id: Int, deleteUser: Boolean @delete(relation: "user")): Task - @update + @update } ``` @@ -761,7 +761,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -804,7 +804,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -890,7 +890,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -995,7 +995,7 @@ the class name of the event you want to fire. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @event(dispatch: "App\\Events\\PostCreated") + @event(dispatch: "App\\Events\\PostCreated") } ``` @@ -1247,8 +1247,8 @@ Inject a value from the context object into the arguments. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1283,8 +1283,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1299,7 +1299,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1442,10 +1442,10 @@ class name, an alias or a middleware group - or any combination of them. ```graphql type Query { users: [User!]! - @middleware( - checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] - ) - @all + @middleware( + checks: ["auth:api", "App\\Http\\Middleware\\MyCustomAuth", "api"] + ) + @all } ``` @@ -1658,8 +1658,8 @@ to the `@field` directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -1903,7 +1903,7 @@ Here's an example of how you could define it in your schema: type Query { allPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! @all paginatedPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! - @paginate + @paginate } "A custom description for this custom enum." @@ -2327,7 +2327,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @scope @@ -2523,7 +2523,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` diff --git a/docs/4.9/api-reference/scalars.md b/docs/4.9/api-reference/scalars.md index e090da931c..4c931fc583 100644 --- a/docs/4.9/api-reference/scalars.md +++ b/docs/4.9/api-reference/scalars.md @@ -6,7 +6,7 @@ using [`@scalar`](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/4.9/custom-directives/argument-directives.md b/docs/4.9/custom-directives/argument-directives.md index 76ad44205f..4faad7f796 100644 --- a/docs/4.9/custom-directives/argument-directives.md +++ b/docs/4.9/custom-directives/argument-directives.md @@ -183,7 +183,7 @@ Lighthouse's [`@whereBetween`](../api-reference/directives.md#wherebetween) is o ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/4.9/digging-deeper/file-uploads.md b/docs/4.9/digging-deeper/file-uploads.md index 779d0faf82..63734c70f2 100644 --- a/docs/4.9/digging-deeper/file-uploads.md +++ b/docs/4.9/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/4.9/eloquent/complex-where-conditions.md b/docs/4.9/eloquent/complex-where-conditions.md index fa9ec88242..05635dedd9 100644 --- a/docs/4.9/eloquent/complex-where-conditions.md +++ b/docs/4.9/eloquent/complex-where-conditions.md @@ -106,7 +106,7 @@ want to re-use a list of allowed columns. Here's how your schema could look like ```graphql type Query { allPeople(where: _ @whereConditions(columnsEnum: "PersonColumn")): [Person!]! - @all + @all paginatedPeople( where: _ @whereConditions(columnsEnum: "PersonColumn") diff --git a/docs/4.9/security/authorization.md b/docs/4.9/security/authorization.md index f4509638b7..6813f4dd83 100644 --- a/docs/4.9/security/authorization.md +++ b/docs/4.9/security/authorization.md @@ -117,7 +117,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` diff --git a/docs/4.9/subscriptions/trigger-subscriptions.md b/docs/4.9/subscriptions/trigger-subscriptions.md index 0b20951ef4..164c26ffe4 100644 --- a/docs/4.9/subscriptions/trigger-subscriptions.md +++ b/docs/4.9/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/4.9/the-basics/directives.md b/docs/4.9/the-basics/directives.md index 2b47c981f9..d89c714414 100644 --- a/docs/4.9/the-basics/directives.md +++ b/docs/4.9/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Require authentication - @guard(with: "api") + # Resolve as a paginated list + @paginate + # Require authentication + @guard(with: "api") } ``` diff --git a/docs/master/api-reference/directives.md b/docs/master/api-reference/directives.md index 95237dd63d..f031b5d596 100644 --- a/docs/master/api-reference/directives.md +++ b/docs/master/api-reference/directives.md @@ -247,7 +247,7 @@ The `subscription` argument must reference the name of a subscription field. ```graphql type Mutation { createPost(input: CreatePostInput!): Post - @broadcast(subscription: "postCreated") + @broadcast(subscription: "postCreated") } ``` @@ -257,7 +257,7 @@ passing the `shouldQueue` argument. ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated", shouldQueue: false) + @broadcast(subscription: "postUpdated", shouldQueue: false) } ``` @@ -427,7 +427,7 @@ passing the `model` argument. ```graphql type Mutation { createBlogPost(input: PostInput): BlogPost - @can(ability: "create", model: "App\\Post") + @can(ability: "create", model: "App\\Post") } ``` @@ -462,7 +462,7 @@ You can provide your own function to calculate complexity. ```graphql type Query { posts: [Post!]! - @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") + @complexity(resolver: "App\\Security\\ComplexityAnalyzer@userPosts") } ``` @@ -646,7 +646,7 @@ This directive can also be used as a [nested arg resolver](../concepts/arg-resol ```graphql type Mutation { updateUser(id: Int, deleteTasks: [Int!]! @delete(relation: "tasks")): User - @update + @update } ``` @@ -657,7 +657,7 @@ possible model that can be deleted. ```graphql type Mutation { updateTask(id: Int, deleteUser: Boolean @delete(relation: "user")): Task - @update + @update } ``` @@ -715,7 +715,7 @@ If you pass only a class name, the method name defaults to `__invoke`. ```graphql type Mutation { createPost(title: String!): Post - @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") + @field(resolver: "App\\GraphQL\\Mutations\\PostMutator@create") } ``` @@ -735,7 +735,7 @@ such as transforming the value of scalar fields, e.g. reformat a date. ```graphql type User { created_at: String! - @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") + @field(resolver: "App\\GraphQL\\Types\\UserType@created_at") } ``` @@ -809,7 +809,7 @@ If your model does not sit in the default namespace, you can overwrite it. ```graphql type Query { userByFirstName(first_name: String! @eq): User - @first(model: "App\\Authentication\\User") + @first(model: "App\\Authentication\\User") } ``` @@ -924,7 +924,7 @@ For example, you might want to have an event when new orders are placed in a sho ```graphql type Mutation { placeOrder(items: [CartItems!]!): Order! - @event(dispatch: "App\\Events\\PlacedOrder") + @event(dispatch: "App\\Events\\PlacedOrder") } ``` @@ -1213,8 +1213,8 @@ automatically used for creating new models and cannot be manipulated. ```graphql type Mutation { createPost(title: String!, content: String!): Post - @create - @inject(context: "user.id", name: "user_id") + @create + @inject(context: "user.id", name: "user_id") } ``` @@ -1224,8 +1224,8 @@ set a nested argument. ```graphql type Mutation { createTask(input: CreateTaskInput!): Task - @create - @inject(context: "user.id", name: "input.user_id") + @create + @inject(context: "user.id", name: "input.user_id") } ``` @@ -1252,7 +1252,7 @@ Set the `resolveType` argument to a function that returns the implementing Objec ```graphql interface Commentable - @interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { +@interface(resolveType: "App\\GraphQL\\Interfaces\\Commentable@resolveType") { id: ID! } ``` @@ -1536,8 +1536,8 @@ to the [@field](#field) directive used on the `posts` field. ```graphql type Query { posts: [Post!]! - @field(resolver: "Post@resolveAll") - @namespace(field: "App\\Blog") + @field(resolver: "Post@resolveAll") + @namespace(field: "App\\Blog") } ``` @@ -1758,7 +1758,7 @@ Here's an example of how you could define it in your schema: type Query { allPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! @all paginatedPosts(orderBy: _ @orderBy(columnsEnum: "PostColumn")): [Post!]! - @paginate + @paginate } "A custom description for this custom enum." @@ -2178,7 +2178,7 @@ If your class is not in the default namespace, pass a fully qualified class name ```graphql scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` ## @scope @@ -2374,7 +2374,7 @@ you do not need this directive. It is only useful if you need to override the de ```graphql type Subscription { postUpdated(author: ID!): Post - @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") + @subscription(class: "App\\GraphQL\\Blog\\PostUpdatedSubscription") } ``` @@ -2532,7 +2532,7 @@ Client libraries such as Apollo base their caching mechanism on that assumption. ```graphql type Mutation { updatePost(id: ID! @rename(attribute: "post_id"), content: String): Post - @update + @update } ``` diff --git a/docs/master/api-reference/scalars.md b/docs/master/api-reference/scalars.md index 4e982ea314..1fed36d8a2 100644 --- a/docs/master/api-reference/scalars.md +++ b/docs/master/api-reference/scalars.md @@ -6,7 +6,7 @@ using [@scalar](directives.md#scalar) to point them to a FQCN. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") type Query { "Get the local server time." @@ -28,7 +28,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string with format `Y-m-d H:i:s`, e.g. `2018-05-23 13:43:32`." scalar DateTime - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -38,7 +38,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime and timezone string in ISO 8601 format `Y-m-dTH:i:sO`, e.g. `2020-04-20T13:53:12+02:00`." scalar DateTimeTz - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeTz") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeTz") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -48,7 +48,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "A datetime string in ISO 8601 format in UTC with nanoseconds `YYYY-MM-DDTHH:mm:ss.SSSSSSZ`, e.g. `2020-04-20T16:20:04.000000Z`." scalar DateTimeUtc - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeUtc") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTimeUtc") ``` Internally represented as an instance of `Carbon\Carbon`. @@ -60,7 +60,7 @@ Internally represented as an instance of `Carbon\Carbon`. ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` This Scalar can only be used as an argument, not as a return type. diff --git a/docs/master/custom-directives/argument-directives.md b/docs/master/custom-directives/argument-directives.md index 19e945e7b9..f2004caf60 100644 --- a/docs/master/custom-directives/argument-directives.md +++ b/docs/master/custom-directives/argument-directives.md @@ -202,7 +202,7 @@ Lighthouse's [@whereBetween](../api-reference/directives.md#wherebetween) is one ```graphql type Query { users(createdBetween: DateRange @whereBetween(key: "created_at")): [User!]! - @paginate + @paginate } input DateRange { diff --git a/docs/master/digging-deeper/file-uploads.md b/docs/master/digging-deeper/file-uploads.md index 923e411940..60ad237326 100644 --- a/docs/master/digging-deeper/file-uploads.md +++ b/docs/master/digging-deeper/file-uploads.md @@ -10,7 +10,7 @@ In order to accept file uploads, you must add the `Upload` scalar to your schema ```graphql "Can be used as an argument to upload files using https://github.com/jaydenseric/graphql-multipart-request-spec" scalar Upload - @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") +@scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Upload") ``` Once the scalar is added, you can add it to a mutation. diff --git a/docs/master/eloquent/complex-where-conditions.md b/docs/master/eloquent/complex-where-conditions.md index 3bcb749f6a..a4dde66d87 100644 --- a/docs/master/eloquent/complex-where-conditions.md +++ b/docs/master/eloquent/complex-where-conditions.md @@ -124,7 +124,7 @@ want to re-use a list of allowed columns. Here's how your schema could look like ```graphql type Query { allPeople(where: _ @whereConditions(columnsEnum: "PersonColumn")): [Person!]! - @all + @all paginatedPeople( where: _ @whereConditions(columnsEnum: "PersonColumn") diff --git a/docs/master/security/authorization.md b/docs/master/security/authorization.md index 8f262cec44..853ddd58c9 100644 --- a/docs/master/security/authorization.md +++ b/docs/master/security/authorization.md @@ -120,7 +120,7 @@ You can pass additional arguments to the policy checks by specifying them as `ar ```graphql type Mutation { createPost(input: PostInput): Post - @can(ability: "create", args: ["FROM_GRAPHQL"]) + @can(ability: "create", args: ["FROM_GRAPHQL"]) } ``` diff --git a/docs/master/subscriptions/trigger-subscriptions.md b/docs/master/subscriptions/trigger-subscriptions.md index 8c283056b2..1b6f89e7fa 100644 --- a/docs/master/subscriptions/trigger-subscriptions.md +++ b/docs/master/subscriptions/trigger-subscriptions.md @@ -11,7 +11,7 @@ directive will broadcast all updates to the `Post` model to the `postUpdated` su ```graphql type Mutation { updatePost(input: UpdatePostInput!): Post - @broadcast(subscription: "postUpdated") + @broadcast(subscription: "postUpdated") } ``` diff --git a/docs/master/the-basics/directives.md b/docs/master/the-basics/directives.md index 71311d47d0..e4ba3d930d 100644 --- a/docs/master/the-basics/directives.md +++ b/docs/master/the-basics/directives.md @@ -53,10 +53,10 @@ type Query { "Search by title" title: String @where(operator: "%LIKE%") ): [Post!]! - # Resolve as a paginated list - @paginate - # Require authentication - @guard(with: "api") + # Resolve as a paginated list + @paginate + # Require authentication + @guard(with: "api") } ``` From bb0c8b3bff824bee49ef80560a6a9fa384dc988f Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Wed, 26 Aug 2020 18:59:50 +0200 Subject: [PATCH 07/11] Add test using literal argument values --- .../Subscriptions/SubscriptionTest.php | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/Integration/Subscriptions/SubscriptionTest.php b/tests/Integration/Subscriptions/SubscriptionTest.php index 176c841492..bfa1198ddc 100644 --- a/tests/Integration/Subscriptions/SubscriptionTest.php +++ b/tests/Integration/Subscriptions/SubscriptionTest.php @@ -149,6 +149,33 @@ public function testWithFieldAlias(): void } public function testSubscriptionWithEnumInputCorrectlyResolves(): void + { + $this->graphQL(/** @lang GraphQL */ ' + subscription { + onPostUpdated(status: DELETED) { + body + } + } + '); + + $this->graphQL(/** @lang GraphQL */ ' + mutation { + updatePost(post: "Foobar") { + body + } + } + '); + + /** @var \Nuwave\Lighthouse\Subscriptions\Broadcasters\LogBroadcaster $log */ + $log = app(BroadcastManager::class)->driver(); + $this->assertCount(1, $log->broadcasts()); + + $broadcasted = Arr::get(Arr::first($log->broadcasts()), 'data', []); + $this->assertArrayHasKey('onPostUpdated', $broadcasted); + $this->assertSame(['body' => 'Foobar'], $broadcasted['onPostUpdated']); + } + + public function testSubscriptionWithEnumInputVariableCorrectlyResolves(): void { $this->postGraphQL([ 'query' => /** @lang GraphQL */ ' From b66e36bbdda14e06f2b4552a632e4838d7897a08 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Wed, 24 Jan 2024 17:58:29 +0100 Subject: [PATCH 08/11] fix merge, add what could be a fix --- src/Schema/Types/LaravelEnumType.php | 9 +++++++ .../Subscriptions/SubscriptionTest.php | 25 +++++++++++-------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/Schema/Types/LaravelEnumType.php b/src/Schema/Types/LaravelEnumType.php index 7f6ee7b6a2..2458f919e8 100644 --- a/src/Schema/Types/LaravelEnumType.php +++ b/src/Schema/Types/LaravelEnumType.php @@ -151,4 +151,13 @@ public function serialize($value): string return $key; } + + public function parseValue($value) + { + if ($value instanceof $this->enumClass) { + return $value; + } + + return parent::parseValue($value); + } } diff --git a/tests/Integration/Subscriptions/SubscriptionTest.php b/tests/Integration/Subscriptions/SubscriptionTest.php index 5f35cd75b3..d6e0874fba 100644 --- a/tests/Integration/Subscriptions/SubscriptionTest.php +++ b/tests/Integration/Subscriptions/SubscriptionTest.php @@ -55,7 +55,7 @@ enum PostStatus { @broadcast(subscription: "onPostCreated") updatePost(post: String!): Post - @field(resolver: "{$this->qualifyTestResolver()}") + @mock @broadcast(subscription: "onPostUpdated") } @@ -67,7 +67,7 @@ enum PostStatus { public function testSendsSubscriptionChannelInResponse(): void { - $response = $this->subscribeToOnPostCreatedSubscription(); + $response = $this->subscribe(); $cache = $this->app->make(CacheStorageManager::class); @@ -121,7 +121,7 @@ public function testSendsSubscriptionChannelInBatchedResponse(): void public function testBroadcastSubscriptions(): void { - $this->subscribeToOnPostCreatedSubscription(); + $this->subscribe(); $this->graphQL(/** @lang GraphQL */ ' mutation { createPost(title: "Foobar") { @@ -131,7 +131,6 @@ public function testBroadcastSubscriptions(): void '); $broadcastManager = $this->app->make(BroadcastManager::class); - $log = $broadcastManager->driver(); assert($log instanceof LogBroadcaster); @@ -220,8 +219,10 @@ public function testSubscriptionWithEnumInputCorrectlyResolves(): void } '); - /** @var \Nuwave\Lighthouse\Subscriptions\Broadcasters\LogBroadcaster $log */ - $log = app(BroadcastManager::class)->driver(); + $broadcastManager = $this->app->make(BroadcastManager::class); + $log = $broadcastManager->driver(); + assert($log instanceof LogBroadcaster); + $this->assertCount(1, $log->broadcasts()); $broadcasted = Arr::get(Arr::first($log->broadcasts()), 'data', []); @@ -253,8 +254,10 @@ public function testSubscriptionWithEnumInputVariableCorrectlyResolves(): void } '); - /** @var \Nuwave\Lighthouse\Subscriptions\Broadcasters\LogBroadcaster $log */ - $log = app(BroadcastManager::class)->driver(); + $broadcastManager = $this->app->make(BroadcastManager::class); + $log = $broadcastManager->driver(); + assert($log instanceof LogBroadcaster); + $this->assertCount(1, $log->broadcasts()); $broadcasted = Arr::get(Arr::first($log->broadcasts()), 'data', []); @@ -296,8 +299,10 @@ public function testSubscriptionWithEnumInputCorrectlyResolvesUsingBatchedQuery( } '); - /** @var \Nuwave\Lighthouse\Subscriptions\Broadcasters\LogBroadcaster $log */ - $log = app(BroadcastManager::class)->driver(); + $broadcastManager = $this->app->make(BroadcastManager::class); + $log = $broadcastManager->driver(); + assert($log instanceof LogBroadcaster); + $this->assertCount(1, $log->broadcasts()); $broadcasted = Arr::get(Arr::first($log->broadcasts()), 'data', []); From b0d4cabbaf0b281a1f26330a1dee6ee90c7cb55c Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Wed, 24 Jan 2024 17:59:46 +0100 Subject: [PATCH 09/11] use variable --- tests/Integration/Subscriptions/SubscriptionTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Integration/Subscriptions/SubscriptionTest.php b/tests/Integration/Subscriptions/SubscriptionTest.php index d6e0874fba..5c343ecc45 100644 --- a/tests/Integration/Subscriptions/SubscriptionTest.php +++ b/tests/Integration/Subscriptions/SubscriptionTest.php @@ -471,11 +471,11 @@ protected function subscribe(): TestResponse * * @return array> */ - protected function buildResponse(string $channelName, string $channel): array + protected function buildResponse(string $fieldName, string $channel): array { return [ 'data' => [ - 'onPostCreated' => null, + $fieldName => null, ], 'extensions' => [ 'lighthouse_subscriptions' => [ From 5249df82430528958474b76eadf1e6dba1723e35 Mon Sep 17 00:00:00 2001 From: spawnia Date: Wed, 24 Jan 2024 17:01:29 +0000 Subject: [PATCH 10/11] Apply proto changes --- .../Proto/ContextualizedQueryLatencyStats.php | 12 +++--- .../Proto/ContextualizedStats.php | 15 +++---- .../Proto/ContextualizedTypeStats.php | 9 +++-- .../FederatedTracing/Proto/FieldStat.php | 5 ++- .../FederatedTracing/Proto/PathErrorStats.php | 3 +- .../Proto/QueryLatencyStats.php | 17 ++++---- .../Proto/ReferencedFieldsForType.php | 3 +- src/Tracing/FederatedTracing/Proto/Report.php | 11 ++--- src/Tracing/FederatedTracing/Proto/Trace.php | 40 +++++++++---------- .../FederatedTracing/Proto/Trace/Details.php | 3 +- .../FederatedTracing/Proto/Trace/Error.php | 3 +- .../FederatedTracing/Proto/Trace/HTTP.php | 5 ++- .../Proto/Trace/HTTP/Values.php | 3 +- .../FederatedTracing/Proto/Trace/Node.php | 11 ++--- .../Proto/Trace/QueryPlanNode.php | 36 ++++++++--------- .../Proto/Trace/QueryPlanNode/DeferNode.php | 9 +++-- .../Trace/QueryPlanNode/DeferredNode.php | 5 ++- .../Proto/Trace/QueryPlanNode/FetchNode.php | 6 +-- .../Proto/Trace/QueryPlanNode/FlattenNode.php | 3 +- .../Trace/QueryPlanNode/ParallelNode.php | 3 +- .../Trace/QueryPlanNode/SequenceNode.php | 3 +- .../FederatedTracing/Proto/TracesAndStats.php | 15 +++---- .../FederatedTracing/Proto/TypeStat.php | 3 +- 23 files changed, 121 insertions(+), 102 deletions(-) diff --git a/src/Tracing/FederatedTracing/Proto/ContextualizedQueryLatencyStats.php b/src/Tracing/FederatedTracing/Proto/ContextualizedQueryLatencyStats.php index 245301a968..d3cdb9263e 100644 --- a/src/Tracing/FederatedTracing/Proto/ContextualizedQueryLatencyStats.php +++ b/src/Tracing/FederatedTracing/Proto/ContextualizedQueryLatencyStats.php @@ -23,8 +23,8 @@ class ContextualizedQueryLatencyStats extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var QueryLatencyStats $query_latency_stats - * @var StatsContext $context + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryLatencyStats $query_latency_stats + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext $context * } */ public function __construct($data = null) @@ -36,7 +36,7 @@ public function __construct($data = null) /** * Generated from protobuf field .QueryLatencyStats query_latency_stats = 1 [json_name = "queryLatencyStats"];. * - * @return QueryLatencyStats|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryLatencyStats|null */ public function getQueryLatencyStats() { @@ -56,7 +56,7 @@ public function clearQueryLatencyStats() /** * Generated from protobuf field .QueryLatencyStats query_latency_stats = 1 [json_name = "queryLatencyStats"];. * - * @param QueryLatencyStats $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryLatencyStats $var * * @return $this */ @@ -71,7 +71,7 @@ public function setQueryLatencyStats($var) /** * Generated from protobuf field .StatsContext context = 2 [json_name = "context"];. * - * @return StatsContext|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext|null */ public function getContext() { @@ -91,7 +91,7 @@ public function clearContext() /** * Generated from protobuf field .StatsContext context = 2 [json_name = "context"];. * - * @param StatsContext $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext $var * * @return $this */ diff --git a/src/Tracing/FederatedTracing/Proto/ContextualizedStats.php b/src/Tracing/FederatedTracing/Proto/ContextualizedStats.php index a29e2c8b9c..260fdbbcdc 100644 --- a/src/Tracing/FederatedTracing/Proto/ContextualizedStats.php +++ b/src/Tracing/FederatedTracing/Proto/ContextualizedStats.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -31,8 +32,8 @@ class ContextualizedStats extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var StatsContext $context - * @var QueryLatencyStats $query_latency_stats + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext $context + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryLatencyStats $query_latency_stats * @var array|\Google\Protobuf\Internal\MapField $per_type_stat * Key is type name. This structure provides data for the count and latency of individual * field executions and thus only reflects operations for which field-level tracing occurred. @@ -47,7 +48,7 @@ public function __construct($data = null) /** * Generated from protobuf field .StatsContext context = 1 [json_name = "context"];. * - * @return StatsContext|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext|null */ public function getContext() { @@ -67,7 +68,7 @@ public function clearContext() /** * Generated from protobuf field .StatsContext context = 1 [json_name = "context"];. * - * @param StatsContext $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext $var * * @return $this */ @@ -82,7 +83,7 @@ public function setContext($var) /** * Generated from protobuf field .QueryLatencyStats query_latency_stats = 2 [json_name = "queryLatencyStats"];. * - * @return QueryLatencyStats|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryLatencyStats|null */ public function getQueryLatencyStats() { @@ -102,7 +103,7 @@ public function clearQueryLatencyStats() /** * Generated from protobuf field .QueryLatencyStats query_latency_stats = 2 [json_name = "queryLatencyStats"];. * - * @param QueryLatencyStats $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryLatencyStats $var * * @return $this */ @@ -139,7 +140,7 @@ public function getPerTypeStat() */ public function setPerTypeStat($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, TypeStat::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, TypeStat::class); $this->per_type_stat = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/ContextualizedTypeStats.php b/src/Tracing/FederatedTracing/Proto/ContextualizedTypeStats.php index 4c6df35781..68e2306020 100644 --- a/src/Tracing/FederatedTracing/Proto/ContextualizedTypeStats.php +++ b/src/Tracing/FederatedTracing/Proto/ContextualizedTypeStats.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -23,7 +24,7 @@ class ContextualizedTypeStats extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var StatsContext $context + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext $context * @var array|\Google\Protobuf\Internal\MapField $per_type_stat * } */ @@ -36,7 +37,7 @@ public function __construct($data = null) /** * Generated from protobuf field .StatsContext context = 1 [json_name = "context"];. * - * @return StatsContext|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext|null */ public function getContext() { @@ -56,7 +57,7 @@ public function clearContext() /** * Generated from protobuf field .StatsContext context = 1 [json_name = "context"];. * - * @param StatsContext $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\StatsContext $var * * @return $this */ @@ -87,7 +88,7 @@ public function getPerTypeStat() */ public function setPerTypeStat($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, TypeStat::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, TypeStat::class); $this->per_type_stat = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/FieldStat.php b/src/Tracing/FederatedTracing/Proto/FieldStat.php index 42c091bc74..e189b9c251 100644 --- a/src/Tracing/FederatedTracing/Proto/FieldStat.php +++ b/src/Tracing/FederatedTracing/Proto/FieldStat.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -89,7 +90,7 @@ class FieldStat extends \Google\Protobuf\Internal\Message * field_execution_weight). * @var int|string $observed_execution_count * Number of times that the resolver for this field is directly observed being - * executed + * executed. * @var int|string $estimated_execution_count * Same as `observed_execution_count` but potentially scaled upwards if the server was only * performing field-level instrumentation on a sampling of operations. For @@ -327,7 +328,7 @@ public function getLatencyCount() */ public function setLatencyCount($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::SINT64); + $arr = GPBUtil::checkRepeatedField($var, GPBType::SINT64); $this->latency_count = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/PathErrorStats.php b/src/Tracing/FederatedTracing/Proto/PathErrorStats.php index 59d6b95983..71de5d9814 100644 --- a/src/Tracing/FederatedTracing/Proto/PathErrorStats.php +++ b/src/Tracing/FederatedTracing/Proto/PathErrorStats.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -56,7 +57,7 @@ public function getChildren() */ public function setChildren($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, PathErrorStats::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, PathErrorStats::class); $this->children = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/QueryLatencyStats.php b/src/Tracing/FederatedTracing/Proto/QueryLatencyStats.php index a2f5223706..7fb49e3c03 100644 --- a/src/Tracing/FederatedTracing/Proto/QueryLatencyStats.php +++ b/src/Tracing/FederatedTracing/Proto/QueryLatencyStats.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -106,8 +107,8 @@ class QueryLatencyStats extends \Google\Protobuf\Internal\Message * @var int|string $persisted_query_misses * @var array|array|\Google\Protobuf\Internal\RepeatedField $cache_latency_count * This array includes the latency buckets for all operations included in cache_hits - * See comment on latency_count for details - * @var PathErrorStats $root_error_stats + * See comment on latency_count for details. + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\PathErrorStats $root_error_stats * Paths and counts for each error. The total number of requests with errors within this object should be the same as * requests_with_errors_count below. * @var int|string $requests_with_errors_count @@ -159,7 +160,7 @@ public function getLatencyCount() */ public function setLatencyCount($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::SINT64); + $arr = GPBUtil::checkRepeatedField($var, GPBType::SINT64); $this->latency_count = $arr; return $this; @@ -298,7 +299,7 @@ public function getCacheLatencyCount() */ public function setCacheLatencyCount($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::SINT64); + $arr = GPBUtil::checkRepeatedField($var, GPBType::SINT64); $this->cache_latency_count = $arr; return $this; @@ -310,7 +311,7 @@ public function setCacheLatencyCount($var) * * Generated from protobuf field .PathErrorStats root_error_stats = 7 [json_name = "rootErrorStats"]; * - * @return PathErrorStats|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\PathErrorStats|null */ public function getRootErrorStats() { @@ -333,7 +334,7 @@ public function clearRootErrorStats() * * Generated from protobuf field .PathErrorStats root_error_stats = 7 [json_name = "rootErrorStats"]; * - * @param PathErrorStats $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\PathErrorStats $var * * @return $this */ @@ -393,7 +394,7 @@ public function getPublicCacheTtlCount() */ public function setPublicCacheTtlCount($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::SINT64); + $arr = GPBUtil::checkRepeatedField($var, GPBType::SINT64); $this->public_cache_ttl_count = $arr; return $this; @@ -418,7 +419,7 @@ public function getPrivateCacheTtlCount() */ public function setPrivateCacheTtlCount($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::SINT64); + $arr = GPBUtil::checkRepeatedField($var, GPBType::SINT64); $this->private_cache_ttl_count = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/ReferencedFieldsForType.php b/src/Tracing/FederatedTracing/Proto/ReferencedFieldsForType.php index 21cfe1f6f6..5c52f4d118 100644 --- a/src/Tracing/FederatedTracing/Proto/ReferencedFieldsForType.php +++ b/src/Tracing/FederatedTracing/Proto/ReferencedFieldsForType.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -66,7 +67,7 @@ public function getFieldNames() */ public function setFieldNames($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $arr = GPBUtil::checkRepeatedField($var, GPBType::STRING); $this->field_names = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Report.php b/src/Tracing/FederatedTracing/Proto/Report.php index da81b96e01..8c79ee8cd3 100644 --- a/src/Tracing/FederatedTracing/Proto/Report.php +++ b/src/Tracing/FederatedTracing/Proto/Report.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -76,7 +77,7 @@ class Report extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var ReportHeader $header + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\ReportHeader $header * @var array|\Google\Protobuf\Internal\MapField $traces_per_query * If QueryMetadata isn't provided, this key should be a statsReportKey (# operationName\nsignature). If the operation * name, signature, and persisted query IDs are provided in the QueryMetadata, and this operation was requested via a @@ -110,7 +111,7 @@ public function __construct($data = null) /** * Generated from protobuf field .ReportHeader header = 1 [json_name = "header"];. * - * @return ReportHeader|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\ReportHeader|null */ public function getHeader() { @@ -130,7 +131,7 @@ public function clearHeader() /** * Generated from protobuf field .ReportHeader header = 1 [json_name = "header"];. * - * @param ReportHeader $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\ReportHeader $var * * @return $this */ @@ -169,7 +170,7 @@ public function getTracesPerQuery() */ public function setTracesPerQuery($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, TracesAndStats::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, TracesAndStats::class); $this->traces_per_query = $arr; return $this; @@ -278,7 +279,7 @@ public function getOperationCountByType() */ public function setOperationCountByType($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, Report\OperationCountByType::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, Report\OperationCountByType::class); $this->operation_count_by_type = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace.php b/src/Tracing/FederatedTracing/Proto/Trace.php index 79f98bc6fb..3af1446ad7 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace.php +++ b/src/Tracing/FederatedTracing/Proto/Trace.php @@ -170,15 +170,15 @@ class Trace extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @var \Google\Protobuf\Timestamp $start_time - * Wallclock time when the trace began + * Wallclock time when the trace began. * @var \Google\Protobuf\Timestamp $end_time - * Wallclock time when the trace ended + * Wallclock time when the trace ended. * @var int|string $duration_ns * High precision duration of the trace; may not equal end_time-start_time - * (eg, if your machine's clock changed during the trace) - * @var Trace\Node $root + * (eg, if your machine's clock changed during the trace). + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\Node $root * A tree containing information about all resolvers run directly by this - * service, including errors + * service, including errors. * @var bool $is_incomplete * If this is true, the trace is potentially missing some nodes that were * present on the query plan. This can happen if the trace span buffer used @@ -201,16 +201,16 @@ class Trace extends \Google\Protobuf\Internal\Message * @var string $unexecutedOperationBody * Optional: when GraphQL parsing or validation against the GraphQL schema fails, these fields * can include reference to the operation being sent for users to dig into the set of operations - * that are failing validation + * that are failing validation. * @var string $unexecutedOperationName - * @var Trace\Details $details + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\Details $details * @var string $client_name * @var string $client_version * @var string $operation_type * @var string $operation_subtype - * @var Trace\HTTP $http - * @var Trace\CachePolicy $cache_policy - * @var Trace\QueryPlanNode $query_plan + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\HTTP $http + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\CachePolicy $cache_policy + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode $query_plan * If this Trace was created by a Router/Gateway, this is the query plan, including * sub-Traces for subgraphs. Note that the 'root' tree on the * top-level Trace won't contain any resolvers (though it could contain errors @@ -358,7 +358,7 @@ public function setDurationNs($var) * * Generated from protobuf field .Trace.Node root = 14 [json_name = "root"]; * - * @return Trace\Node|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\Node|null */ public function getRoot() { @@ -381,7 +381,7 @@ public function clearRoot() * * Generated from protobuf field .Trace.Node root = 14 [json_name = "root"]; * - * @param Trace\Node $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\Node $var * * @return $this */ @@ -542,7 +542,7 @@ public function setUnexecutedOperationName($var) /** * Generated from protobuf field .Trace.Details details = 6 [json_name = "details"];. * - * @return Trace\Details|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\Details|null */ public function getDetails() { @@ -562,7 +562,7 @@ public function clearDetails() /** * Generated from protobuf field .Trace.Details details = 6 [json_name = "details"];. * - * @param Trace\Details $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\Details $var * * @return $this */ @@ -677,7 +677,7 @@ public function setOperationSubtype($var) /** * Generated from protobuf field .Trace.HTTP http = 10 [json_name = "http"];. * - * @return Trace\HTTP|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\HTTP|null */ public function getHttp() { @@ -697,7 +697,7 @@ public function clearHttp() /** * Generated from protobuf field .Trace.HTTP http = 10 [json_name = "http"];. * - * @param Trace\HTTP $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\HTTP $var * * @return $this */ @@ -712,7 +712,7 @@ public function setHttp($var) /** * Generated from protobuf field .Trace.CachePolicy cache_policy = 18 [json_name = "cachePolicy"];. * - * @return Trace\CachePolicy|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\CachePolicy|null */ public function getCachePolicy() { @@ -732,7 +732,7 @@ public function clearCachePolicy() /** * Generated from protobuf field .Trace.CachePolicy cache_policy = 18 [json_name = "cachePolicy"];. * - * @param Trace\CachePolicy $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\CachePolicy $var * * @return $this */ @@ -752,7 +752,7 @@ public function setCachePolicy($var) * * Generated from protobuf field .Trace.QueryPlanNode query_plan = 26 [json_name = "queryPlan"]; * - * @return Trace\QueryPlanNode|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode|null */ public function getQueryPlan() { @@ -777,7 +777,7 @@ public function clearQueryPlan() * * Generated from protobuf field .Trace.QueryPlanNode query_plan = 26 [json_name = "queryPlan"]; * - * @param Trace\QueryPlanNode $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode $var * * @return $this */ diff --git a/src/Tracing/FederatedTracing/Proto/Trace/Details.php b/src/Tracing/FederatedTracing/Proto/Trace/Details.php index 17f52859ec..29b7dfd763 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/Details.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/Details.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -82,7 +83,7 @@ public function getVariablesJson() */ public function setVariablesJson($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::STRING); $this->variables_json = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/Error.php b/src/Tracing/FederatedTracing/Proto/Trace/Error.php index 99506dd0f0..d837dca589 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/Error.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/Error.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -94,7 +95,7 @@ public function getLocation() */ public function setLocation($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, Location::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, Location::class); $this->location = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/HTTP.php b/src/Tracing/FederatedTracing/Proto/Trace/HTTP.php index 20e070bc50..81aa241954 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/HTTP.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/HTTP.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -94,7 +95,7 @@ public function getRequestHeaders() */ public function setRequestHeaders($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, HTTP\Values::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, HTTP\Values::class); $this->request_headers = $arr; return $this; @@ -119,7 +120,7 @@ public function getResponseHeaders() */ public function setResponseHeaders($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, HTTP\Values::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, HTTP\Values::class); $this->response_headers = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/HTTP/Values.php b/src/Tracing/FederatedTracing/Proto/Trace/HTTP/Values.php index bfef7f64fa..13a41ff44f 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/HTTP/Values.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/HTTP/Values.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\HTTP; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -48,7 +49,7 @@ public function getValue() */ public function setValue($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $arr = GPBUtil::checkRepeatedField($var, GPBType::STRING); $this->value = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/Node.php b/src/Tracing/FederatedTracing/Proto/Trace/Node.php index 1b065ecbfe..c8e93bc5bf 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/Node.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/Node.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -72,7 +73,7 @@ class Node extends \Google\Protobuf\Internal\Message * The field's return type; e.g. "String!" for User.email:String! * @var string $parent_type * The field's parent type; e.g. "User" for User.email:String! - * @var CachePolicy $cache_policy + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\CachePolicy $cache_policy * @var int|string $start_time * relative to the trace's start_time, in ns * @var int|string $end_time @@ -233,7 +234,7 @@ public function setParentType($var) /** * Generated from protobuf field .Trace.CachePolicy cache_policy = 5 [json_name = "cachePolicy"];. * - * @return CachePolicy|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\CachePolicy|null */ public function getCachePolicy() { @@ -253,7 +254,7 @@ public function clearCachePolicy() /** * Generated from protobuf field .Trace.CachePolicy cache_policy = 5 [json_name = "cachePolicy"];. * - * @param CachePolicy $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\CachePolicy $var * * @return $this */ @@ -342,7 +343,7 @@ public function getError() */ public function setError($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, Error::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, Error::class); $this->error = $arr; return $this; @@ -367,7 +368,7 @@ public function getChild() */ public function setChild($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, Node::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, Node::class); $this->child = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode.php b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode.php index 43a5407c4c..6fa1ad23d2 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode.php @@ -24,12 +24,12 @@ class QueryPlanNode extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var QueryPlanNode\SequenceNode $sequence - * @var QueryPlanNode\ParallelNode $parallel - * @var QueryPlanNode\FetchNode $fetch - * @var QueryPlanNode\FlattenNode $flatten - * @var QueryPlanNode\DeferNode $defer - * @var QueryPlanNode\ConditionNode $condition + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\SequenceNode $sequence + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\ParallelNode $parallel + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\FetchNode $fetch + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\FlattenNode $flatten + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\DeferNode $defer + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\ConditionNode $condition * } */ public function __construct($data = null) @@ -41,7 +41,7 @@ public function __construct($data = null) /** * Generated from protobuf field .Trace.QueryPlanNode.SequenceNode sequence = 1 [json_name = "sequence"];. * - * @return QueryPlanNode\SequenceNode|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\SequenceNode|null */ public function getSequence() { @@ -56,7 +56,7 @@ public function hasSequence() /** * Generated from protobuf field .Trace.QueryPlanNode.SequenceNode sequence = 1 [json_name = "sequence"];. * - * @param QueryPlanNode\SequenceNode $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\SequenceNode $var * * @return $this */ @@ -71,7 +71,7 @@ public function setSequence($var) /** * Generated from protobuf field .Trace.QueryPlanNode.ParallelNode parallel = 2 [json_name = "parallel"];. * - * @return QueryPlanNode\ParallelNode|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\ParallelNode|null */ public function getParallel() { @@ -86,7 +86,7 @@ public function hasParallel() /** * Generated from protobuf field .Trace.QueryPlanNode.ParallelNode parallel = 2 [json_name = "parallel"];. * - * @param QueryPlanNode\ParallelNode $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\ParallelNode $var * * @return $this */ @@ -101,7 +101,7 @@ public function setParallel($var) /** * Generated from protobuf field .Trace.QueryPlanNode.FetchNode fetch = 3 [json_name = "fetch"];. * - * @return QueryPlanNode\FetchNode|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\FetchNode|null */ public function getFetch() { @@ -116,7 +116,7 @@ public function hasFetch() /** * Generated from protobuf field .Trace.QueryPlanNode.FetchNode fetch = 3 [json_name = "fetch"];. * - * @param QueryPlanNode\FetchNode $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\FetchNode $var * * @return $this */ @@ -131,7 +131,7 @@ public function setFetch($var) /** * Generated from protobuf field .Trace.QueryPlanNode.FlattenNode flatten = 4 [json_name = "flatten"];. * - * @return QueryPlanNode\FlattenNode|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\FlattenNode|null */ public function getFlatten() { @@ -146,7 +146,7 @@ public function hasFlatten() /** * Generated from protobuf field .Trace.QueryPlanNode.FlattenNode flatten = 4 [json_name = "flatten"];. * - * @param QueryPlanNode\FlattenNode $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\FlattenNode $var * * @return $this */ @@ -161,7 +161,7 @@ public function setFlatten($var) /** * Generated from protobuf field .Trace.QueryPlanNode.DeferNode defer = 5 [json_name = "defer"];. * - * @return QueryPlanNode\DeferNode|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\DeferNode|null */ public function getDefer() { @@ -176,7 +176,7 @@ public function hasDefer() /** * Generated from protobuf field .Trace.QueryPlanNode.DeferNode defer = 5 [json_name = "defer"];. * - * @param QueryPlanNode\DeferNode $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\DeferNode $var * * @return $this */ @@ -191,7 +191,7 @@ public function setDefer($var) /** * Generated from protobuf field .Trace.QueryPlanNode.ConditionNode condition = 6 [json_name = "condition"];. * - * @return QueryPlanNode\ConditionNode|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\ConditionNode|null */ public function getCondition() { @@ -206,7 +206,7 @@ public function hasCondition() /** * Generated from protobuf field .Trace.QueryPlanNode.ConditionNode condition = 6 [json_name = "condition"];. * - * @param QueryPlanNode\ConditionNode $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\ConditionNode $var * * @return $this */ diff --git a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferNode.php b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferNode.php index 6f98d789d2..82e29563d6 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferNode.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferNode.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -25,7 +26,7 @@ class DeferNode extends \Google\Protobuf\Internal\Message * @param array $data { * Optional. Data for populating the Message object. * - * @var DeferNodePrimary $primary + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\DeferNodePrimary $primary * @var array<\Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\DeferredNode>|\Google\Protobuf\Internal\RepeatedField $deferred * } */ @@ -38,7 +39,7 @@ public function __construct($data = null) /** * Generated from protobuf field .Trace.QueryPlanNode.DeferNodePrimary primary = 1 [json_name = "primary"];. * - * @return DeferNodePrimary|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\DeferNodePrimary|null */ public function getPrimary() { @@ -58,7 +59,7 @@ public function clearPrimary() /** * Generated from protobuf field .Trace.QueryPlanNode.DeferNodePrimary primary = 1 [json_name = "primary"];. * - * @param DeferNodePrimary $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode\DeferNodePrimary $var * * @return $this */ @@ -89,7 +90,7 @@ public function getDeferred() */ public function setDeferred($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, DeferredNode::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, DeferredNode::class); $this->deferred = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferredNode.php b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferredNode.php index c91849ea08..464bab61f6 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferredNode.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/DeferredNode.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -60,7 +61,7 @@ public function getDepends() */ public function setDepends($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, DeferredNodeDepends::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, DeferredNodeDepends::class); $this->depends = $arr; return $this; @@ -110,7 +111,7 @@ public function getPath() */ public function setPath($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, ResponsePathElement::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, ResponsePathElement::class); $this->path = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/FetchNode.php b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/FetchNode.php index edc48c8653..f1a4a029fa 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/FetchNode.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/FetchNode.php @@ -66,12 +66,12 @@ class FetchNode extends \Google\Protobuf\Internal\Message * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace $trace * This Trace only contains start_time, end_time, duration_ns, and root; * all timings were calculated **on the subgraph**, and clock skew - * will be handled by the ingress server + * will be handled by the ingress server. * @var int|string $sent_time_offset - * relative to the outer trace's start_time, in ns, measured in the Router/Gateway + * relative to the outer trace's start_time, in ns, measured in the Router/Gateway. * @var \Google\Protobuf\Timestamp $sent_time * Wallclock times measured in the Router/Gateway for when this operation was - * sent and received + * sent and received. * @var \Google\Protobuf\Timestamp $received_time * } */ diff --git a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/FlattenNode.php b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/FlattenNode.php index 827b72c8f1..5cf9373d10 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/FlattenNode.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/FlattenNode.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -55,7 +56,7 @@ public function getResponsePath() */ public function setResponsePath($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, ResponsePathElement::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, ResponsePathElement::class); $this->response_path = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/ParallelNode.php b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/ParallelNode.php index 6940b590ba..472cad00d5 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/ParallelNode.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/ParallelNode.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -50,7 +51,7 @@ public function getNodes() */ public function setNodes($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode::class); $this->nodes = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/SequenceNode.php b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/SequenceNode.php index 8cd7208216..f5d30ff5ca 100644 --- a/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/SequenceNode.php +++ b/src/Tracing/FederatedTracing/Proto/Trace/QueryPlanNode/SequenceNode.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -50,7 +51,7 @@ public function getNodes() */ public function setNodes($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\Trace\QueryPlanNode::class); $this->nodes = $arr; return $this; diff --git a/src/Tracing/FederatedTracing/Proto/TracesAndStats.php b/src/Tracing/FederatedTracing/Proto/TracesAndStats.php index 9f6a4eb100..f4c4c26e82 100644 --- a/src/Tracing/FederatedTracing/Proto/TracesAndStats.php +++ b/src/Tracing/FederatedTracing/Proto/TracesAndStats.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -71,7 +72,7 @@ class TracesAndStats extends \Google\Protobuf\Internal\Message * This field is used to validate that the algorithm used to construct `stats_with_context` * matches similar algorithms in Apollo's servers. It is otherwise ignored and should not * be included in reports. - * @var QueryMetadata $query_metadata + * @var \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryMetadata $query_metadata * This is an optional field that is used to provide more context to the key of this object within the * traces_per_query map. If it's omitted, we assume the key is a standard operation name and signature key. * } @@ -101,7 +102,7 @@ public function getTrace() */ public function setTrace($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, Trace::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, Trace::class); $this->trace = $arr; return $this; @@ -126,7 +127,7 @@ public function getStatsWithContext() */ public function setStatsWithContext($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, ContextualizedStats::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, ContextualizedStats::class); $this->stats_with_context = $arr; return $this; @@ -165,7 +166,7 @@ public function getReferencedFieldsByType() */ public function setReferencedFieldsByType($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, ReferencedFieldsForType::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, ReferencedFieldsForType::class); $this->referenced_fields_by_type = $arr; return $this; @@ -198,7 +199,7 @@ public function getInternalTracesContributingToStats() */ public function setInternalTracesContributingToStats($var) { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, Trace::class); + $arr = GPBUtil::checkRepeatedField($var, GPBType::MESSAGE, Trace::class); $this->internal_traces_contributing_to_stats = $arr; return $this; @@ -210,7 +211,7 @@ public function setInternalTracesContributingToStats($var) * * Generated from protobuf field .QueryMetadata query_metadata = 5 [json_name = "queryMetadata"]; * - * @return QueryMetadata|null + * @return \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryMetadata|null */ public function getQueryMetadata() { @@ -233,7 +234,7 @@ public function clearQueryMetadata() * * Generated from protobuf field .QueryMetadata query_metadata = 5 [json_name = "queryMetadata"]; * - * @param QueryMetadata $var + * @param \Nuwave\Lighthouse\Tracing\FederatedTracing\Proto\QueryMetadata $var * * @return $this */ diff --git a/src/Tracing/FederatedTracing/Proto/TypeStat.php b/src/Tracing/FederatedTracing/Proto/TypeStat.php index 052c751faf..22bdafa2ba 100644 --- a/src/Tracing/FederatedTracing/Proto/TypeStat.php +++ b/src/Tracing/FederatedTracing/Proto/TypeStat.php @@ -4,6 +4,7 @@ namespace Nuwave\Lighthouse\Tracing\FederatedTracing\Proto; +use Google\Protobuf\Internal\GPBType; use Google\Protobuf\Internal\GPBUtil; /** @@ -57,7 +58,7 @@ public function getPerFieldStat() */ public function setPerFieldStat($var) { - $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, FieldStat::class); + $arr = GPBUtil::checkMapField($var, GPBType::STRING, GPBType::MESSAGE, FieldStat::class); $this->per_field_stat = $arr; return $this; From 9cc782f40159ed903f5082b1a7b02c5134915927 Mon Sep 17 00:00:00 2001 From: spawnia Date: Wed, 24 Jan 2024 17:01:40 +0000 Subject: [PATCH 11/11] Apply php-cs-fixer changes --- src/Schema/AST/ASTBuilder.php | 4 ++-- tests/Utils/Subscriptions/OnPostUpdated.php | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Schema/AST/ASTBuilder.php b/src/Schema/AST/ASTBuilder.php index 0aa6bf53b8..61bde930f4 100644 --- a/src/Schema/AST/ASTBuilder.php +++ b/src/Schema/AST/ASTBuilder.php @@ -243,8 +243,8 @@ protected function applyArgManipulators(): void } } } - } - + } + /** Apply directives on input fields that can manipulate the AST. */ protected function applyInputFieldManipulators(): void { diff --git a/tests/Utils/Subscriptions/OnPostUpdated.php b/tests/Utils/Subscriptions/OnPostUpdated.php index a7e19ba8ba..f7497a5e59 100644 --- a/tests/Utils/Subscriptions/OnPostUpdated.php +++ b/tests/Utils/Subscriptions/OnPostUpdated.php @@ -1,4 +1,4 @@ -