@@ -33,24 +33,24 @@ public function getDerivativeDefinitions($basePluginDefinition) {
3333 $ id = implode ('- ' , [$ viewId , $ displayId , 'view ' ]);
3434 $ info = $ this ->getArgumentsInfo ($ display ->getOption ('arguments ' ) ?: []);
3535 $ arguments = [];
36- $ arguments += $ this ->getContextualArguments ($ info , $ id );
36+ $ arguments += $ this ->getContextualArguments ($ display , $ info , $ id );
3737 $ arguments += $ this ->getPagerArguments ($ display );
3838 $ arguments += $ this ->getSortArguments ($ display , $ id );
3939 $ arguments += $ this ->getFilterArguments ($ display , $ id );
4040 $ types = $ this ->getTypes ($ info );
4141
4242 $ this ->derivatives [$ id ] = [
43- 'id ' => $ id ,
44- 'name ' => $ display ->getGraphQLQueryName (),
45- 'type ' => $ display ->getGraphQLResultName (),
46- 'parents ' => $ types ,
47- 'multi ' => FALSE ,
48- 'arguments ' => $ arguments ,
49- 'view ' => $ viewId ,
50- 'display ' => $ displayId ,
51- 'paged ' => $ this ->isPaged ($ display ),
52- 'arguments_info ' => $ info ,
53- ] + $ this ->getCacheMetadataDefinition ($ view ) + $ basePluginDefinition ;
43+ 'id ' => $ id ,
44+ 'name ' => $ display ->getGraphQLQueryName (),
45+ 'type ' => $ display ->getGraphQLResultName (),
46+ 'parents ' => $ types ,
47+ 'multi ' => FALSE ,
48+ 'arguments ' => $ arguments ,
49+ 'view ' => $ viewId ,
50+ 'display ' => $ displayId ,
51+ 'paged ' => $ this ->isPaged ($ display ),
52+ 'arguments_info ' => $ info ,
53+ ] + $ this ->getCacheMetadataDefinition ($ view ) + $ basePluginDefinition ;
5454 }
5555 }
5656
@@ -60,19 +60,24 @@ public function getDerivativeDefinitions($basePluginDefinition) {
6060 /**
6161 * Helper function to return the contextual filter argument if any exist.
6262 *
63+ * @param \Drupal\views\Plugin\views\display\DisplayPluginInterface $display
64+ * The display plugin.
6365 * @param array $arguments
6466 * The array of available arguments.
6567 * @param $id
6668 * The plugin derivative id.
6769 *
6870 * @return array
6971 * The contextual filter argument if applicable.
72+ *
73+ * The contextual filter argument if applicable.
7074 */
71- protected function getContextualArguments (array $ arguments , $ id ) {
75+ protected function getContextualArguments (DisplayPluginInterface $ display , array $ arguments , $ id ) {
76+ /** @var \Drupal\graphql\Plugin\views\display\GraphQL $display */
7277 if (!empty ($ arguments )) {
7378 return [
7479 'contextualFilter ' => [
75- 'type ' => StringHelper:: camelCase ([ $ id , ' contextual ' , ' filter ' , ' input ' ] ),
80+ 'type ' => $ display -> getGraphQLContextualFilterInputName ( ),
7681 'multi ' => FALSE ,
7782 'nullable ' => TRUE ,
7883 ],
@@ -94,6 +99,7 @@ protected function getContextualArguments(array $arguments, $id) {
9499 * The sort arguments if any exposed sorts are available.
95100 */
96101 protected function getSortArguments (DisplayPluginInterface $ display , $ id ) {
102+ /** @var \Drupal\graphql\Plugin\views\display\GraphQL $display */
97103 $ sorts = array_filter ($ display ->getOption ('sorts ' ) ?: [], function ($ sort ) {
98104 return $ sort ['exposed ' ];
99105 });
@@ -129,13 +135,14 @@ protected function getSortArguments(DisplayPluginInterface $display, $id) {
129135 * The filter argument if any exposed filters are available.
130136 */
131137 protected function getFilterArguments (DisplayPluginInterface $ display , $ id ) {
138+ /** @var \Drupal\graphql\Plugin\views\display\GraphQL $display */
132139 $ filters = array_filter ($ display ->getOption ('filters ' ) ?: [], function ($ filter ) {
133140 return array_key_exists ('exposed ' , $ filter ) && $ filter ['exposed ' ];
134141 });
135142
136143 return !empty ($ filters ) ? [
137144 'filter ' => [
138- 'type ' => StringHelper:: camelCase ([ $ id , ' filter ' , ' input ' ] ),
145+ 'type ' => $ display -> getGraphQLFilterInputName ( ),
139146 'multi ' => FALSE ,
140147 'nullable ' => TRUE ,
141148 ],
0 commit comments