1 | <?php |
||
14 | trait TypedPluginTrait { |
||
15 | |||
16 | /** |
||
17 | * Add information about cardinality and nullability. |
||
18 | * |
||
19 | * @param \Youshido\GraphQL\Type\TypeInterface $type |
||
20 | * The initial type object. |
||
21 | * @param bool $nullable |
||
22 | * Indicates if the type can be null. |
||
23 | * @param bool $multi |
||
24 | * Indicates if the type is a list. |
||
25 | * |
||
26 | * @return \Youshido\GraphQL\Type\TypeInterface |
||
27 | * The decorated type |
||
28 | * |
||
29 | * @deprecated |
||
30 | * Will be removed before the 1.0 release. Use the type string syntax |
||
31 | * (e.g. [Foo!]) instead. |
||
32 | */ |
||
33 | public function decorateType(TypeInterface $type, $nullable, $multi) { |
||
46 | |||
47 | /** |
||
48 | * Build the plugin type. |
||
49 | * |
||
50 | * @param \Drupal\graphql\Plugin\GraphQL\PluggableSchemaBuilderInterface $schemaBuilder |
||
51 | * Instance of the schema manager to resolve dependencies. |
||
52 | * |
||
53 | * @return \Youshido\GraphQL\Type\TypeInterface |
||
54 | * The type object. |
||
55 | */ |
||
56 | protected function buildType(PluggableSchemaBuilderInterface $schemaBuilder) { |
||
76 | |||
77 | /** |
||
78 | * Parses a type definition from a string and properly decorates it. |
||
79 | * |
||
80 | * Converts type strings (e.g. [Foo!]) to their object representations. |
||
81 | * |
||
82 | * @param string $type |
||
83 | * The type string to parse. |
||
84 | * @param callable $callback |
||
85 | * A callback for retrieving the concrete type object from the extracted |
||
86 | * type name. |
||
87 | * |
||
88 | * @return \Youshido\GraphQL\Type\TypeInterface |
||
89 | * The extracted type with the type decorators applied. |
||
90 | */ |
||
91 | protected function parseType($type, callable $callback) { |
||
120 | |||
121 | /** |
||
122 | * Declares a type as non-nullable. |
||
123 | * |
||
124 | * @param \Youshido\GraphQL\Type\TypeInterface $type |
||
125 | * The type to wrap. |
||
126 | * |
||
127 | * @return \Youshido\GraphQL\Type\NonNullType |
||
128 | * The wrapped type. |
||
129 | */ |
||
130 | protected function nonNullType(TypeInterface $type) { |
||
133 | |||
134 | /** |
||
135 | * Declares a type as a list. |
||
136 | * |
||
137 | * @param \Youshido\GraphQL\Type\TypeInterface $type |
||
138 | * The type to wrap. |
||
139 | * |
||
140 | * @return \Youshido\GraphQL\Type\ListType\ListType |
||
141 | * The wrapped type. |
||
142 | */ |
||
143 | protected function listType(TypeInterface $type) { |
||
146 | |||
147 | } |
||
148 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: