1
<?php
2

3
namespace Nuwave\Lighthouse\Schema\Directives;
4

5
class UnionDirective extends BaseDirective
6
{
7 1
    public static function definition(): string
8
    {
9
        return /** @lang GraphQL */ <<<'GRAPHQL'
10 1
"""
11
Use a custom function to determine the concrete type of unions.
12
"""
13
directive @union(
14
  """
15
  Reference a function that returns the implementing Object Type.
16
  Consists of two parts: a class name and a method name, seperated by an `@` symbol.
17
  If you pass only a class name, the method name defaults to `__invoke`.
18
  """
19
  resolveType: String!
20
) on UNION
21
GRAPHQL;
22
    }
23
}

Read our documentation on viewing source code .

Loading