-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema-directives.graphql
1129 lines (993 loc) · 32.5 KB
/
schema-directives.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# File generated by "php artisan lighthouse:ide-helper".
# Do not edit this file directly.
# This file should be ignored by git as it can be autogenerated.
# Directive class: App\Lib\GraphQL\Directives\FieldAccessDirective
# Add a proper definition by implementing Nuwave\Lighthouse\Support\Contracts\DefinedDirective
directive @fieldAccess
# Directive class: App\Lib\GraphQL\Directives\MetadataDirective
# Add a proper definition by implementing Nuwave\Lighthouse\Support\Contracts\DefinedDirective
directive @metadata
# Directive class: Nuwave\Lighthouse\SoftDeletes\ForceDeleteDirective
"""
Permanently remove one or more soft deleted models by their ID.
The field must have a single non-null argument that may be a list.
"""
directive @forceDelete(
"""
Set to `true` to use global ids for finding the model.
If set to `false`, regular non-global ids are used.
"""
globalId: Boolean = false
"""
Specify the class name of the model to use.
This is only needed when the default model detection does not work.
"""
model: String
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\SoftDeletes\RestoreDirective
"""
Un-delete one or more soft deleted models by their ID.
The field must have a single non-null argument that may be a list.
"""
directive @restore(
"""
Set to `true` to use global ids for finding the model.
If set to `false`, regular non-global ids are used.
"""
globalId: Boolean = false
"""
Specify the class name of the model to use.
This is only needed when the default model detection does not work.
"""
model: String
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\SoftDeletes\SoftDeletesDirective
"""
Allows to filter if trashed elements should be fetched.
This manipulates the schema by adding the argument
`trashed: Trashed @trashed` to the field.
"""
directive @softDeletes on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\SoftDeletes\TrashedDirective
"""
Allows to filter if trashed elements should be fetched.
"""
directive @trashed on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\OrderBy\OrderByDirective
"""
Sort a result list by one or more given columns.
"""
directive @orderBy(
"""
Restrict the allowed column names to a well-defined list.
This improves introspection capabilities and security.
Mutually exclusive with the `columnsEnum` argument.
"""
columns: [String!]
"""
Use an existing enumeration type to restrict the allowed columns to a predefined list.
This allowes you to re-use the same enum for multiple fields.
Mutually exclusive with the `columns` argument.
"""
columnsEnum: String
) on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\WhereConditions\WhereConditionsDirective
"""
Add a dynamically client-controlled WHERE condition to a fields query.
"""
directive @whereConditions(
"""
Restrict the allowed column names to a well-defined list.
This improves introspection capabilities and security.
Mutually exclusive with the `columnsEnum` argument.
"""
columns: [String!]
"""
Use an existing enumeration type to restrict the allowed columns to a predefined list.
This allowes you to re-use the same enum for multiple fields.
Mutually exclusive with the `columns` argument.
"""
columnsEnum: String
) on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\WhereConditions\WhereHasConditionsDirective
"""
Allows clients to filter a query based on the existence of a related model, using
a dynamically controlled `WHERE` condition that applies to the relationship.
"""
directive @whereHasConditions(
"""
The Eloquent relationship that the conditions will be applied to.
This argument can be omitted if the argument name follows the naming
convention `has{$RELATION}`. For example, if the Eloquent relationship
is named `posts`, the argument name must be `hasPosts`.
"""
relation: String
"""
Restrict the allowed column names to a well-defined list.
This improves introspection capabilities and security.
Mutually exclusive with the `columnsEnum` argument.
"""
columns: [String!]
"""
Use an existing enumeration type to restrict the allowed columns to a predefined list.
This allowes you to re-use the same enum for multiple fields.
Mutually exclusive with the `columns` argument.
"""
columnsEnum: String
) on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\AllDirective
directive @all(
"""
Specify the class name of the model to use.
This is only needed when the default model detection does not work.
"""
model: String
"""
Apply scopes to the underlying query.
"""
scopes: [String!]
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\AuthDirective
"""
Return the currently authenticated user as the result of a query.
"""
directive @auth(
"""
Use a particular guard to retreive the user.
"""
guard: String
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\BcryptDirective
"""
Run the `bcrypt` function on the argument it is defined on.
@deprecated(reason: "Use @hash instead. This directive will be removed in v5.")
"""
directive @bcrypt on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\BelongsToDirective
"""
Resolves a field through the Eloquent `BelongsTo` relationship.
"""
directive @belongsTo(
"""
Specify the relationship method name in the model class,
if it is named different from the field in the schema.
"""
relation: String
"""
Apply scopes to the underlying query.
"""
scopes: [String!]
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\BelongsToManyDirective
"""
Resolves a field through the Eloquent `BelongsToMany` relationship.
"""
directive @belongsToMany(
"""
Specify the relationship method name in the model class,
if it is named different from the field in the schema.
"""
relation: String
"""
Apply scopes to the underlying query.
"""
scopes: [String!]
"""
ALlows to resolve the relation as a paginated list.
Allowed values: `paginator`, `connection`.
"""
type: String
"""
Specify the default quantity of elements to be returned.
Only applies when using pagination.
"""
defaultCount: Int
"""
Specify the maximum quantity of elements to be returned.
Only applies when using pagination.
"""
maxCount: Int
"""
Specify a custom type that implements the Edge interface
to extend edge object.
Only applies when using Relay style "connection" pagination.
"""
edgeType: String
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\BroadcastDirective
directive @broadcast(
"""
Name of the subscription that should be retriggered as a result of this operation..
"""
subscription: String!
"""
Specify whether or not the job should be queued.
This defaults to the global config option `lighthouse.subscriptions.queue_broadcasts`.
"""
shouldQueue: Boolean
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\BuilderDirective
"""
Use an argument to modify the query builder for a field.
"""
directive @builder(
"""
Reference a method that is passed the query builder.
Consists of two parts: a class name and a method name, separated by an `@` symbol.
If you pass only a class name, the method name defaults to `__invoke`.
"""
method: String!
) on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\CacheDirective
"""
Cache the result of a resolver.
"""
directive @cache(
"""
Set the duration it takes for the cache to expire in seconds.
If not given, the result will be stored forever.
"""
maxAge: Int
"""
Limit access to cached data to the currently authenticated user.
When the field is accessible by guest users, this will not have
any effect, they will access a shared cache.
"""
private: Boolean = false
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\CacheKeyDirective
"""
Specify the field to use as a key when creating a cache.
"""
directive @cacheKey on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\CanDirective
"""
Check a Laravel Policy to ensure the current user is authorized to access a field.
When `injectArgs` and `args` are used together, the client given
arguments will be passed before the static args.
"""
directive @can(
"""
The ability to check permissions for.
"""
ability: String!
"""
The name of the argument that is used to find a specific model
instance against which the permissions should be checked.
You may pass the string as a dot notation to search in a array.
"""
find: String
"""
Specify the class name of the model to use.
This is only needed when the default model detection does not work.
"""
model: String
"""
Pass along the client given input data as arguments to `Gate::check`.
"""
injectArgs: Boolean = false
"""
Statically defined arguments that are passed to `Gate::check`.
You may pass pass arbitrary GraphQL literals,
e.g.: [1, 2, 3] or { foo: "bar" }
"""
args: Mixed
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\ComplexityDirective
"""
Customize the calculation of a fields complexity score before execution.
"""
directive @complexity(
"""
Reference a function to customize the complexity score calculation.
Consists of two parts: a class name and a method name, seperated by an `@` symbol.
If you pass only a class name, the method name defaults to `__invoke`.
"""
resolver: String
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\CountDirective
"""
Returns the count of a given relationship or model.
"""
directive @count(
"""
The relationship which you want to run the count on.
"""
relation: String
"""
The model to run the count on.
"""
model: String
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\CreateDirective
"""
Create a new Eloquent model with the given arguments.
"""
directive @create(
"""
Specify the class name of the model to use.
This is only needed when the default model detection does not work.
"""
model: String
"""
Specify the name of the relation on the parent model.
This is only needed when using this directive as a nested arg
resolver and if the name of the relation is not the arg name.
"""
relation: String
) on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\DeleteDirective
"""
Delete one or more models by their ID.
The field must have a single non-null argument that may be a list.
"""
directive @delete(
"""
Set to `true` to use global ids for finding the model.
If set to `false`, regular non-global ids are used.
"""
globalId: Boolean = false
"""
Specify the class name of the model to use.
This is only needed when the default model detection does not work.
"""
model: String
"""
Specify the name of the relation on the parent model.
This is only needed when using this directive as a nested arg
resolver and if the name of the relation is not the arg name.
"""
relation: String
) on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\DeprecatedDirective
"""
Marks an element of a GraphQL schema as no longer supported.
"""
directive @deprecated(
"""
Explains why this element was deprecated, usually also including a
suggestion for how to access supported similar data. Formatted
in [Markdown](https://daringfireball.net/projects/markdown/).
"""
reason: String = "No longer supported"
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\EnumDirective
"""
Assign an internal value to an enum key.
When dealing with the Enum type in your code,
you will receive the defined value instead of the string key.
"""
directive @enum(
"""
The internal value of the enum key.
You can use any constant literal value: https://graphql.github.io/graphql-spec/draft/#sec-Input-Values
"""
value: Mixed
) on ENUM_VALUE
# Directive class: Nuwave\Lighthouse\Schema\Directives\EqDirective
directive @eq(
"""
Specify the database column to compare.
Only required if database column has a different name than the attribute in your schema.
"""
key: String
) on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\EventDirective
"""
Fire an event after a mutation has taken place.
It requires the `dispatch` argument that should be
the class name of the event you want to fire.
"""
directive @event(
"""
Specify the fully qualified class name (FQCN) of the event to dispatch.
"""
dispatch: String!
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\FieldDirective
"""
Assign a resolver function to a field.
"""
directive @field(
"""
A reference to the resolver function to be used.
Consists of two parts: a class name and a method name, seperated by an `@` symbol.
If you pass only a class name, the method name defaults to `__invoke`.
"""
resolver: String!
"""
Supply additional data to the resolver.
"""
args: [String!]
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\FindDirective
"""
Find a model based on the arguments provided.
"""
directive @find(
"""
Specify the class name of the model to use.
This is only needed when the default model detection does not work.
"""
model: String
"""
Apply scopes to the underlying query.
"""
scopes: [String!]
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\FirstDirective
"""
Get the first query result from a collection of Eloquent models.
"""
directive @first(
"""
Specify the class name of the model to use.
This is only needed when the default model detection does not work.
"""
model: String
"""
Apply scopes to the underlying query.
"""
scopes: [String!]
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\GlobalIdDirective
"""
Converts between IDs/types and global IDs.
When used upon a field, it encodes,
when used upon an argument, it decodes.
"""
directive @globalId(
"""
By default, an array of `[$type, $id]` is returned when decoding.
You may limit this to returning just one of both.
Allowed values: "ARRAY", "TYPE", "ID"
"""
decode: String = "ARRAY"
) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\GuardDirective
"""
Run authentication through one or more guards.
This is run per field and may allow unauthenticated
users to still receive partial results.
"""
directive @guard(
"""
Specify which guards to use, e.g. "api".
When not defined, the default driver is used.
"""
with: [String!]
) on FIELD_DEFINITION | OBJECT
# Directive class: Nuwave\Lighthouse\Schema\Directives\HasManyDirective
"""
Corresponds to [the Eloquent relationship HasMany](https://laravel.com/docs/eloquent-relationships#one-to-many).
"""
directive @hasMany(
"""
Specify the relationship method name in the model class,
if it is named different from the field in the schema.
"""
relation: String
"""
Apply scopes to the underlying query.
"""
scopes: [String!]
"""
ALlows to resolve the relation as a paginated list.
Allowed values: `paginator`, `connection`.
"""
type: String
"""
Specify the default quantity of elements to be returned.
Only applies when using pagination.
"""
defaultCount: Int
"""
Specify the maximum quantity of elements to be returned.
Only applies when using pagination.
"""
maxCount: Int
"""
Specify a custom type that implements the Edge interface
to extend edge object.
Only applies when using Relay style "connection" pagination.
"""
edgeType: String
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\HasOneDirective
"""
Corresponds to [the Eloquent relationship HasOne](https://laravel.com/docs/eloquent-relationships#one-to-one).
"""
directive @hasOne(
"""
Specify the relationship method name in the model class,
if it is named different from the field in the schema.
"""
relation: String
"""
Apply scopes to the underlying query.
"""
scopes: [String!]
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\HashDirective
"""
Use Laravel hashing to transform an argument value.
Useful for hashing passwords before inserting them into the database.
This uses the default hashing driver defined in `config/hashing.php`.
"""
directive @hash on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\InDirective
directive @in(
"""
Specify the database column to compare.
Only required if database column has a different name than the attribute in your schema.
"""
key: String
) on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\InjectDirective
directive @inject(
"""
A path to the property of the context that will be injected.
If the value is nested within the context, you may use dot notation
to get it, e.g. "user.id".
"""
context: String!
"""
The target name of the argument into which the value is injected.
You can use dot notation to set the value at arbitrary depth
within the incoming argument.
"""
name: String!
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\InterfaceDirective
"""
Use a custom resolver to determine the concrete type of an interface.
"""
directive @interface(
"""
Reference to a custom type-resolver function.
Consists of two parts: a class name and a method name, seperated by an `@` symbol.
If you pass only a class name, the method name defaults to `__invoke`.
"""
resolveType: String!
) on INTERFACE
# Directive class: Nuwave\Lighthouse\Schema\Directives\LazyLoadDirective
"""
Perform a [lazy eager load](https://laravel.com/docs/eloquent-relationships#lazy-eager-loading)
on the relations of a list of models.
"""
directive @lazyLoad(
"""
The names of the relationship methods to load.
"""
relations: [String!]!
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\MethodDirective
"""
Resolve a field by calling a method on the parent object.
Use this if the data is not accessible through simple property access or if you
want to pass argument to the method.
"""
directive @method(
"""
Specify the method of which to fetch the data from.
Defaults to the name of the field if not given.
"""
name: String
"""
Pass the field arguments to the method, using the argument definition
order from the schema to sort them before passing them along.
@deprecated This behaviour will default to true in v5 and this setting will be removed.
"""
passOrdered: Boolean = false
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\MiddlewareDirective
"""
Run Laravel middleware for a specific field or group of fields.
This can be handy to reuse existing HTTP middleware.
"""
directive @middleware(
"""
Specify which middleware to run.
Pass in either a fully qualified class name, an alias or
a middleware group - or any combination of them.
"""
checks: [String!]
) on FIELD_DEFINITION | OBJECT
# Directive class: Nuwave\Lighthouse\Schema\Directives\ModelClassDirective
"""
Map a model class to an object type.
This can be used when the name of the model differs from the name of the type.
**This directive will be renamed to @model in v5.**
"""
directive @modelClass(
"""
The class name of the corresponding model.
"""
class: String!
) on OBJECT
# Directive class: Nuwave\Lighthouse\Schema\Directives\ModelDirective
"""
Enable fetching an Eloquent model by its global id through the `node` query.
@deprecated(reason: "Use @node instead. This directive will be repurposed and do what @modelClass does now in v5.")
"""
directive @model on OBJECT
# Directive class: Nuwave\Lighthouse\Schema\Directives\MorphManyDirective
"""
Corresponds to [Eloquent's MorphMany-Relationship](https://laravel.com/docs/5.8/eloquent-relationships#one-to-one-polymorphic-relations).
"""
directive @morphMany(
"""
Specify the relationship method name in the model class,
if it is named different from the field in the schema.
"""
relation: String
"""
Apply scopes to the underlying query.
"""
scopes: [String!]
"""
ALlows to resolve the relation as a paginated list.
Allowed values: `paginator`, `connection`.
"""
type: String
"""
Specify the default quantity of elements to be returned.
Only applies when using pagination.
"""
defaultCount: Int
"""
Specify the maximum quantity of elements to be returned.
Only applies when using pagination.
"""
maxCount: Int
"""
Specify a custom type that implements the Edge interface
to extend edge object.
Only applies when using Relay style "connection" pagination.
"""
edgeType: String
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\MorphOneDirective
"""
Corresponds to [Eloquent's MorphOne-Relationship](https://laravel.com/docs/5.8/eloquent-relationships#one-to-one-polymorphic-relations).
"""
directive @morphOne(
"""
Specify the relationship method name in the model class,
if it is named different from the field in the schema.
"""
relation: String
"""
Apply scopes to the underlying query.
"""
scopes: [String!]
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\MorphToDirective
"""
Corresponds to [Eloquent's MorphTo-Relationship](https://laravel.com/docs/5.8/eloquent-relationships#one-to-one-polymorphic-relations).
"""
directive @morphTo(
"""
Specify the relationship method name in the model class,
if it is named different from the field in the schema.
"""
relation: String
"""
Apply scopes to the underlying query.
"""
scopes: [String!]
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\NamespaceDirective
"""
Redefine the default namespaces used in other directives.
The arguments are a map from directive names to namespaces.
"""
directive @namespace on FIELD_DEFINITION | OBJECT
# Directive class: Nuwave\Lighthouse\Schema\Directives\NeqDirective
"""
Place a not equals operator `!=` on an Eloquent query.
"""
directive @neq(
"""
Specify the database column to compare.
Only required if database column has a different name than the attribute in your schema.
"""
key: String
) on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\NestDirective
# Add a proper definition by implementing Nuwave\Lighthouse\Support\Contracts\DefinedDirective
directive @nest
# Directive class: Nuwave\Lighthouse\Schema\Directives\NodeDirective
"""
Register a type for Relay's global object identification.
When used without any arguments, Lighthouse will attempt
to resolve the type through a model with the same name.
"""
directive @node(
"""
Reference to resolver function.
Consists of two parts: a class name and a method name, seperated by an `@` symbol.
If you pass only a class name, the method name defaults to `__invoke`.
"""
resolver: String
"""
Specify the class name of the model to use.
This is only needed when the default model detection does not work.
"""
model: String
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\NotInDirective
"""
Filter a column by an array using a `whereNotIn` clause.
"""
directive @notIn(
"""
Specify the name of the column.
Only required if it differs from the name of the argument.
"""
key: String
) on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\PaginateDirective
"""
Query multiple model entries as a paginated list.
"""
directive @paginate(
"""
Which pagination style to use.
Allowed values: `paginator`, `connection`.
"""
type: String = "paginator"
"""
Specify the class name of the model to use.
This is only needed when the default model detection does not work.
"""
model: String
"""
Point to a function that provides a Query Builder instance.
This replaces the use of a model.
"""
builder: String
"""
Apply scopes to the underlying query.
"""
scopes: [String!]
"""
Overwrite the paginate_max_count setting value to limit the
amount of items that a user can request per page.
"""
maxCount: Int
"""
Use a default value for the amount of returned items
in case the client does not request it explicitly
"""
defaultCount: Int
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\RenameDirective
"""
Change the internally used name of a field or argument.
This does not change the schema from a client perspective.
"""
directive @rename(
"""
The internal name of an attribute/property/key.
"""
attribute: String!
) on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\RulesDirective
"""
Validate an argument using [Laravel validation](https://laravel.com/docs/validation).
"""
directive @rules(
"""
Specify the validation rules to apply to the field.
This can either be a reference to [Laravel's built-in validation rules](https://laravel.com/docs/validation#available-validation-rules),
or the fully qualified class name of a custom validation rule.
Rules that mutate the incoming arguments, such as `exclude_if`, are not supported
by Lighthouse. Use ArgTransformerDirectives or FieldMiddlewareDirectives instead.
"""
apply: [String!]!
"""
Specify the messages to return if the validators fail.
Specified as an input object that maps rules to messages,
e.g. { email: "Must be a valid email", max: "The input was too long" }
"""
messages: [RulesMessageMap!]
) on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\RulesForArrayDirective
"""
Run validation on an array itself, using [Laravel built-in validation](https://laravel.com/docs/validation).
"""
directive @rulesForArray(
"""
Specify the validation rules to apply to the field.
This can either be a reference to any of Laravel\'s built-in validation rules: https://laravel.com/docs/validation#available-validation-rules,
or the fully qualified class name of a custom validation rule.
"""
apply: [String!]!
"""
Specify the messages to return if the validators fail.
Specified as an input object that maps rules to messages,
e.g. { email: "Must be a valid email", max: "The input was too long" }
"""
messages: [RulesMessageMap!]
) on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\ScalarDirective
"""
Reference a class implementing a scalar definition.
"""
directive @scalar(
"""
Reference to a class that extends `\GraphQL\Type\Definition\ScalarType`.
"""
class: String!
) on SCALAR
# Directive class: Nuwave\Lighthouse\Schema\Directives\ScopeDirective
"""
Adds a scope to the query builder.
The scope method will receive the client-given value of the argument as the second parameter.
"""
directive @scope(
"""
The name of the scope.
"""
name: String
) on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\SearchDirective
"""
Perform a full-text by the given input value.
"""
directive @search(
"""
Specify a custom index to use for search.
"""
within: String
) on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\SpreadDirective
"""
Merge the fields of a nested input object into the arguments of its parent
when processing the field arguments given by a client.
"""
directive @spread on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\SubscriptionDirective
"""
Reference a class to handle the broadcasting of a subscription to clients.
The given class must extend `\Nuwave\Lighthouse\Schema\Types\GraphQLSubscription`.
"""
directive @subscription(
"""
A reference to a subclass of `\Nuwave\Lighthouse\Schema\Types\GraphQLSubscription`.
"""
class: String!
) on FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\TrimDirective
"""
Run the `trim` function on an input value.
"""
directive @trim on ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
# Directive class: Nuwave\Lighthouse\Schema\Directives\UnionDirective
"""
Use a custom function to determine the concrete type of unions.
"""
directive @union(
"""
Reference a function that returns the implementing Object Type.
Consists of two parts: a class name and a method name, seperated by an `@` symbol.
If you pass only a class name, the method name defaults to `__invoke`.
"""
resolveType: String!
) on UNION